From 803232642d6fbb8822adb60c7bc0a40101880a96 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 26 Mar 2015 21:52:19 +0100 Subject: [PATCH 1/3] Add a cheat the remove Six Flags status from rides --- src/windows/cheats.c | 110 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 104 insertions(+), 6 deletions(-) diff --git a/src/windows/cheats.c b/src/windows/cheats.c index e425d92aac..4c9fb86647 100644 --- a/src/windows/cheats.c +++ b/src/windows/cheats.c @@ -40,6 +40,7 @@ enum { WINDOW_CHEATS_PAGE_MONEY, WINDOW_CHEATS_PAGE_GUESTS, WINDOW_CHEATS_PAGE_MISC, + WINDOW_CHEATS_PAGE_RIDES, }; enum WINDOW_CHEATS_WIDGET_IDX { @@ -50,11 +51,12 @@ enum WINDOW_CHEATS_WIDGET_IDX { WIDX_TAB_1, WIDX_TAB_2, WIDX_TAB_3, + WIDX_TAB_4, WIDX_HIGH_MONEY, WIDX_PARK_ENTRANCE_FEE, - WIDX_HAPPY_GUESTS = 7, //Same as HIGH_MONEY as it is also the 7th widget but on a different page + WIDX_HAPPY_GUESTS = 8, //Same as HIGH_MONEY as it is also the 8th widget but on a different page WIDX_TRAM_GUESTS, - WIDX_FREEZE_CLIMATE = 7, + WIDX_FREEZE_CLIMATE = 8, WIDX_OPEN_CLOSE_PARK, WIDX_DECREASE_GAME_SPEED, WIDX_INCREASE_GAME_SPEED, @@ -67,7 +69,8 @@ enum WINDOW_CHEATS_WIDGET_IDX { WIDX_FIX_VANDALISM, WIDX_REMOVE_LITTER, WIDX_WIN_SCENARIO, - WIDX_RENEW_RIDES + WIDX_RENEW_RIDES = 8, + WIDX_REMOVE_SIX_FLAGS }; #pragma region MEASUREMENTS @@ -96,6 +99,7 @@ static rct_widget window_cheats_money_widgets[] = { { WWT_TAB, 1, 3, 33, 17, 43, 0x2000144E, 2462}, // tab 1 { WWT_TAB, 1, 34, 64, 17, 43, 0x2000144E, 2462}, // tab 2 { WWT_TAB, 1, 65, 95, 17, 43, 0x2000144E, 2462}, // tab 3 + { WWT_TAB, 1, 96, 126, 17, 43, 0x2000144E, 2462}, // tab 4 { WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(1), HPL(1), 2760, STR_NONE}, // high money { WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(3), HPL(3), 2761, STR_NONE}, //Park Entrance Fee Toggle { WIDGETS_END }, @@ -109,6 +113,7 @@ static rct_widget window_cheats_guests_widgets[] = { { WWT_TAB, 1, 3, 33, 17, 43, 0x2000144E, 2462 }, // tab 1 { WWT_TAB, 1, 34, 64, 17, 43, 0x2000144E, 2462 }, // tab 2 { WWT_TAB, 1, 65, 95, 17, 43, 0x2000144E, 2462 }, // tab 3 + { WWT_TAB, 1, 96, 126, 17, 43, 0x2000144E, 2462}, // tab 4 { WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(1), HPL(1), 2764, STR_NONE}, // happy guests { WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(3), HPL(3), 2765, STR_NONE}, // happy guests { WIDGETS_END }, @@ -123,6 +128,7 @@ static rct_widget window_cheats_misc_widgets[] = { { WWT_TAB, 1, 3, 33, 17, 43, 0x2000144E, 2462 }, // tab 1 { WWT_TAB, 1, 34, 64, 17, 43, 0x2000144E, 2462 }, // tab 2 { WWT_TAB, 1, 65, 95, 17, 43, 0x2000144E, 2462}, // tab 3 + { WWT_TAB, 1, 96, 126, 17, 43, 0x2000144E, 2462}, // tab 4 { WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(0), HPL(0), 2767, STR_NONE}, // Freeze climate { WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(1), HPL(1), 2769, STR_NONE}, // open / close park { WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(2), HPL(2), 2771, STR_NONE}, // decrease game speed @@ -138,7 +144,19 @@ static rct_widget window_cheats_misc_widgets[] = { { WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(7), HPL(7), 2756, STR_NONE}, // Remove litter { WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(0), HPL(0), 2766, STR_NONE}, // Win scenario + { WIDGETS_END }, +}; +static rct_widget window_cheats_rides_widgets[] = { + { WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, 0x0FFFFFFFF, 65535 }, // panel / background + { WWT_CAPTION, 0, 1, WW - 2, 1, 14, 3165, STR_WINDOW_TITLE_TIP }, // title bar + { WWT_CLOSEBOX, 0, WW - 13, WW - 3, 2, 13, 0x338, STR_CLOSE_WINDOW_TIP }, // close x button + { WWT_IMGBTN, 1, 0, WW - 1, 43, WH - 1, 0x0FFFFFFFF, 65535 }, // tab content panel + { WWT_TAB, 1, 3, 33, 17, 43, 0x2000144E, 2462 }, // tab 1 + { WWT_TAB, 1, 34, 64, 17, 43, 0x2000144E, 2462 }, // tab 2 + { WWT_TAB, 1, 65, 95, 17, 43, 0x2000144E, 2462}, // tab 3 + { WWT_TAB, 1, 96, 126, 17, 43, 0x2000144E, 2462}, // tab 4 { WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(7), HPL(7), 5123, STR_NONE}, // Renew rides + { WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(8), HPL(8), 5124, STR_NONE}, // Remove flags { WIDGETS_END }, }; @@ -146,12 +164,14 @@ static rct_widget *window_cheats_page_widgets[] = { window_cheats_money_widgets, window_cheats_guests_widgets, window_cheats_misc_widgets, + window_cheats_rides_widgets, }; static void window_cheats_emptysub() { } static void window_cheats_money_mouseup(); static void window_cheats_guests_mouseup(); static void window_cheats_misc_mouseup(); +static void window_cheats_rides_mouseup(); static void window_cheats_misc_tool_update(); static void window_cheats_misc_tool_down(); static void window_cheats_update(rct_window *w); @@ -252,16 +272,50 @@ static void* window_cheats_misc_events[] = { window_cheats_emptysub }; +static void* window_cheats_rides_events[] = { + window_cheats_emptysub, + window_cheats_rides_mouseup, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_update, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_emptysub, + window_cheats_invalidate, + window_cheats_paint, + window_cheats_emptysub +}; + + static void* window_cheats_page_events[] = { window_cheats_money_events, window_cheats_guests_events, window_cheats_misc_events, + window_cheats_rides_events, }; static uint32 window_cheats_page_enabled_widgets[] = { - (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_HIGH_MONEY) | (1 << WIDX_PARK_ENTRANCE_FEE), - (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_HAPPY_GUESTS) | (1 << WIDX_TRAM_GUESTS), - (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_FREEZE_CLIMATE) | (1 << WIDX_OPEN_CLOSE_PARK) | (1 << WIDX_DECREASE_GAME_SPEED) | (1 << WIDX_INCREASE_GAME_SPEED) | (1 << WIDX_ZERO_CLEARANCE) | (1 << WIDX_WEATHER_SUN) | (1 << WIDX_WEATHER_THUNDER) | (1 << WIDX_CLEAR_GRASS) | (1 << WIDX_MOWED_GRASS) | (1 << WIDX_WATER_PLANTS) | (1 << WIDX_FIX_VANDALISM) | (1 << WIDX_REMOVE_LITTER) | (1 << WIDX_WIN_SCENARIO) | (1 << WIDX_RENEW_RIDES) + (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_HIGH_MONEY) | (1 << WIDX_PARK_ENTRANCE_FEE), + (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_HAPPY_GUESTS) | (1 << WIDX_TRAM_GUESTS), + (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_FREEZE_CLIMATE) | (1 << WIDX_OPEN_CLOSE_PARK) | (1 << WIDX_DECREASE_GAME_SPEED) | (1 << WIDX_INCREASE_GAME_SPEED) | (1 << WIDX_ZERO_CLEARANCE) | (1 << WIDX_WEATHER_SUN) | (1 << WIDX_WEATHER_THUNDER) | (1 << WIDX_CLEAR_GRASS) | (1 << WIDX_MOWED_GRASS) | (1 << WIDX_WATER_PLANTS) | (1 << WIDX_FIX_VANDALISM) | (1 << WIDX_REMOVE_LITTER) | (1 << WIDX_WIN_SCENARIO), + (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_RENEW_RIDES) | (1 << WIDX_REMOVE_SIX_FLAGS) }; static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w); @@ -364,6 +418,18 @@ static void cheat_renew_rides() window_invalidate_by_class(WC_RIDE); } +static void cheat_remove_six_flags() +{ + int i; + rct_ride *ride; + FOR_ALL_RIDES(i, ride) + { + if (ride->lifecycle_flags & RIDE_LIFECYCLE_SIX_FLAGS) + ride->lifecycle_flags&=~RIDE_LIFECYCLE_SIX_FLAGS; + } + window_invalidate_by_class(WC_RIDE); +} + static void cheat_clear_loan() { // TODO, this sets the loan but stops loan borrowing from working, possible due to cheat detection stuff @@ -441,6 +507,7 @@ static void window_cheats_money_mouseup() case WIDX_TAB_1: case WIDX_TAB_2: case WIDX_TAB_3: + case WIDX_TAB_4: window_cheats_set_page(w, widgetIndex - WIDX_TAB_1); break; case WIDX_HIGH_MONEY: @@ -467,6 +534,7 @@ static void window_cheats_guests_mouseup() case WIDX_TAB_1: case WIDX_TAB_2: case WIDX_TAB_3: + case WIDX_TAB_4: window_cheats_set_page(w, widgetIndex - WIDX_TAB_1); break; case WIDX_HAPPY_GUESTS: @@ -492,6 +560,7 @@ static void window_cheats_misc_mouseup() case WIDX_TAB_1: case WIDX_TAB_2: case WIDX_TAB_3: + case WIDX_TAB_4: window_cheats_set_page(w, widgetIndex - WIDX_TAB_1); break; case WIDX_FREEZE_CLIMATE: @@ -536,9 +605,32 @@ static void window_cheats_misc_mouseup() case WIDX_WIN_SCENARIO: scenario_success(); break; + } +} + +static void window_cheats_rides_mouseup() +{ + short widgetIndex; + rct_window *w; + + window_widget_get_registers(w, widgetIndex); + + switch (widgetIndex) { + case WIDX_CLOSE: + window_close(w); + break; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + window_cheats_set_page(w, widgetIndex - WIDX_TAB_1); + break; case WIDX_RENEW_RIDES: cheat_renew_rides(); break; + case WIDX_REMOVE_SIX_FLAGS: + cheat_remove_six_flags(); + break; } } @@ -626,6 +718,12 @@ static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) sprite_idx = SPR_TAB_QUESTION; gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top, 0); } + + // Rides tab + if (!(w->disabled_widgets & (1 << WIDX_TAB_4))) { + sprite_idx = SPR_RIDE; + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_4].left, w->y + w->widgets[WIDX_TAB_4].top, 0); + } } static void window_cheats_set_page(rct_window *w, int page) From 9828b93e189a35631a3459441421fed023dc04e3 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 26 Mar 2015 21:53:29 +0100 Subject: [PATCH 2/3] Add a cheat to remove Six Flags status from rides --- data/language/english_uk.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/data/language/english_uk.txt b/data/language/english_uk.txt index 787a3012ae..e982a4a934 100644 --- a/data/language/english_uk.txt +++ b/data/language/english_uk.txt @@ -3457,3 +3457,4 @@ STR_5120 :Show finances button on toolbar STR_5121 :Show research button on toolbar STR_5122 :Show all vehicles sharing a track/ride type STR_5123 :Renew rides +STR_5124 :No Six Flags From 2248e8623db3da19483e8648471a4fdf8e7c5dee Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sat, 28 Mar 2015 17:20:19 +0000 Subject: [PATCH 3/3] fix cheat window tab images --- src/windows/cheats.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/windows/cheats.c b/src/windows/cheats.c index 4c9fb86647..a2008b9a58 100644 --- a/src/windows/cheats.c +++ b/src/windows/cheats.c @@ -715,13 +715,15 @@ static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) // Misc tab if (!(w->disabled_widgets & (1 << WIDX_TAB_3))) { - sprite_idx = SPR_TAB_QUESTION; + sprite_idx = STR_TAB_PARK; gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top, 0); } // Rides tab if (!(w->disabled_widgets & (1 << WIDX_TAB_4))) { - sprite_idx = SPR_RIDE; + sprite_idx = SPR_TAB_RIDE_0; + if (w->page == WINDOW_CHEATS_PAGE_RIDES) + sprite_idx += (w->frame_no / 4) % 16; gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_4].left, w->y + w->widgets[WIDX_TAB_4].top, 0); } } @@ -729,6 +731,7 @@ static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) static void window_cheats_set_page(rct_window *w, int page) { w->page = page; + w->frame_no = 0; w->enabled_widgets = window_cheats_page_enabled_widgets[page];