From a944c1a15c926b25d4fca5640fedc5e42ae8d756 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 19 Aug 2024 18:38:08 +0200 Subject: [PATCH 1/7] Move date cheats to their own tab --- data/language/en-GB.txt | 2 + src/openrct2-ui/UiStringIds.h | 2 + src/openrct2-ui/windows/Cheats.cpp | 107 ++++++++++++++++++++--------- 3 files changed, 80 insertions(+), 31 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 628440ec4e97..da00bfff7c2a 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3732,6 +3732,8 @@ STR_6659 :Guests ignore prices STR_6660 :Guests will ignore the price of rides and stalls. STR_6661 :Randomise all STR_6662 :Randomise colours for every train or vehicle. +STR_6663 :Date cheats +STR_6664 :Show date cheats ############# # Scenarios # diff --git a/src/openrct2-ui/UiStringIds.h b/src/openrct2-ui/UiStringIds.h index 4d4d5d132a2b..0d7bed6961bf 100644 --- a/src/openrct2-ui/UiStringIds.h +++ b/src/openrct2-ui/UiStringIds.h @@ -380,6 +380,7 @@ namespace OpenRCT2 STR_CHEAT_RENEW_RIDES_TIP = 5791, STR_CHEAT_RESET_CRASH_STATUS_TIP = 5793, STR_CHEAT_STAFF_GROUP = 5466, + STR_CHEAT_TITLE_DATE = 6663, STR_CHEAT_TITLE_FINANCIAL = 5345, STR_CHEAT_TITLE_GUEST = 5346, STR_CHEAT_TITLE_PARK = 5347, @@ -388,6 +389,7 @@ namespace OpenRCT2 STR_CHEAT_WEATHER_GROUP = 5465, STR_CREATE_DUCKS = 6331, STR_CREATE_DUCKS_TIP = 6356, + STR_DATE_CHEATS_TIP = 6664, STR_DATE_RESET = 6200, STR_DATE_SET = 6199, STR_DAY = 6198, diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index d628458b4e61..102900fb827d 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -28,7 +28,6 @@ #include #include -using OpenRCT2::Date; namespace OpenRCT2::Ui::Windows { constexpr auto CHEATS_MONEY_DEFAULT = 10000.00_GBP; @@ -38,6 +37,7 @@ namespace OpenRCT2::Ui::Windows enum { WINDOW_CHEATS_PAGE_MONEY, + WINDOW_CHEATS_PAGE_DATE, WINDOW_CHEATS_PAGE_GUESTS, WINDOW_CHEATS_PAGE_MISC, WINDOW_CHEATS_PAGE_RIDES, @@ -74,6 +74,7 @@ enum WindowCheatsWidgetIdx WIDX_TAB_2, WIDX_TAB_3, WIDX_TAB_4, + WIDX_TAB_5, WIDX_TAB_CONTENT, WIDX_NO_MONEY = WIDX_TAB_CONTENT, @@ -84,7 +85,8 @@ enum WindowCheatsWidgetIdx WIDX_ADD_MONEY, WIDX_SET_MONEY, WIDX_CLEAR_LOAN, - WIDX_DATE_GROUP, + + WIDX_DATE_GROUP = WIDX_TAB_CONTENT, WIDX_YEAR_BOX, WIDX_YEAR_UP, WIDX_YEAR_DOWN, @@ -195,32 +197,38 @@ static constexpr ScreenSize MINMAX_BUTTON = {55, 17}; static constexpr int32_t TAB_WIDTH = 31; static constexpr int32_t TAB_START = 3; - #pragma endregion #define MAIN_CHEATS_WIDGETS \ WINDOW_SHIM(WINDOW_TITLE, WW, WH), \ - MakeWidget({ 0, 43}, {WW, 257}, WindowWidgetType::Resize, WindowColour::Secondary), /* tab content panel */ \ - MakeTab ({ 3, 17}, STR_FINANCIAL_CHEATS_TIP ), /* tab 1 */ \ - MakeTab ({34, 17}, STR_GUEST_CHEATS_TIP ), /* tab 2 */ \ - MakeTab ({65, 17}, STR_PARK_CHEATS_TIP ), /* tab 3 */ \ - MakeTab ({96, 17}, STR_RIDE_CHEATS_TIP ) /* tab 4 */ + MakeWidget({ 0, 43}, {WW, 257}, WindowWidgetType::Resize, WindowColour::Secondary), /* tab content panel */ \ + MakeTab ({ 3, 17}, STR_FINANCIAL_CHEATS_TIP ), /* tab 1 */ \ + MakeTab ({ 34, 17}, STR_DATE_CHEATS_TIP ), /* tab 2 */ \ + MakeTab ({ 65, 17}, STR_GUEST_CHEATS_TIP ), /* tab 3 */ \ + MakeTab ({ 96, 17}, STR_PARK_CHEATS_TIP ), /* tab 4 */ \ + MakeTab ({127, 17}, STR_RIDE_CHEATS_TIP ) /* tab 5 */ static Widget window_cheats_money_widgets[] = { MAIN_CHEATS_WIDGETS, MakeWidget ({ 11, 48}, CHEAT_BUTTON, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_MAKE_PARK_NO_MONEY), // No money - MakeWidget ({ 5, 69}, {238, 69}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_ADD_SET_MONEY ), // add / set money group frame + MakeWidget ({ 5, 69}, {238, 69}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_ADD_SET_MONEY ), // add / set money group frame MakeSpinnerWidgets({ 11, 92}, CHEAT_SPINNER, WindowWidgetType::Spinner, WindowColour::Secondary ), // money value MakeWidget ({ 11, 111}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_ADD_MONEY ), // add money MakeWidget ({127, 111}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SET_MONEY ), // set money - MakeWidget ({ 11, 153}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_CLEAR_LOAN ), // Clear loan - MakeWidget ({ 5, 184}, {238, 101}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_DATE_SET ), // Date group - MakeSpinnerWidgets({120, 197}, CHEAT_SPINNER, WindowWidgetType::Spinner, WindowColour::Secondary ), // Year box - MakeSpinnerWidgets({120, 218}, CHEAT_SPINNER, WindowWidgetType::Spinner, WindowColour::Secondary ), // Month box - MakeSpinnerWidgets({120, 239}, CHEAT_SPINNER, WindowWidgetType::Spinner, WindowColour::Secondary ), // Day box - MakeWidget ({ 11, 258}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_DATE_SET ), // Set Date - MakeWidget ({127, 258}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_DATE_RESET ), // Reset Date + MakeWidget ({ 11, 145}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_CLEAR_LOAN ), // Clear loan + kWidgetsEnd, +}; + +static Widget window_cheats_date_widgets[] = +{ + MAIN_CHEATS_WIDGETS, + MakeWidget ({ 5, 48}, {238, 99} , WindowWidgetType::Groupbox, WindowColour::Secondary, STR_DATE_SET ), // Date group + MakeSpinnerWidgets({120, 61}, CHEAT_SPINNER, WindowWidgetType::Spinner, WindowColour::Secondary ), // Year box + MakeSpinnerWidgets({120, 82}, CHEAT_SPINNER, WindowWidgetType::Spinner, WindowColour::Secondary ), // Month box + MakeSpinnerWidgets({120, 103}, CHEAT_SPINNER, WindowWidgetType::Spinner, WindowColour::Secondary ), // Day box + MakeWidget ({ 11, 122}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_DATE_SET ), // Set Date + MakeWidget ({127, 122}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_DATE_RESET), // Reset Date kWidgetsEnd, }; @@ -329,6 +337,7 @@ static Widget window_cheats_rides_widgets[] = static Widget *window_cheats_page_widgets[] = { window_cheats_money_widgets, + window_cheats_date_widgets, window_cheats_guests_widgets, window_cheats_misc_widgets, window_cheats_rides_widgets, @@ -337,7 +346,8 @@ static Widget *window_cheats_page_widgets[] = static uint64_t window_cheats_page_hold_down_widgets[] = { (1uLL << WIDX_MONEY_SPINNER_INCREMENT) | (1uLL << WIDX_MONEY_SPINNER_DECREMENT) | - (1uLL << WIDX_ADD_MONEY) | + (1uLL << WIDX_ADD_MONEY), + (1uLL << WIDX_YEAR_UP) | (1uLL << WIDX_YEAR_DOWN) | (1uLL << WIDX_MONTH_UP) | @@ -355,6 +365,7 @@ static uint64_t window_cheats_page_hold_down_widgets[] = { static StringId window_cheats_page_titles[] = { STR_CHEAT_TITLE_FINANCIAL, + STR_CHEAT_TITLE_DATE, STR_CHEAT_TITLE_GUEST, STR_CHEAT_TITLE_PARK, STR_CHEAT_TITLE_RIDE, @@ -391,6 +402,9 @@ static StringId window_cheats_page_titles[] = { case WINDOW_CHEATS_PAGE_MONEY: OnMouseDownMoney(widgetIndex); break; + case WINDOW_CHEATS_PAGE_DATE: + OnMouseDownDate(widgetIndex); + break; case WINDOW_CHEATS_PAGE_MISC: OnMouseDownMisc(widgetIndex); break; @@ -408,6 +422,7 @@ static StringId window_cheats_page_titles[] = { case WIDX_TAB_2: case WIDX_TAB_3: case WIDX_TAB_4: + case WIDX_TAB_5: SetPage(widgetIndex - WIDX_TAB_1); break; default: @@ -547,24 +562,36 @@ static StringId window_cheats_page_titles[] = { { colour.setFlag(ColourFlag::inset, true); } - int32_t actual_month = _monthSpinnerValue - 1; DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_BOTTOM_TOOLBAR_CASH, ft, { colour }); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_YEAR); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_MONTH); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 240 }, STR_DAY); - ft = Formatter(); + } + else if (page == WINDOW_CHEATS_PAGE_DATE) + { + auto& yearBox = widgets[WIDX_YEAR_BOX]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, yearBox.top + 2 }, STR_YEAR); + + auto& monthBox = widgets[WIDX_MONTH_BOX]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, monthBox.top + 2 }, STR_MONTH); + + auto& dayBox = widgets[WIDX_DAY_BOX]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, dayBox.top + 2 }, STR_DAY); + + auto ft = Formatter(); ft.Add(_yearSpinnerValue); DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ _xRcol, 198 }, STR_FORMAT_INTEGER, ft, + dpi, windowPos + ScreenCoordsXY{ _xRcol, yearBox.top + 2 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); + ft = Formatter(); + int32_t actual_month = _monthSpinnerValue - 1; ft.Add(actual_month); DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ _xRcol, 219 }, STR_FORMAT_MONTH, ft, { colours[1], TextAlignment::RIGHT }); + dpi, windowPos + ScreenCoordsXY{ _xRcol, monthBox.top + 2 }, STR_FORMAT_MONTH, ft, + { colours[1], TextAlignment::RIGHT }); + ft = Formatter(); ft.Add(_daySpinnerValue); DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ _xRcol, 240 }, STR_FORMAT_INTEGER, ft, + dpi, windowPos + ScreenCoordsXY{ _xRcol, dayBox.top + 2 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); } else if (page == WINDOW_CHEATS_PAGE_MISC) @@ -659,6 +686,7 @@ static StringId window_cheats_page_titles[] = { WIDX_TAB_2, WIDX_TAB_3, WIDX_TAB_4, + WIDX_TAB_5, }; auto left = TAB_START; @@ -684,32 +712,42 @@ static StringId window_cheats_page_titles[] = { dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }); } - // Guests tab + // Date tab if (!IsWidgetDisabled(WIDX_TAB_2)) + { + uint32_t sprite_idx = SPR_TAB_TIMER_0; + if (page == WINDOW_CHEATS_PAGE_DATE) + sprite_idx += (frame_no / 8) % 8; + GfxDrawSprite( + dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); + } + + // Guests tab + if (!IsWidgetDisabled(WIDX_TAB_3)) { uint32_t sprite_idx = SPR_TAB_GUESTS_0; if (page == WINDOW_CHEATS_PAGE_GUESTS) sprite_idx += (frame_no / 3) % 8; GfxDrawSprite( - dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); + dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); } // Misc tab - if (!IsWidgetDisabled(WIDX_TAB_3)) + if (!IsWidgetDisabled(WIDX_TAB_4)) { GfxDrawSprite( dpi, ImageId(SPR_TAB_PARK), - windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top }); } // Rides tab - if (!IsWidgetDisabled(WIDX_TAB_4)) + if (!IsWidgetDisabled(WIDX_TAB_5)) { uint32_t sprite_idx = SPR_TAB_RIDE_0; if (page == WINDOW_CHEATS_PAGE_RIDES) sprite_idx += (frame_no / 4) % 16; GfxDrawSprite( - dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top }); + dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_5].left, widgets[WIDX_TAB_5].top }); } } @@ -732,6 +770,13 @@ static StringId window_cheats_page_titles[] = { case WIDX_ADD_MONEY: CheatsSet(CheatType::AddMoney, _moneySpinnerValue); break; + } + } + + void OnMouseDownDate(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { case WIDX_YEAR_UP: _yearSpinnerValue++; _yearSpinnerValue = std::clamp(_yearSpinnerValue, 1, kMaxYear); From 76ccc1b54e09ff9c38eee77b2742209b6705863e Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 19 Aug 2024 19:28:12 +0200 Subject: [PATCH 2/7] Move nature/weather cheats to their own tab --- data/language/en-GB.txt | 3 + src/openrct2-ui/UiStringIds.h | 3 + src/openrct2-ui/windows/Cheats.cpp | 185 +++++++++++++++++++---------- 3 files changed, 130 insertions(+), 61 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index da00bfff7c2a..3282f35cd18f 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3734,6 +3734,9 @@ STR_6661 :Randomise all STR_6662 :Randomise colours for every train or vehicle. STR_6663 :Date cheats STR_6664 :Show date cheats +STR_6665 :Nature/weather cheats +STR_6666 :Show nature/weather cheats +STR_6667 :Fauna ############# # Scenarios # diff --git a/src/openrct2-ui/UiStringIds.h b/src/openrct2-ui/UiStringIds.h index 0d7bed6961bf..1f9b82f9352f 100644 --- a/src/openrct2-ui/UiStringIds.h +++ b/src/openrct2-ui/UiStringIds.h @@ -385,6 +385,7 @@ namespace OpenRCT2 STR_CHEAT_TITLE_GUEST = 5346, STR_CHEAT_TITLE_PARK = 5347, STR_CHEAT_TITLE_RIDE = 5348, + STR_CHEAT_TITLE_WEATHER = 6665, STR_CHEAT_UNLOCK_OPERATING_LIMITS_TIP = 5585, STR_CHEAT_WEATHER_GROUP = 5465, STR_CREATE_DUCKS = 6331, @@ -394,6 +395,7 @@ namespace OpenRCT2 STR_DATE_SET = 6199, STR_DAY = 6198, STR_FAST = 5367, + STR_FAUNA = 6667, STR_FINANCIAL_CHEATS_TIP = 5178, STR_FORMAT_MONTH = 6201, STR_FROZEN = 6232, @@ -408,6 +410,7 @@ namespace OpenRCT2 STR_RIDE_CHEATS_TIP = 5181, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE = 5563, STR_WARNING_IN_CAPS = 5562, + STR_WEATHER_NATURE_CHEATS_TIP = 6666, STR_YEAR = 6196, STR_CHEAT_IGNORE_PRICE_TIP = 6660, diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 102900fb827d..e08239462359 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -41,6 +41,7 @@ enum WINDOW_CHEATS_PAGE_GUESTS, WINDOW_CHEATS_PAGE_MISC, WINDOW_CHEATS_PAGE_RIDES, + WINDOW_CHEATS_PAGE_WEATHER, WINDOW_CHEATS_PAGE_COUNT, }; @@ -75,6 +76,7 @@ enum WindowCheatsWidgetIdx WIDX_TAB_3, WIDX_TAB_4, WIDX_TAB_5, + WIDX_TAB_6, WIDX_TAB_CONTENT, WIDX_NO_MONEY = WIDX_TAB_CONTENT, @@ -129,11 +131,9 @@ enum WindowCheatsWidgetIdx WIDX_REMOVE_ALL_GUESTS, WIDX_GENERAL_GROUP = WIDX_TAB_CONTENT, + WIDX_OWN_ALL_LAND, WIDX_REMOVE_PARK_FENCES, - WIDX_CREATE_DUCKS, WIDX_OPEN_CLOSE_PARK, - WIDX_OWN_ALL_LAND, - WIDX_REMOVE_DUCKS, WIDX_OBJECTIVE_GROUP, WIDX_NEVERENDING_MARKETING, WIDX_FORCE_PARK_RATING, @@ -142,10 +142,6 @@ enum WindowCheatsWidgetIdx WIDX_DECREASE_PARK_RATING, WIDX_WIN_SCENARIO, WIDX_HAVE_FUN, - WIDX_WEATHER_GROUP, - WIDX_WEATHER, - WIDX_WEATHER_DROPDOWN_BUTTON, - WIDX_FREEZE_WEATHER, WIDX_MAINTENANCE_GROUP, WIDX_REMOVE_LITTER, WIDX_FIX_VANDALISM, @@ -181,6 +177,14 @@ enum WindowCheatsWidgetIdx WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES, WIDX_DISABLE_TRAIN_LENGTH_LIMITS, WIDX_IGNORE_RESEARCH_STATUS, + + WIDX_WEATHER_GROUP = WIDX_TAB_CONTENT, + WIDX_WEATHER, + WIDX_WEATHER_DROPDOWN_BUTTON, + WIDX_FREEZE_WEATHER, + WIDX_FAUNA_GROUP, + WIDX_CREATE_DUCKS, + WIDX_REMOVE_DUCKS, }; #pragma region MEASUREMENTS @@ -206,7 +210,8 @@ static constexpr int32_t TAB_START = 3; MakeTab ({ 34, 17}, STR_DATE_CHEATS_TIP ), /* tab 2 */ \ MakeTab ({ 65, 17}, STR_GUEST_CHEATS_TIP ), /* tab 3 */ \ MakeTab ({ 96, 17}, STR_PARK_CHEATS_TIP ), /* tab 4 */ \ - MakeTab ({127, 17}, STR_RIDE_CHEATS_TIP ) /* tab 5 */ + MakeTab ({127, 17}, STR_RIDE_CHEATS_TIP ), /* tab 5 */ \ + MakeTab ({158, 17}, STR_WEATHER_NATURE_CHEATS_TIP ) /* tab 6 */ static Widget window_cheats_money_widgets[] = { @@ -266,16 +271,13 @@ static Widget window_cheats_guests_widgets[] = kWidgetsEnd, }; -//Strings for following moved to window_cheats_paint() static Widget window_cheats_misc_widgets[] = { MAIN_CHEATS_WIDGETS, - MakeWidget ({ 5, 48}, {238, 81}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GENERAL_GROUP ), // General group - MakeWidget ({127, 62}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_REMOVE_PARK_FENCES, STR_CHEAT_REMOVE_PARK_FENCES_TIP ), // Remove park fences - MakeWidget ({ 11, 83}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CREATE_DUCKS, STR_CREATE_DUCKS_TIP ), // Create ducks - MakeWidget ({ 11, 104}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_OPEN_PARK, STR_CHEAT_OPEN_PARK_TIP ), // open / close park + MakeWidget ({ 5, 48}, {238, 60}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GENERAL_GROUP ), // General group MakeWidget ({ 11, 62}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_OWN_ALL_LAND, STR_CHEAT_OWN_ALL_LAND_TIP ), // Own all land - MakeWidget ({127, 83}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_REMOVE_DUCKS, STR_REMOVE_DUCKS_TIP ), // Remove ducks + MakeWidget ({127, 62}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_REMOVE_PARK_FENCES, STR_CHEAT_REMOVE_PARK_FENCES_TIP ), // Remove park fences + MakeWidget ({ 11, 83}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_OPEN_PARK, STR_CHEAT_OPEN_PARK_TIP ), // open / close park MakeWidget ({ 5, 131}, {238, 75}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_OBJECTIVE_GROUP ), // Objective group MakeWidget ({ 11, 146}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_NEVERENDING_MARKETING, STR_CHEAT_NEVERENDING_MARKETING_TIP), // never ending marketing campaigns @@ -284,11 +286,6 @@ static Widget window_cheats_misc_widgets[] = MakeWidget ({ 11, 181}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_WIN_SCENARIO ), // Win scenario MakeWidget ({127, 181}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_HAVE_FUN ), // Have fun! - MakeWidget ({ 5, 207}, {238, 50}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_WEATHER_GROUP ), // Weather group - MakeWidget ({126, 221}, {111, 14}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather - MakeWidget ({225, 222}, { 11, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather - MakeWidget ({ 11, 239}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_FREEZE_WEATHER, STR_CHEAT_FREEZE_WEATHER_TIP ), // Freeze weather - MakeWidget ({ 5, 257}, {238, 99}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_MAINTENANCE_GROUP ), // Maintenance group MakeWidget ({ 11, 271}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_REMOVE_LITTER ), // Remove litter MakeWidget ({127, 271}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_FIX_VANDALISM ), // Fix vandalism @@ -307,6 +304,7 @@ static Widget window_cheats_misc_widgets[] = kWidgetsEnd, }; + static Widget window_cheats_rides_widgets[] = { MAIN_CHEATS_WIDGETS, @@ -334,6 +332,19 @@ static Widget window_cheats_rides_widgets[] = kWidgetsEnd, }; +static Widget window_cheats_weather_widgets[] = +{ + MAIN_CHEATS_WIDGETS, + MakeWidget ({ 5, 48}, {238, 50}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_WEATHER_GROUP ), // Weather group + MakeWidget ({126, 62}, {111, 14}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather + MakeWidget ({225, 63}, { 11, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather + MakeWidget ({ 11, 80}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_FREEZE_WEATHER, STR_CHEAT_FREEZE_WEATHER_TIP), // Freeze weather + MakeWidget ({ 5, 102}, {238, 37}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_FAUNA ), // Fauna group + MakeWidget ({ 11, 115}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CREATE_DUCKS, STR_CREATE_DUCKS_TIP ), // Create ducks + MakeWidget ({127, 115}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_REMOVE_DUCKS, STR_REMOVE_DUCKS_TIP ), // Remove ducks + kWidgetsEnd, +}; + static Widget *window_cheats_page_widgets[] = { window_cheats_money_widgets, @@ -341,6 +352,7 @@ static Widget *window_cheats_page_widgets[] = window_cheats_guests_widgets, window_cheats_misc_widgets, window_cheats_rides_widgets, + window_cheats_weather_widgets, }; static uint64_t window_cheats_page_hold_down_widgets[] = { @@ -361,6 +373,8 @@ static uint64_t window_cheats_page_hold_down_widgets[] = { (1uLL << WIDX_DECREASE_PARK_RATING), 0, + + 0, }; static StringId window_cheats_page_titles[] = { @@ -369,6 +383,7 @@ static StringId window_cheats_page_titles[] = { STR_CHEAT_TITLE_GUEST, STR_CHEAT_TITLE_PARK, STR_CHEAT_TITLE_RIDE, + STR_CHEAT_TITLE_WEATHER, }; // clang-format on @@ -408,6 +423,9 @@ static StringId window_cheats_page_titles[] = { case WINDOW_CHEATS_PAGE_MISC: OnMouseDownMisc(widgetIndex); break; + case WINDOW_CHEATS_PAGE_WEATHER: + OnMouseDownWeather(widgetIndex); + break; } } @@ -423,6 +441,7 @@ static StringId window_cheats_page_titles[] = { case WIDX_TAB_3: case WIDX_TAB_4: case WIDX_TAB_5: + case WIDX_TAB_6: SetPage(widgetIndex - WIDX_TAB_1); break; default: @@ -440,6 +459,9 @@ static StringId window_cheats_page_titles[] = { case WINDOW_CHEATS_PAGE_RIDES: OnMouseUpRides(widgetIndex); break; + case WINDOW_CHEATS_PAGE_WEATHER: + OnMouseUpWeather(widgetIndex); + break; } break; } @@ -451,6 +473,10 @@ static StringId window_cheats_page_titles[] = { { OnDropdownMisc(widgetIndex, selectedIndex); } + else if (page == WINDOW_CHEATS_PAGE_WEATHER) + { + OnDropdownWeather(widgetIndex, selectedIndex); + } } void OnPrepareDraw() override @@ -505,7 +531,6 @@ static StringId window_cheats_page_titles[] = { widgets[WIDX_OPEN_CLOSE_PARK].text = STR_CHEAT_CLOSE_PARK; SetCheckboxValue(WIDX_FORCE_PARK_RATING, Park::GetForcedRating() >= 0); - SetCheckboxValue(WIDX_FREEZE_WEATHER, gameState.Cheats.FreezeWeather); SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gameState.Cheats.NeverendingMarketing); SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gameState.Cheats.DisablePlantAging); SetCheckboxValue(WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, gameState.Cheats.AllowRegularPathAsQueue); @@ -528,10 +553,14 @@ static StringId window_cheats_page_titles[] = { SetCheckboxValue(WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, gameState.Cheats.AllowTrackPlaceInvalidHeights); SetCheckboxValue(WIDX_MAKE_DESTRUCTIBLE, gameState.Cheats.MakeAllDestructible); break; + case WINDOW_CHEATS_PAGE_WEATHER: + SetCheckboxValue(WIDX_FREEZE_WEATHER, gameState.Cheats.FreezeWeather); + break; } // Current weather - window_cheats_misc_widgets[WIDX_WEATHER].text = WeatherTypes[EnumValue(gameState.ClimateCurrent.Weather)]; + window_cheats_weather_widgets[WIDX_WEATHER].text = WeatherTypes[EnumValue(gameState.ClimateCurrent.Weather)]; + // Staff speed window_cheats_misc_widgets[WIDX_STAFF_SPEED].text = _staffSpeedNames[EnumValue( gameState.Cheats.SelectedStaffSpeed)]; @@ -596,11 +625,6 @@ static StringId window_cheats_page_titles[] = { } else if (page == WINDOW_CHEATS_PAGE_MISC) { - { - auto& widget = widgets[WIDX_WEATHER]; - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHANGE_WEATHER); - } - { auto ft = Formatter(); ft.Add(_parkRatingSpinnerValue); @@ -627,6 +651,13 @@ static StringId window_cheats_page_titles[] = { DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_CHEAT_GUEST_TOILET); DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_CHEAT_GUEST_PREFERRED_INTENSITY); } + else if (page == WINDOW_CHEATS_PAGE_WEATHER) + { + { + auto& widget = widgets[WIDX_WEATHER]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHANGE_WEATHER); + } + } } void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override @@ -682,11 +713,7 @@ static StringId window_cheats_page_titles[] = { void UpdateTabPositions() { constexpr uint16_t tabs[] = { - WIDX_TAB_1, - WIDX_TAB_2, - WIDX_TAB_3, - WIDX_TAB_4, - WIDX_TAB_5, + WIDX_TAB_1, WIDX_TAB_2, WIDX_TAB_3, WIDX_TAB_4, WIDX_TAB_5, WIDX_TAB_6, }; auto left = TAB_START; @@ -749,6 +776,15 @@ static StringId window_cheats_page_titles[] = { GfxDrawSprite( dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_5].left, widgets[WIDX_TAB_5].top }); } + + // Nature/weather tab + if (!IsWidgetDisabled(WIDX_TAB_6)) + { + uint32_t sprite_idx = SPR_WEATHER_SUN_CLOUD; + GfxDrawSprite( + dpi, ImageId(sprite_idx), + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_6].left + 2, widgets[WIDX_TAB_6].top + 4 }); + } } void OnMouseDownMoney(WidgetIndex widgetIndex) @@ -880,23 +916,6 @@ static StringId window_cheats_page_titles[] = { CheatsSet(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); } break; - case WIDX_WEATHER_DROPDOWN_BUTTON: - { - Widget* dropdownWidget = widget - 1; - - for (size_t i = 0; i < std::size(WeatherTypes); i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = WeatherTypes[i]; - } - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - colours[1], 0, Dropdown::Flag::StayOpen, std::size(WeatherTypes), dropdownWidget->width() - 3); - - auto currentWeather = gameState.ClimateCurrent.Weather; - Dropdown::SetChecked(EnumValue(currentWeather), true); - } - break; case WIDX_STAFF_SPEED_DROPDOWN_BUTTON: { Widget* dropdownWidget; @@ -917,23 +936,41 @@ static StringId window_cheats_page_titles[] = { } } - void OnMouseUpMisc(WidgetIndex widgetIndex) + void OnMouseDownWeather(WidgetIndex widgetIndex) { + auto* widget = &widgets[widgetIndex]; auto& gameState = GetGameState(); switch (widgetIndex) { - case WIDX_FREEZE_WEATHER: - CheatsSet(CheatType::FreezeWeather, !gameState.Cheats.FreezeWeather); + case WIDX_WEATHER_DROPDOWN_BUTTON: + { + Widget* dropdownWidget = widget - 1; + + for (size_t i = 0; i < std::size(WeatherTypes); i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = WeatherTypes[i]; + } + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, std::size(WeatherTypes), dropdownWidget->width() - 3); + + auto currentWeather = gameState.ClimateCurrent.Weather; + Dropdown::SetChecked(EnumValue(currentWeather), true); + break; + } + } + } + + void OnMouseUpMisc(WidgetIndex widgetIndex) + { + auto& gameState = GetGameState(); + switch (widgetIndex) + { case WIDX_OPEN_CLOSE_PARK: CheatsSet(CheatType::OpenClosePark); break; - case WIDX_CREATE_DUCKS: - CheatsSet(CheatType::CreateDucks, kCheatsDuckIncrement); - break; - case WIDX_REMOVE_DUCKS: - CheatsSet(CheatType::RemoveDucks); - break; case WIDX_CLEAR_GRASS: CheatsSet(CheatType::SetGrassLength, GRASS_LENGTH_CLEAR_0); break; @@ -986,6 +1023,23 @@ static StringId window_cheats_page_titles[] = { } } + void OnMouseUpWeather(WidgetIndex widgetIndex) + { + auto& gameState = GetGameState(); + switch (widgetIndex) + { + case WIDX_FREEZE_WEATHER: + CheatsSet(CheatType::FreezeWeather, !gameState.Cheats.FreezeWeather); + break; + case WIDX_CREATE_DUCKS: + CheatsSet(CheatType::CreateDucks, kCheatsDuckIncrement); + break; + case WIDX_REMOVE_DUCKS: + CheatsSet(CheatType::RemoveDucks); + break; + } + } + void OnDropdownMisc(WidgetIndex widgetIndex, int32_t dropdownIndex) { if (dropdownIndex == -1) @@ -993,10 +1047,6 @@ static StringId window_cheats_page_titles[] = { return; } - if (widgetIndex == WIDX_WEATHER_DROPDOWN_BUTTON) - { - CheatsSet(CheatType::ForceWeather, dropdownIndex); - } if (widgetIndex == WIDX_STAFF_SPEED_DROPDOWN_BUTTON) { int32_t speed = kCheatsStaffNormalSpeed; @@ -1021,6 +1071,19 @@ static StringId window_cheats_page_titles[] = { } } + void OnDropdownWeather(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + { + return; + } + + if (widgetIndex == WIDX_WEATHER_DROPDOWN_BUTTON) + { + CheatsSet(CheatType::ForceWeather, dropdownIndex); + } + } + void OnMouseUpGuests(WidgetIndex widgetIndex) { auto& gameState = GetGameState(); From 493bee46e779a2bc75912f74577dffae3c0eca25 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 19 Aug 2024 20:40:04 +0200 Subject: [PATCH 3/7] Move staff cheats to their own tab as well --- data/language/en-GB.txt | 2 + src/openrct2-ui/UiStringIds.h | 2 + src/openrct2-ui/windows/Cheats.cpp | 175 ++++++++++++++++++----------- 3 files changed, 116 insertions(+), 63 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 3282f35cd18f..a5441000893c 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3737,6 +3737,8 @@ STR_6664 :Show date cheats STR_6665 :Nature/weather cheats STR_6666 :Show nature/weather cheats STR_6667 :Fauna +STR_6668 :Staff cheats +STR_6669 :Show staff cheats ############# # Scenarios # diff --git a/src/openrct2-ui/UiStringIds.h b/src/openrct2-ui/UiStringIds.h index 1f9b82f9352f..ad8aec53aa1c 100644 --- a/src/openrct2-ui/UiStringIds.h +++ b/src/openrct2-ui/UiStringIds.h @@ -385,6 +385,7 @@ namespace OpenRCT2 STR_CHEAT_TITLE_GUEST = 5346, STR_CHEAT_TITLE_PARK = 5347, STR_CHEAT_TITLE_RIDE = 5348, + STR_CHEAT_TITLE_STAFF = 6668, STR_CHEAT_TITLE_WEATHER = 6665, STR_CHEAT_UNLOCK_OPERATING_LIMITS_TIP = 5585, STR_CHEAT_WEATHER_GROUP = 5465, @@ -408,6 +409,7 @@ namespace OpenRCT2 STR_REMOVE_DUCKS = 6332, STR_REMOVE_DUCKS_TIP = 6357, STR_RIDE_CHEATS_TIP = 5181, + STR_STAFF_CHEATS_TIP = 6669, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE = 5563, STR_WARNING_IN_CAPS = 5562, STR_WEATHER_NATURE_CHEATS_TIP = 6666, diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index e08239462359..d5b00fe70e34 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -39,6 +39,7 @@ enum WINDOW_CHEATS_PAGE_MONEY, WINDOW_CHEATS_PAGE_DATE, WINDOW_CHEATS_PAGE_GUESTS, + WINDOW_CHEATS_PAGE_STAFF, WINDOW_CHEATS_PAGE_MISC, WINDOW_CHEATS_PAGE_RIDES, WINDOW_CHEATS_PAGE_WEATHER, @@ -77,6 +78,7 @@ enum WindowCheatsWidgetIdx WIDX_TAB_4, WIDX_TAB_5, WIDX_TAB_6, + WIDX_TAB_7, WIDX_TAB_CONTENT, WIDX_NO_MONEY = WIDX_TAB_CONTENT, @@ -130,6 +132,17 @@ enum WindowCheatsWidgetIdx WIDX_TRAM_GUESTS, WIDX_REMOVE_ALL_GUESTS, + WIDX_STAFF_GROUP = WIDX_TAB_CONTENT, + WIDX_STAFF_SPEED, + WIDX_STAFF_SPEED_DROPDOWN_BUTTON, + WIDX_MAINTENANCE_GROUP, + WIDX_REMOVE_LITTER, + WIDX_FIX_VANDALISM, + WIDX_CLEAR_GRASS, + WIDX_MOWED_GRASS, + WIDX_WATER_PLANTS, + WIDX_DISABLE_PLANT_AGING, + WIDX_GENERAL_GROUP = WIDX_TAB_CONTENT, WIDX_OWN_ALL_LAND, WIDX_REMOVE_PARK_FENCES, @@ -142,16 +155,6 @@ enum WindowCheatsWidgetIdx WIDX_DECREASE_PARK_RATING, WIDX_WIN_SCENARIO, WIDX_HAVE_FUN, - WIDX_MAINTENANCE_GROUP, - WIDX_REMOVE_LITTER, - WIDX_FIX_VANDALISM, - WIDX_CLEAR_GRASS, - WIDX_MOWED_GRASS, - WIDX_WATER_PLANTS, - WIDX_DISABLE_PLANT_AGING, - WIDX_STAFF_GROUP, - WIDX_STAFF_SPEED, - WIDX_STAFF_SPEED_DROPDOWN_BUTTON, WIDX_PARK_CONSTRUCTION_GROUP, WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES, @@ -209,9 +212,10 @@ static constexpr int32_t TAB_START = 3; MakeTab ({ 3, 17}, STR_FINANCIAL_CHEATS_TIP ), /* tab 1 */ \ MakeTab ({ 34, 17}, STR_DATE_CHEATS_TIP ), /* tab 2 */ \ MakeTab ({ 65, 17}, STR_GUEST_CHEATS_TIP ), /* tab 3 */ \ - MakeTab ({ 96, 17}, STR_PARK_CHEATS_TIP ), /* tab 4 */ \ - MakeTab ({127, 17}, STR_RIDE_CHEATS_TIP ), /* tab 5 */ \ - MakeTab ({158, 17}, STR_WEATHER_NATURE_CHEATS_TIP ) /* tab 6 */ + MakeTab ({ 96, 17}, STR_STAFF_CHEATS_TIP ), /* tab 5 */ \ + MakeTab ({127, 17}, STR_PARK_CHEATS_TIP ), /* tab 6 */ \ + MakeTab ({158, 17}, STR_RIDE_CHEATS_TIP ), /* tab 4 */ \ + MakeTab ({189, 17}, STR_WEATHER_NATURE_CHEATS_TIP ) /* tab 7 */ static Widget window_cheats_money_widgets[] = { @@ -271,6 +275,24 @@ static Widget window_cheats_guests_widgets[] = kWidgetsEnd, }; +static Widget window_cheats_staff_widgets[] = +{ + MAIN_CHEATS_WIDGETS, + MakeWidget ({ 5, 357-309}, {238, 35}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_STAFF_GROUP ), // Staff group + MakeWidget ({126, 371-309}, {111, 14}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Staff speed + MakeWidget ({225, 372-309}, { 11, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), // Staff speed + + MakeWidget ({ 5, 257-168}, {238, 99}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_MAINTENANCE_GROUP ), // Maintenance group + MakeWidget ({ 11, 271-168}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_REMOVE_LITTER ), // Remove litter + MakeWidget ({127, 271-168}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_FIX_VANDALISM ), // Fix vandalism + MakeWidget ({ 11, 292-168}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_CLEAR_GRASS ), // Clear grass + MakeWidget ({127, 292-168}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_MOWED_GRASS ), // Mowed grass + MakeWidget ({ 11, 313-168}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_WATER_PLANTS ), // Water plants + MakeWidget ({ 11, 334-164}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_PLANT_AGING, STR_CHEAT_DISABLE_PLANT_AGING_TIP ), // Disable plant ageing + + kWidgetsEnd, +}; + static Widget window_cheats_misc_widgets[] = { MAIN_CHEATS_WIDGETS, @@ -286,18 +308,6 @@ static Widget window_cheats_misc_widgets[] = MakeWidget ({ 11, 181}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_WIN_SCENARIO ), // Win scenario MakeWidget ({127, 181}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_HAVE_FUN ), // Have fun! - MakeWidget ({ 5, 257}, {238, 99}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_MAINTENANCE_GROUP ), // Maintenance group - MakeWidget ({ 11, 271}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_REMOVE_LITTER ), // Remove litter - MakeWidget ({127, 271}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_FIX_VANDALISM ), // Fix vandalism - MakeWidget ({ 11, 292}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_CLEAR_GRASS ), // Clear grass - MakeWidget ({127, 292}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_MOWED_GRASS ), // Mowed grass - MakeWidget ({ 11, 313}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_WATER_PLANTS ), // Water plants - MakeWidget ({ 11, 334}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_PLANT_AGING, STR_CHEAT_DISABLE_PLANT_AGING_TIP ), // Disable plant ageing - - MakeWidget ({ 5, 357}, {238, 35}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_STAFF_GROUP ), // Staff group - MakeWidget ({126, 371}, {111, 14}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Staff speed - MakeWidget ({225, 372}, { 11, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), // Staff speed - MakeWidget ({ 5, 392}, {238, 56}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group MakeWidget ({ 11, 407}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_PATH_AS_QUEUE, STR_CHEAT_ALLOW_PATH_AS_QUEUE_TIP ), // Allow regular footpaths as queue path MakeWidget ({ 11, 428}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES_TIP ), // Allow special colours in dropdown @@ -350,6 +360,7 @@ static Widget *window_cheats_page_widgets[] = window_cheats_money_widgets, window_cheats_date_widgets, window_cheats_guests_widgets, + window_cheats_staff_widgets, window_cheats_misc_widgets, window_cheats_rides_widgets, window_cheats_weather_widgets, @@ -369,6 +380,8 @@ static uint64_t window_cheats_page_hold_down_widgets[] = { 0, + 0, + (1uLL << WIDX_INCREASE_PARK_RATING) | (1uLL << WIDX_DECREASE_PARK_RATING), @@ -381,6 +394,7 @@ static StringId window_cheats_page_titles[] = { STR_CHEAT_TITLE_FINANCIAL, STR_CHEAT_TITLE_DATE, STR_CHEAT_TITLE_GUEST, + STR_CHEAT_TITLE_STAFF, STR_CHEAT_TITLE_PARK, STR_CHEAT_TITLE_RIDE, STR_CHEAT_TITLE_WEATHER, @@ -423,6 +437,9 @@ static StringId window_cheats_page_titles[] = { case WINDOW_CHEATS_PAGE_MISC: OnMouseDownMisc(widgetIndex); break; + case WINDOW_CHEATS_PAGE_STAFF: + OnMouseDownStaff(widgetIndex); + break; case WINDOW_CHEATS_PAGE_WEATHER: OnMouseDownWeather(widgetIndex); break; @@ -442,6 +459,7 @@ static StringId window_cheats_page_titles[] = { case WIDX_TAB_4: case WIDX_TAB_5: case WIDX_TAB_6: + case WIDX_TAB_7: SetPage(widgetIndex - WIDX_TAB_1); break; default: @@ -459,6 +477,9 @@ static StringId window_cheats_page_titles[] = { case WINDOW_CHEATS_PAGE_RIDES: OnMouseUpRides(widgetIndex); break; + case WINDOW_CHEATS_PAGE_STAFF: + OnMouseUpStaff(widgetIndex); + break; case WINDOW_CHEATS_PAGE_WEATHER: OnMouseUpWeather(widgetIndex); break; @@ -469,9 +490,9 @@ static StringId window_cheats_page_titles[] = { void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override { - if (page == WINDOW_CHEATS_PAGE_MISC) + if (page == WINDOW_CHEATS_PAGE_STAFF) { - OnDropdownMisc(widgetIndex, selectedIndex); + OnDropdownStaff(widgetIndex, selectedIndex); } else if (page == WINDOW_CHEATS_PAGE_WEATHER) { @@ -532,7 +553,6 @@ static StringId window_cheats_page_titles[] = { SetCheckboxValue(WIDX_FORCE_PARK_RATING, Park::GetForcedRating() >= 0); SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gameState.Cheats.NeverendingMarketing); - SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gameState.Cheats.DisablePlantAging); SetCheckboxValue(WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, gameState.Cheats.AllowRegularPathAsQueue); SetCheckboxValue(WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES, gameState.Cheats.AllowSpecialColourSchemes); break; @@ -553,6 +573,9 @@ static StringId window_cheats_page_titles[] = { SetCheckboxValue(WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, gameState.Cheats.AllowTrackPlaceInvalidHeights); SetCheckboxValue(WIDX_MAKE_DESTRUCTIBLE, gameState.Cheats.MakeAllDestructible); break; + case WINDOW_CHEATS_PAGE_STAFF: + SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gameState.Cheats.DisablePlantAging); + break; case WINDOW_CHEATS_PAGE_WEATHER: SetCheckboxValue(WIDX_FREEZE_WEATHER, gameState.Cheats.FreezeWeather); break; @@ -562,7 +585,7 @@ static StringId window_cheats_page_titles[] = { window_cheats_weather_widgets[WIDX_WEATHER].text = WeatherTypes[EnumValue(gameState.ClimateCurrent.Weather)]; // Staff speed - window_cheats_misc_widgets[WIDX_STAFF_SPEED].text = _staffSpeedNames[EnumValue( + window_cheats_staff_widgets[WIDX_STAFF_SPEED].text = _staffSpeedNames[EnumValue( gameState.Cheats.SelectedStaffSpeed)]; if (gScreenFlags & SCREEN_FLAGS_EDITOR) @@ -634,7 +657,9 @@ static StringId window_cheats_page_titles[] = { dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 2 }, STR_FORMAT_INTEGER, ft, { colours[1] }); } - + } + else if (page == WINDOW_CHEATS_PAGE_STAFF) + { { auto& widget = widgets[WIDX_STAFF_SPEED]; DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHEAT_STAFF_SPEED); @@ -759,31 +784,40 @@ static StringId window_cheats_page_titles[] = { dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); } - // Misc tab + // Staff tab if (!IsWidgetDisabled(WIDX_TAB_4)) + { + uint32_t sprite_idx = SPR_MECHANIC; + GfxDrawSprite( + dpi, ImageId(sprite_idx), + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left + 2, widgets[WIDX_TAB_4].top + 1 }); + } + + // Misc tab + if (!IsWidgetDisabled(WIDX_TAB_5)) { GfxDrawSprite( dpi, ImageId(SPR_TAB_PARK), - windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top }); + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_5].left, widgets[WIDX_TAB_5].top }); } // Rides tab - if (!IsWidgetDisabled(WIDX_TAB_5)) + if (!IsWidgetDisabled(WIDX_TAB_6)) { uint32_t sprite_idx = SPR_TAB_RIDE_0; if (page == WINDOW_CHEATS_PAGE_RIDES) sprite_idx += (frame_no / 4) % 16; GfxDrawSprite( - dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_5].left, widgets[WIDX_TAB_5].top }); + dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_6].left, widgets[WIDX_TAB_6].top }); } // Nature/weather tab - if (!IsWidgetDisabled(WIDX_TAB_6)) + if (!IsWidgetDisabled(WIDX_TAB_7)) { uint32_t sprite_idx = SPR_WEATHER_SUN_CLOUD; GfxDrawSprite( dpi, ImageId(sprite_idx), - windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_6].left + 2, widgets[WIDX_TAB_6].top + 4 }); + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_7].left + 2, widgets[WIDX_TAB_7].top + 4 }); } } @@ -895,8 +929,6 @@ static StringId window_cheats_page_titles[] = { void OnMouseDownMisc(WidgetIndex widgetIndex) { - auto* widget = &widgets[widgetIndex]; - auto& gameState = GetGameState(); switch (widgetIndex) { case WIDX_INCREASE_PARK_RATING: @@ -916,6 +948,15 @@ static StringId window_cheats_page_titles[] = { CheatsSet(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); } break; + } + } + + void OnMouseDownStaff(WidgetIndex widgetIndex) + { + auto* widget = &widgets[widgetIndex]; + auto& gameState = GetGameState(); + switch (widgetIndex) + { case WIDX_STAFF_SPEED_DROPDOWN_BUTTON: { Widget* dropdownWidget; @@ -968,26 +1009,14 @@ static StringId window_cheats_page_titles[] = { auto& gameState = GetGameState(); switch (widgetIndex) { - case WIDX_OPEN_CLOSE_PARK: - CheatsSet(CheatType::OpenClosePark); - break; - case WIDX_CLEAR_GRASS: - CheatsSet(CheatType::SetGrassLength, GRASS_LENGTH_CLEAR_0); - break; - case WIDX_MOWED_GRASS: - CheatsSet(CheatType::SetGrassLength, GRASS_LENGTH_MOWED); - break; - case WIDX_WATER_PLANTS: - CheatsSet(CheatType::WaterPlants); - break; - case WIDX_FIX_VANDALISM: - CheatsSet(CheatType::FixVandalism); + case WIDX_OWN_ALL_LAND: + CheatsSet(CheatType::OwnAllLand); break; - case WIDX_REMOVE_LITTER: - CheatsSet(CheatType::RemoveLitter); + case WIDX_REMOVE_PARK_FENCES: + CheatsSet(CheatType::RemoveParkFences); break; - case WIDX_DISABLE_PLANT_AGING: - CheatsSet(CheatType::DisablePlantAging, !gameState.Cheats.DisablePlantAging); + case WIDX_OPEN_CLOSE_PARK: + CheatsSet(CheatType::OpenClosePark); break; case WIDX_WIN_SCENARIO: CheatsSet(CheatType::WinScenario); @@ -995,12 +1024,6 @@ static StringId window_cheats_page_titles[] = { case WIDX_HAVE_FUN: CheatsSet(CheatType::HaveFun); break; - case WIDX_OWN_ALL_LAND: - CheatsSet(CheatType::OwnAllLand); - break; - case WIDX_REMOVE_PARK_FENCES: - CheatsSet(CheatType::RemoveParkFences); - break; case WIDX_NEVERENDING_MARKETING: CheatsSet(CheatType::NeverEndingMarketing, !gameState.Cheats.NeverendingMarketing); break; @@ -1023,6 +1046,32 @@ static StringId window_cheats_page_titles[] = { } } + void OnMouseUpStaff(WidgetIndex widgetIndex) + { + auto& gameState = GetGameState(); + switch (widgetIndex) + { + case WIDX_CLEAR_GRASS: + CheatsSet(CheatType::SetGrassLength, GRASS_LENGTH_CLEAR_0); + break; + case WIDX_MOWED_GRASS: + CheatsSet(CheatType::SetGrassLength, GRASS_LENGTH_MOWED); + break; + case WIDX_WATER_PLANTS: + CheatsSet(CheatType::WaterPlants); + break; + case WIDX_FIX_VANDALISM: + CheatsSet(CheatType::FixVandalism); + break; + case WIDX_REMOVE_LITTER: + CheatsSet(CheatType::RemoveLitter); + break; + case WIDX_DISABLE_PLANT_AGING: + CheatsSet(CheatType::DisablePlantAging, !gameState.Cheats.DisablePlantAging); + break; + } + } + void OnMouseUpWeather(WidgetIndex widgetIndex) { auto& gameState = GetGameState(); @@ -1040,7 +1089,7 @@ static StringId window_cheats_page_titles[] = { } } - void OnDropdownMisc(WidgetIndex widgetIndex, int32_t dropdownIndex) + void OnDropdownStaff(WidgetIndex widgetIndex, int32_t dropdownIndex) { if (dropdownIndex == -1) { From 4e0d00f71b0a1121ce2b8daf89b617c1e53c9e00 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 19 Aug 2024 20:50:28 +0200 Subject: [PATCH 4/7] Reorganise park cheats to account for moved widgets --- src/openrct2-ui/windows/Cheats.cpp | 42 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index d5b00fe70e34..82800ebdadae 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -40,7 +40,7 @@ enum WINDOW_CHEATS_PAGE_DATE, WINDOW_CHEATS_PAGE_GUESTS, WINDOW_CHEATS_PAGE_STAFF, - WINDOW_CHEATS_PAGE_MISC, + WINDOW_CHEATS_PAGE_PARK, WINDOW_CHEATS_PAGE_RIDES, WINDOW_CHEATS_PAGE_WEATHER, WINDOW_CHEATS_PAGE_COUNT, @@ -293,7 +293,7 @@ static Widget window_cheats_staff_widgets[] = kWidgetsEnd, }; -static Widget window_cheats_misc_widgets[] = +static Widget window_cheats_park_widgets[] = { MAIN_CHEATS_WIDGETS, MakeWidget ({ 5, 48}, {238, 60}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GENERAL_GROUP ), // General group @@ -301,16 +301,16 @@ static Widget window_cheats_misc_widgets[] = MakeWidget ({127, 62}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_REMOVE_PARK_FENCES, STR_CHEAT_REMOVE_PARK_FENCES_TIP ), // Remove park fences MakeWidget ({ 11, 83}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_OPEN_PARK, STR_CHEAT_OPEN_PARK_TIP ), // open / close park - MakeWidget ({ 5, 131}, {238, 75}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_OBJECTIVE_GROUP ), // Objective group - MakeWidget ({ 11, 146}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_NEVERENDING_MARKETING, STR_CHEAT_NEVERENDING_MARKETING_TIP), // never ending marketing campaigns - MakeWidget ({ 11, 163}, {281, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_FORCE_PARK_RATING ), // Force park rating - MakeSpinnerWidgets({156, 161}, { 81, 14}, WindowWidgetType::Spinner, WindowColour::Secondary ), // park rating (3 widgets) - MakeWidget ({ 11, 181}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_WIN_SCENARIO ), // Win scenario - MakeWidget ({127, 181}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_HAVE_FUN ), // Have fun! + MakeWidget ({ 5, 113}, {238, 75}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_OBJECTIVE_GROUP ), // Objective group + MakeWidget ({ 11, 128}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_NEVERENDING_MARKETING, STR_CHEAT_NEVERENDING_MARKETING_TIP), // never ending marketing campaigns + MakeWidget ({ 11, 145}, {281, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_FORCE_PARK_RATING ), // Force park rating + MakeSpinnerWidgets({156, 143}, { 81, 14}, WindowWidgetType::Spinner, WindowColour::Secondary ), // park rating (3 widgets) + MakeWidget ({ 11, 163}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_WIN_SCENARIO ), // Win scenario + MakeWidget ({127, 163}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_HAVE_FUN ), // Have fun! - MakeWidget ({ 5, 392}, {238, 56}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group - MakeWidget ({ 11, 407}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_PATH_AS_QUEUE, STR_CHEAT_ALLOW_PATH_AS_QUEUE_TIP ), // Allow regular footpaths as queue path - MakeWidget ({ 11, 428}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES_TIP ), // Allow special colours in dropdown + MakeWidget ({ 5, 192}, {238, 56}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group + MakeWidget ({ 11, 207}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_PATH_AS_QUEUE, STR_CHEAT_ALLOW_PATH_AS_QUEUE_TIP ), // Allow regular footpaths as queue path + MakeWidget ({ 11, 228}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES_TIP ), // Allow special colours in dropdown kWidgetsEnd, }; @@ -361,7 +361,7 @@ static Widget *window_cheats_page_widgets[] = window_cheats_date_widgets, window_cheats_guests_widgets, window_cheats_staff_widgets, - window_cheats_misc_widgets, + window_cheats_park_widgets, window_cheats_rides_widgets, window_cheats_weather_widgets, }; @@ -434,8 +434,8 @@ static StringId window_cheats_page_titles[] = { case WINDOW_CHEATS_PAGE_DATE: OnMouseDownDate(widgetIndex); break; - case WINDOW_CHEATS_PAGE_MISC: - OnMouseDownMisc(widgetIndex); + case WINDOW_CHEATS_PAGE_PARK: + OnMouseDownPark(widgetIndex); break; case WINDOW_CHEATS_PAGE_STAFF: OnMouseDownStaff(widgetIndex); @@ -471,8 +471,8 @@ static StringId window_cheats_page_titles[] = { case WINDOW_CHEATS_PAGE_GUESTS: OnMouseUpGuests(widgetIndex); break; - case WINDOW_CHEATS_PAGE_MISC: - OnMouseUpMisc(widgetIndex); + case WINDOW_CHEATS_PAGE_PARK: + OnMouseUpPark(widgetIndex); break; case WINDOW_CHEATS_PAGE_RIDES: OnMouseUpRides(widgetIndex); @@ -546,7 +546,7 @@ static StringId window_cheats_page_titles[] = { SetCheckboxValue(WIDX_DISABLE_LITTERING, gameState.Cheats.DisableLittering); break; } - case WINDOW_CHEATS_PAGE_MISC: + case WINDOW_CHEATS_PAGE_PARK: widgets[WIDX_OPEN_CLOSE_PARK].text = STR_CHEAT_OPEN_PARK; if (gameState.Park.Flags & PARK_FLAGS_PARK_OPEN) widgets[WIDX_OPEN_CLOSE_PARK].text = STR_CHEAT_CLOSE_PARK; @@ -646,7 +646,7 @@ static StringId window_cheats_page_titles[] = { dpi, windowPos + ScreenCoordsXY{ _xRcol, dayBox.top + 2 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); } - else if (page == WINDOW_CHEATS_PAGE_MISC) + else if (page == WINDOW_CHEATS_PAGE_PARK) { { auto ft = Formatter(); @@ -793,7 +793,7 @@ static StringId window_cheats_page_titles[] = { windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left + 2, widgets[WIDX_TAB_4].top + 1 }); } - // Misc tab + // Park tab if (!IsWidgetDisabled(WIDX_TAB_5)) { GfxDrawSprite( @@ -927,7 +927,7 @@ static StringId window_cheats_page_titles[] = { } } - void OnMouseDownMisc(WidgetIndex widgetIndex) + void OnMouseDownPark(WidgetIndex widgetIndex) { switch (widgetIndex) { @@ -1004,7 +1004,7 @@ static StringId window_cheats_page_titles[] = { } } - void OnMouseUpMisc(WidgetIndex widgetIndex) + void OnMouseUpPark(WidgetIndex widgetIndex) { auto& gameState = GetGameState(); switch (widgetIndex) From 3138730d33bc38f5d08553becdcfa3b19a947b05 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 19 Aug 2024 21:19:22 +0200 Subject: [PATCH 5/7] Move 'Allow building while paused' cheat to park cheats --- src/openrct2-ui/windows/Cheats.cpp | 53 ++++++++++++++++-------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 82800ebdadae..e3f3f16a997f 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -156,6 +156,7 @@ enum WindowCheatsWidgetIdx WIDX_WIN_SCENARIO, WIDX_HAVE_FUN, WIDX_PARK_CONSTRUCTION_GROUP, + WIDX_ALLOW_BUILD_IN_PAUSE_MODE, WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES, @@ -164,7 +165,6 @@ enum WindowCheatsWidgetIdx WIDX_RESET_CRASH_STATUS, WIDX_10_MINUTE_INSPECTIONS, WIDX_CONSTRUCTION_GROUP, - WIDX_BUILD_IN_PAUSE_MODE, WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES, WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, @@ -308,9 +308,10 @@ static Widget window_cheats_park_widgets[] = MakeWidget ({ 11, 163}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_WIN_SCENARIO ), // Win scenario MakeWidget ({127, 163}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_HAVE_FUN ), // Have fun! - MakeWidget ({ 5, 192}, {238, 56}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group - MakeWidget ({ 11, 207}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_PATH_AS_QUEUE, STR_CHEAT_ALLOW_PATH_AS_QUEUE_TIP ), // Allow regular footpaths as queue path - MakeWidget ({ 11, 228}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES_TIP ), // Allow special colours in dropdown + MakeWidget ({ 5, 192}, {238, 68}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group + MakeWidget ({ 11, 207}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_BUILD_IN_PAUSE_MODE, STR_CHEAT_BUILD_IN_PAUSE_MODE_TIP ), // Build in pause mode + MakeWidget ({ 11, 224}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_PATH_AS_QUEUE, STR_CHEAT_ALLOW_PATH_AS_QUEUE_TIP ), // Allow regular footpaths as queue path + MakeWidget ({ 11, 241}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES_TIP), // Allow special colours in dropdown kWidgetsEnd, }; @@ -322,23 +323,25 @@ static Widget window_cheats_rides_widgets[] = MakeWidget({127, 48}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_RENEW_RIDES, STR_CHEAT_RENEW_RIDES_TIP ), // Renew rides MakeWidget({127, 69}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_RESET_CRASH_STATUS, STR_CHEAT_RESET_CRASH_STATUS_TIP ), // Reset crash status MakeWidget({ 11, 69}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_10_MINUTE_INSPECTIONS, STR_CHEAT_10_MINUTE_INSPECTIONS_TIP ), // 10 minute inspections - MakeWidget({ 5, 95}, {238, 122}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group - MakeWidget({ 11, 111}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_BUILD_IN_PAUSE_MODE, STR_CHEAT_BUILD_IN_PAUSE_MODE_TIP ), // Build in pause mode - MakeWidget({ 11, 132}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ENABLE_ALL_DRAWABLE_TRACK_PIECES, STR_CHEAT_ENABLE_ALL_DRAWABLE_TRACK_PIECES_TIP ), // Show all drawable track pieces - MakeWidget({ 11, 153}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, STR_CHEAT_ENABLE_CHAIN_LIFT_ON_ALL_TRACK_TIP ), // Enable chain lift on all track - MakeWidget({ 11, 174}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, STR_CHEAT_ALLOW_TRACK_PLACE_INVALID_HEIGHTS_TIP), // Allow track place at invalid heights - MakeWidget({ 11, 195}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_MAKE_DESTRUCTABLE, STR_CHEAT_MAKE_DESTRUCTABLE_TIP ), // All destructible - MakeWidget({ 5, 221}, {238, 122}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_OPERATION ), // Operation group - MakeWidget({ 11, 237}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_SHOW_ALL_OPERATING_MODES ), // Show all operating modes - MakeWidget({ 11, 258}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_UNLOCK_OPERATING_LIMITS, STR_CHEAT_UNLOCK_OPERATING_LIMITS_TIP ), // 410 km/h lift hill etc. - MakeWidget({ 11, 279}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_BRAKES_FAILURE, STR_CHEAT_DISABLE_BRAKES_FAILURE_TIP ), // Disable brakes failure - MakeWidget({ 11, 300}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_BREAKDOWNS, STR_CHEAT_DISABLE_BREAKDOWNS_TIP ), // Disable all breakdowns - MakeWidget({ 11, 321}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_RIDE_VALUE_AGING, STR_CHEAT_DISABLE_RIDE_VALUE_AGING_TIP ), // Disable ride ageing - MakeWidget({ 5, 347}, {238, 101}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_AVAILABILITY ), // Availability group - MakeWidget({ 11, 363}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES, STR_CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES_TIP), // Allow arbitrary ride type changes - MakeWidget({ 11, 384}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES ), // Show vehicles from other track types - MakeWidget({ 11, 405}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_TRAIN_LENGTH_LIMIT, STR_CHEAT_DISABLE_TRAIN_LENGTH_LIMIT_TIP ), // Disable train length limits - MakeWidget({ 11, 426}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_IGNORE_RESEARCH_STATUS, STR_CHEAT_IGNORE_RESEARCH_STATUS_TIP ), // Ignore Research Status + + MakeWidget({ 5, 95}, {238, 87}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_CONSTRUCTION ), // Construction group + MakeWidget({ 11, 111}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ENABLE_ALL_DRAWABLE_TRACK_PIECES, STR_CHEAT_ENABLE_ALL_DRAWABLE_TRACK_PIECES_TIP ), // Show all drawable track pieces + MakeWidget({ 11, 128}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, STR_CHEAT_ENABLE_CHAIN_LIFT_ON_ALL_TRACK_TIP ), // Enable chain lift on all track + MakeWidget({ 11, 145}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, STR_CHEAT_ALLOW_TRACK_PLACE_INVALID_HEIGHTS_TIP), // Allow track place at invalid heights + MakeWidget({ 11, 162}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_MAKE_DESTRUCTABLE, STR_CHEAT_MAKE_DESTRUCTABLE_TIP ), // All destructible + + MakeWidget({ 5, 186}, {238, 102}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_OPERATION ), // Operation group + MakeWidget({ 11, 201}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_SHOW_ALL_OPERATING_MODES ), // Show all operating modes + MakeWidget({ 11, 218}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_UNLOCK_OPERATING_LIMITS, STR_CHEAT_UNLOCK_OPERATING_LIMITS_TIP ), // 410 km/h lift hill etc. + MakeWidget({ 11, 235}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_BRAKES_FAILURE, STR_CHEAT_DISABLE_BRAKES_FAILURE_TIP ), // Disable brakes failure + MakeWidget({ 11, 252}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_BREAKDOWNS, STR_CHEAT_DISABLE_BREAKDOWNS_TIP ), // Disable all breakdowns + MakeWidget({ 11, 269}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_RIDE_VALUE_AGING, STR_CHEAT_DISABLE_RIDE_VALUE_AGING_TIP ), // Disable ride ageing + + MakeWidget({ 5, 292}, {238, 86}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_AVAILABILITY ), // Availability group + MakeWidget({ 11, 308}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES, STR_CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES_TIP), // Allow arbitrary ride type changes + MakeWidget({ 11, 325}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES ), // Show vehicles from other track types + MakeWidget({ 11, 342}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_TRAIN_LENGTH_LIMIT, STR_CHEAT_DISABLE_TRAIN_LENGTH_LIMIT_TIP ), // Disable train length limits + MakeWidget({ 11, 359}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_IGNORE_RESEARCH_STATUS, STR_CHEAT_IGNORE_RESEARCH_STATUS_TIP ), // Ignore Research Status kWidgetsEnd, }; @@ -553,6 +556,7 @@ static StringId window_cheats_page_titles[] = { SetCheckboxValue(WIDX_FORCE_PARK_RATING, Park::GetForcedRating() >= 0); SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gameState.Cheats.NeverendingMarketing); + SetCheckboxValue(WIDX_ALLOW_BUILD_IN_PAUSE_MODE, gameState.Cheats.BuildInPauseMode); SetCheckboxValue(WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, gameState.Cheats.AllowRegularPathAsQueue); SetCheckboxValue(WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES, gameState.Cheats.AllowSpecialColourSchemes); break; @@ -560,7 +564,6 @@ static StringId window_cheats_page_titles[] = { SetCheckboxValue(WIDX_UNLOCK_OPERATING_LIMITS, gameState.Cheats.UnlockOperatingLimits); SetCheckboxValue(WIDX_DISABLE_BRAKES_FAILURE, gameState.Cheats.DisableBrakesFailure); SetCheckboxValue(WIDX_DISABLE_ALL_BREAKDOWNS, gameState.Cheats.DisableAllBreakdowns); - SetCheckboxValue(WIDX_BUILD_IN_PAUSE_MODE, gameState.Cheats.BuildInPauseMode); SetCheckboxValue(WIDX_SHOW_ALL_OPERATING_MODES, gameState.Cheats.ShowAllOperatingModes); SetCheckboxValue( WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES, gameState.Cheats.ShowVehiclesFromOtherTrackTypes); @@ -1037,6 +1040,9 @@ static StringId window_cheats_page_titles[] = { CheatsSet(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); } break; + case WIDX_ALLOW_BUILD_IN_PAUSE_MODE: + CheatsSet(CheatType::BuildInPauseMode, !gameState.Cheats.BuildInPauseMode); + break; case WIDX_ALLOW_REGULAR_PATH_AS_QUEUE: CheatsSet(CheatType::AllowRegularPathAsQueue, !gameState.Cheats.AllowRegularPathAsQueue); break; @@ -1244,9 +1250,6 @@ static StringId window_cheats_page_titles[] = { case WIDX_DISABLE_ALL_BREAKDOWNS: CheatsSet(CheatType::DisableAllBreakdowns, !gameState.Cheats.DisableAllBreakdowns); break; - case WIDX_BUILD_IN_PAUSE_MODE: - CheatsSet(CheatType::BuildInPauseMode, !gameState.Cheats.BuildInPauseMode); - break; case WIDX_RESET_CRASH_STATUS: CheatsSet(CheatType::ResetCrashStatus); break; From 1bfd3febe6e0b30c3ea87c3a80c912ae3368ac42 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 19 Aug 2024 22:20:40 +0200 Subject: [PATCH 6/7] Rework guest cheats tab layout and strings --- data/language/en-GB.txt | 7 +- src/openrct2-ui/UiStringIds.h | 1 + src/openrct2-ui/windows/Cheats.cpp | 118 ++++++++++++++++++----------- 3 files changed, 80 insertions(+), 46 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index a5441000893c..82ae96e77f55 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -2602,8 +2602,8 @@ STR_5357 :{BLACK}Nausea tolerance: STR_5358 :{BLACK}Toilet: STR_5359 :Remove guests STR_5360 :Removes all guests from the map -STR_5361 :Give all guests: -STR_5362 :{BLACK}Set all guests’ preferred ride intensity to: +STR_5361 :Add to guest inventory +STR_5362 :{BLACK}Preferred ride intensity: STR_5363 :More than 1 STR_5364 :Less than 15 STR_5365 :{BLACK}Staff speed: @@ -2633,7 +2633,7 @@ STR_5457 :Disable support limits STR_5458 :Rotate clockwise STR_5459 :Rotate anti-clockwise STR_5460 :Rotate view anti-clockwise -STR_5461 :Set guests’ parameters +STR_5461 :Set parameters for all guests STR_5462 :{CURRENCY} STR_5463 :Goal: Have fun! STR_5464 :General @@ -3739,6 +3739,7 @@ STR_6666 :Show nature/weather cheats STR_6667 :Fauna STR_6668 :Staff cheats STR_6669 :Show staff cheats +STR_6670 :Guest behaviour ############# # Scenarios # diff --git a/src/openrct2-ui/UiStringIds.h b/src/openrct2-ui/UiStringIds.h index ad8aec53aa1c..f57f62ab10b5 100644 --- a/src/openrct2-ui/UiStringIds.h +++ b/src/openrct2-ui/UiStringIds.h @@ -401,6 +401,7 @@ namespace OpenRCT2 STR_FORMAT_MONTH = 6201, STR_FROZEN = 6232, STR_GUEST_CHEATS_TIP = 5179, + STR_GUEST_BEHAVIOUR = 6670, STR_MAX = 5350, STR_MIN = 5351, STR_MONTH = 6197, diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index e3f3f16a997f..fc5a47b23a9e 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -103,7 +103,9 @@ enum WindowCheatsWidgetIdx WIDX_DATE_SET, WIDX_DATE_RESET, - WIDX_GUEST_PARAMETERS_GROUP = WIDX_TAB_CONTENT, + WIDX_TRAM_GUESTS = WIDX_TAB_CONTENT, + WIDX_REMOVE_ALL_GUESTS, + WIDX_GUEST_PARAMETERS_GROUP, WIDX_GUEST_HAPPINESS_MAX, WIDX_GUEST_HAPPINESS_MIN, WIDX_GUEST_ENERGY_MAX, @@ -120,17 +122,16 @@ enum WindowCheatsWidgetIdx WIDX_GUEST_TOILET_MIN, WIDX_GUEST_RIDE_INTENSITY_MORE_THAN_1, WIDX_GUEST_RIDE_INTENSITY_LESS_THAN_15, - WIDX_GUEST_IGNORE_RIDE_INTENSITY, - WIDX_GUEST_IGNORE_PRICE, - WIDX_DISABLE_VANDALISM, - WIDX_DISABLE_LITTERING, WIDX_GIVE_ALL_GUESTS_GROUP, WIDX_GIVE_GUESTS_MONEY, WIDX_GIVE_GUESTS_PARK_MAPS, WIDX_GIVE_GUESTS_BALLOONS, WIDX_GIVE_GUESTS_UMBRELLAS, - WIDX_TRAM_GUESTS, - WIDX_REMOVE_ALL_GUESTS, + WIDX_GUEST_BEHAVIOUR_GROUP, + WIDX_GUEST_IGNORE_RIDE_INTENSITY, + WIDX_GUEST_IGNORE_PRICE, + WIDX_DISABLE_VANDALISM, + WIDX_DISABLE_LITTERING, WIDX_STAFF_GROUP = WIDX_TAB_CONTENT, WIDX_STAFF_SPEED, @@ -244,34 +245,39 @@ static Widget window_cheats_date_widgets[] = static Widget window_cheats_guests_widgets[] = { MAIN_CHEATS_WIDGETS, - MakeWidget({ 5, 48}, {238, 290}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_SET_GUESTS_PARAMETERS ), // Guests parameters group frame - MakeWidget({183, 69}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // happiness max - MakeWidget({127, 69}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // happiness min - MakeWidget({183, 90}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // energy max - MakeWidget({127, 90}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // energy min - MakeWidget({183, 111}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // hunger max - MakeWidget({127, 111}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // hunger min - MakeWidget({183, 132}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // thirst max - MakeWidget({127, 132}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // thirst min - MakeWidget({183, 153}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // nausea max - MakeWidget({127, 153}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // nausea min - MakeWidget({183, 174}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // nausea tolerance max - MakeWidget({127, 174}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // nausea tolerance min - MakeWidget({183, 195}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // toilet max - MakeWidget({127, 195}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // toilet min - MakeWidget({127, 237}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_MORE_THAN_1 ), // ride intensity > 1 - MakeWidget({ 11, 237}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_LESS_THAN_15 ), // ride intensity < 15 - MakeWidget({ 11, 258}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_IGNORE_INTENSITY, STR_CHEAT_IGNORE_INTENSITY_TIP ), // guests ignore intensity - MakeWidget({ 11, 279}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_IGNORE_PRICE, STR_CHEAT_IGNORE_PRICE_TIP ), // guests ignore price - MakeWidget({ 11, 300}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_VANDALISM, STR_CHEAT_DISABLE_VANDALISM_TIP), // disable vandalism - MakeWidget({ 11, 321}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_LITTERING, STR_CHEAT_DISABLE_LITTERING_TIP), // disable littering - MakeWidget({ 5, 342}, {238, 69}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GIVE_ALL_GUESTS ), // Guests parameters group frame - MakeWidget({ 11, 363}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CURRENCY_FORMAT ), // give guests money - MakeWidget({127, 363}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SHOP_ITEM_PLURAL_PARK_MAP ), // give guests park maps - MakeWidget({ 11, 384}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SHOP_ITEM_PLURAL_BALLOON ), // give guests balloons - MakeWidget({127, 384}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SHOP_ITEM_PLURAL_UMBRELLA ), // give guests umbrellas - MakeWidget({ 11, 426}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_LARGE_TRAM_GUESTS, STR_CHEAT_LARGE_TRAM_GUESTS_TIP), // large tram - MakeWidget({127, 426}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_REMOVE_ALL_GUESTS, STR_CHEAT_REMOVE_ALL_GUESTS_TIP), // remove all guests + MakeWidget({ 11, 48}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_LARGE_TRAM_GUESTS, STR_CHEAT_LARGE_TRAM_GUESTS_TIP), // large tram + MakeWidget({127, 48}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_REMOVE_ALL_GUESTS, STR_CHEAT_REMOVE_ALL_GUESTS_TIP), // remove all guests + + MakeWidget({ 5, 70}, {238, 206}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_SET_GUESTS_PARAMETERS ), // Guests parameters group frame + MakeWidget({183, 84}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // happiness max + MakeWidget({127, 84}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // happiness min + MakeWidget({183, 105}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // energy max + MakeWidget({127, 105}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // energy min + MakeWidget({183, 126}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // hunger max + MakeWidget({127, 126}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // hunger min + MakeWidget({183, 147}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // thirst max + MakeWidget({127, 147}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // thirst min + MakeWidget({183, 168}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // nausea max + MakeWidget({127, 168}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // nausea min + MakeWidget({183, 189}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // nausea tolerance max + MakeWidget({127, 189}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // nausea tolerance min + MakeWidget({183, 210}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MAX ), // toilet max + MakeWidget({127, 210}, MINMAX_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_MIN ), // toilet min + MakeWidget({127, 251}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_MORE_THAN_1 ), // ride intensity > 1 + MakeWidget({ 11, 251}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_LESS_THAN_15 ), // ride intensity < 15 + + MakeWidget({ 5, 258+15+6+2}, {238, 62}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GIVE_ALL_GUESTS ), // Guests inventory group frame + MakeWidget({ 11, 279+15+6-3}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CURRENCY_FORMAT ), // give guests money + MakeWidget({127, 279+15+6-3}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SHOP_ITEM_PLURAL_PARK_MAP ), // give guests park maps + MakeWidget({ 11, 300+15+6-3}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SHOP_ITEM_PLURAL_BALLOON ), // give guests balloons + MakeWidget({127, 300+15+6-3}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SHOP_ITEM_PLURAL_UMBRELLA ), // give guests umbrellas + + MakeWidget({ 5, 342+6}, {238, 85}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_GUEST_BEHAVIOUR ), // Guests behaviour group frame + MakeWidget({ 11, 363+1}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_IGNORE_INTENSITY, STR_CHEAT_IGNORE_INTENSITY_TIP ), // guests ignore intensity + MakeWidget({ 11, 380+1}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_IGNORE_PRICE, STR_CHEAT_IGNORE_PRICE_TIP ), // guests ignore price + MakeWidget({ 11, 397+1}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_VANDALISM, STR_CHEAT_DISABLE_VANDALISM_TIP), // disable vandalism + MakeWidget({ 11, 414+1}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_LITTERING, STR_CHEAT_DISABLE_LITTERING_TIP), // disable littering + kWidgetsEnd, }; @@ -670,14 +676,40 @@ static StringId window_cheats_page_titles[] = { } else if (page == WINDOW_CHEATS_PAGE_GUESTS) { - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 72 }, STR_CHEAT_GUEST_HAPPINESS); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_CHEAT_GUEST_ENERGY); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 114 }, STR_CHEAT_GUEST_HUNGER); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 135 }, STR_CHEAT_GUEST_THIRST); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 156 }, STR_CHEAT_GUEST_NAUSEA); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 177 }, STR_CHEAT_GUEST_NAUSEA_TOLERANCE); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_CHEAT_GUEST_TOILET); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_CHEAT_GUEST_PREFERRED_INTENSITY); + { + auto& widget = widgets[WIDX_GUEST_HAPPINESS_MIN]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 2 }, STR_CHEAT_GUEST_HAPPINESS); + } + { + auto& widget = widgets[WIDX_GUEST_ENERGY_MIN]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 2 }, STR_CHEAT_GUEST_ENERGY); + } + { + auto& widget = widgets[WIDX_GUEST_HUNGER_MIN]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 2 }, STR_CHEAT_GUEST_HUNGER); + } + { + auto& widget = widgets[WIDX_GUEST_THIRST_MIN]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 2 }, STR_CHEAT_GUEST_THIRST); + } + { + auto& widget = widgets[WIDX_GUEST_NAUSEA_MIN]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 2 }, STR_CHEAT_GUEST_NAUSEA); + } + { + auto& widget = widgets[WIDX_GUEST_NAUSEA_TOLERANCE_MIN]; + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 2 }, STR_CHEAT_GUEST_NAUSEA_TOLERANCE); + } + { + auto& widget = widgets[WIDX_GUEST_TOILET_MIN]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 2 }, STR_CHEAT_GUEST_TOILET); + } + { + auto& widget = widgets[WIDX_GUEST_RIDE_INTENSITY_LESS_THAN_15]; + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top - 17 }, STR_CHEAT_GUEST_PREFERRED_INTENSITY); + } } else if (page == WINDOW_CHEATS_PAGE_WEATHER) { From ed987fbd5e0474796dfbf673de26d35570112da7 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 19 Aug 2024 22:35:22 +0200 Subject: [PATCH 7/7] Amend changelog --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index de52ad483e8c..24764282d83e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -12,6 +12,7 @@ - Change: [#22490] In sandbox mode, changing land or construction rights now acts as buying or selling. - Change: [#22491] Scrollbars are now hidden if the scrollable widget is not actually overflowing. - Change: [#22541] In editor/sandbox mode, tool widgets now appear on the side of the map window, instead of the bottom. +- Change: [#22592] Cheats have been redistributed along three new tabs: date, staff, and nature/weather. - Fix: [#21908] Errors showing up when placing/moving track design previews. - Fix: [#22307] Hover tooltips in financial charts are not invalidated properly. - Fix: [#22316] Potential crash when switching the drawing engine while the game is running.