From 0ece5d0f440c173a7dd229fce607f95eb3991d09 Mon Sep 17 00:00:00 2001 From: Charles Machalow Date: Sat, 2 Apr 2022 11:07:06 -0700 Subject: [PATCH] Add a new cheat to disable queue length limits --- data/language/en-GB.txt | 4 +++- distribution/changelog.txt | 1 + src/openrct2-ui/windows/Cheats.cpp | 18 ++++++++++++------ src/openrct2/Cheats.cpp | 8 ++++++++ src/openrct2/Cheats.h | 2 ++ src/openrct2/actions/SetCheatAction.cpp | 5 +++++ src/openrct2/entity/Guest.cpp | 2 +- src/openrct2/localisation/StringIds.h | 3 +++ src/openrct2/ride/Ride.h | 2 ++ 9 files changed, 37 insertions(+), 8 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 5cf1bf62d1..a765aea2d6 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -587,7 +587,7 @@ STR_1199 :{COMMA16} person on ride STR_1200 :{COMMA16} people on ride STR_1201 :Nobody in queue line STR_1202 :1 person in queue line -STR_1203 :{COMMA16} people in queue line +STR_1203 :{COMMA32} people in queue line STR_1204 :{COMMA16} minute queue time STR_1205 :{COMMA16} minutes queue time STR_1206 :{WINDOW_COLOUR_2}Wait for: @@ -3676,6 +3676,8 @@ STR_6484 :See-Through vegetation toggle STR_6485 :See-Through vehicles toggle STR_6486 :See-Through guests toggle STR_6487 :See-Through staff toggle +STR_6488 :Remove queue line cap +STR_6489 :This cheat removes the normal cap of 1000 peeps on ride queue lines ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c281255048..17ded0285b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -23,6 +23,7 @@ - Feature: [#16806] Parkobj can load sprites from RCT image archives. - Feature: [#16831] Allow ternary colours for small and large scenery objects. - Feature: [#16872] [Plugin] Add support for custom images. +- Feature: [#16855] Added new cheat to remove the cap on queue lengths. - Improved: [#3517] Cheats are now saved with the park. - Improved: [#10150] Ride stations are now properly checked if they’re sheltered. - Improved: [#10664, #16072] Visibility status can be modified directly in the Tile Inspector's list. diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 293340ba38..d2e5cf4eee 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -166,6 +166,7 @@ enum WindowCheatsWidgetIdx WIDX_DISABLE_BRAKES_FAILURE, WIDX_DISABLE_ALL_BREAKDOWNS, WIDX_DISABLE_RIDE_VALUE_AGING, + WIDX_NO_CAP_ON_QUEUE_LENGTH, WIDX_TRACK_PIECES_GROUP, WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES, WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES, @@ -297,17 +298,18 @@ static rct_widget window_cheats_rides_widgets[] = MakeWidget({ 11, 153}, 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, 174}, 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, 195}, 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({ 5, 221}, {238, 122}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_OPERATION ), // Construction group + MakeWidget({ 5, 221}, {238, 143}, 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 ), // Construction 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({ 11, 342}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_NO_CAP_ON_QUEUE_LENGTH, STR_CHEAT_NO_CAP_ON_QUEUE_LENGTH_TOOLTIP ), // No cap on ride queue lengths + MakeWidget({ 5, 368}, {238, 101}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GROUP_AVAILABILITY ), // Availability group + MakeWidget({ 11, 384}, 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, 405}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES ), // Show vehicles from other track types + MakeWidget({ 11, 426}, 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, 447}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_IGNORE_RESEARCH_STATUS, STR_CHEAT_IGNORE_RESEARCH_STATUS_TIP ), // Ignore Research Status WIDGETS_END, }; @@ -490,6 +492,7 @@ public: SetCheckboxValue(WIDX_IGNORE_RESEARCH_STATUS, gCheatsIgnoreResearchStatus); SetCheckboxValue(WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES, gCheatsEnableAllDrawableTrackPieces); SetCheckboxValue(WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, gCheatsAllowTrackPlaceInvalidHeights); + SetCheckboxValue(WIDX_NO_CAP_ON_QUEUE_LENGTH, gCheatsNoCapOnQueueLength); break; } @@ -1082,6 +1085,9 @@ private: case WIDX_DISABLE_RIDE_VALUE_AGING: CheatsSet(CheatType::DisableRideValueAging, !gCheatsDisableRideValueAging); break; + case WIDX_NO_CAP_ON_QUEUE_LENGTH: + CheatsSet(CheatType::NoCapOnQueueLength, !gCheatsNoCapOnQueueLength); + break; case WIDX_IGNORE_RESEARCH_STATUS: CheatsSet(CheatType::IgnoreResearchStatus, !gCheatsIgnoreResearchStatus); break; diff --git a/src/openrct2/Cheats.cpp b/src/openrct2/Cheats.cpp index c9de8b38d5..ebba00b2fc 100644 --- a/src/openrct2/Cheats.cpp +++ b/src/openrct2/Cheats.cpp @@ -52,6 +52,7 @@ bool gCheatsDisableRideValueAging = false; bool gCheatsIgnoreResearchStatus = false; bool gCheatsEnableAllDrawableTrackPieces = false; bool gCheatsAllowTrackPlaceInvalidHeights = false; +bool gCheatsNoCapOnQueueLength = false; void CheatsReset() { @@ -77,6 +78,7 @@ void CheatsReset() gCheatsIgnoreResearchStatus = false; gCheatsEnableAllDrawableTrackPieces = false; gCheatsAllowTrackPlaceInvalidHeights = false; + gCheatsNoCapOnQueueLength = false; } void CheatsSet(CheatType cheatType, int32_t param1 /* = 0*/, int32_t param2 /* = 0*/) @@ -125,6 +127,7 @@ void CheatsSerialise(DataSerialiser& ds) CheatEntrySerialise(ds, CheatType::IgnoreResearchStatus, gCheatsIgnoreResearchStatus, count); CheatEntrySerialise(ds, CheatType::EnableAllDrawableTrackPieces, gCheatsEnableAllDrawableTrackPieces, count); CheatEntrySerialise(ds, CheatType::AllowTrackPlaceInvalidHeights, gCheatsAllowTrackPlaceInvalidHeights, count); + CheatEntrySerialise(ds, CheatType::NoCapOnQueueLength, gCheatsNoCapOnQueueLength, count); // Remember current position and update count. uint64_t endOffset = stream.GetPosition(); @@ -212,6 +215,9 @@ void CheatsSerialise(DataSerialiser& ds) case CheatType::AllowTrackPlaceInvalidHeights: ds << gCheatsAllowTrackPlaceInvalidHeights; break; + case CheatType::NoCapOnQueueLength: + ds << gCheatsNoCapOnQueueLength; + break; default: break; } @@ -315,6 +321,8 @@ const char* CheatsGetName(CheatType cheatType) return language_get_string(STR_CHEAT_ENABLE_ALL_DRAWABLE_TRACK_PIECES); case CheatType::AllowTrackPlaceInvalidHeights: return language_get_string(STR_CHEAT_ALLOW_TRACK_PLACE_INVALID_HEIGHTS); + case CheatType::NoCapOnQueueLength: + return language_get_string(STR_CHEAT_NO_CAP_ON_QUEUE_LENGTH); default: return "Unknown Cheat"; } diff --git a/src/openrct2/Cheats.h b/src/openrct2/Cheats.h index 47653acd6b..f13ddbc3cc 100644 --- a/src/openrct2/Cheats.h +++ b/src/openrct2/Cheats.h @@ -33,6 +33,7 @@ extern bool gCheatsAllowArbitraryRideTypeChanges; extern bool gCheatsIgnoreResearchStatus; extern bool gCheatsEnableAllDrawableTrackPieces; extern bool gCheatsAllowTrackPlaceInvalidHeights; +extern bool gCheatsNoCapOnQueueLength; enum class CheatType : int32_t { @@ -85,6 +86,7 @@ enum class CheatType : int32_t CreateDucks, RemoveDucks, AllowTrackPlaceInvalidHeights, + NoCapOnQueueLength, Count, }; diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index 5abbb93b64..9e000510c4 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -240,6 +240,9 @@ GameActions::Result SetCheatAction::Execute() const case CheatType::AllowTrackPlaceInvalidHeights: gCheatsAllowTrackPlaceInvalidHeights = _param1 != 0; break; + case CheatType::NoCapOnQueueLength: + gCheatsNoCapOnQueueLength = _param1 != 0; + break; default: { log_error("Unabled cheat: %d", _cheatType.id); @@ -305,6 +308,8 @@ ParametersRange SetCheatAction::GetParameterRange(CheatType cheatType) const [[fallthrough]]; case CheatType::EnableAllDrawableTrackPieces: [[fallthrough]]; + case CheatType::NoCapOnQueueLength: + [[fallthrough]]; case CheatType::OpenClosePark: return { { 0, 1 }, { 0, 0 } }; case CheatType::AddMoney: diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 8384c31862..eba306bbae 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1948,7 +1948,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, StationIndex entranceNum, bool atQueue, b { auto& station = ride->GetStation(entranceNum); // Peeps won't join a queue that has 1000 peeps already in it. - if (station.QueueLength >= 1000) + if (station.QueueLength >= MAX_RIDE_QUEUE_LENGTH && !gCheatsNoCapOnQueueLength) { peep_tried_to_enter_full_queue(this, ride); return false; diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index d389c6c060..a4f0570379 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3946,6 +3946,9 @@ enum : uint16_t STR_SHORTCUT_SEE_THROUGH_GUESTS_TOGGLE = 6486, STR_SHORTCUT_SEE_THROUGH_STAFF_TOGGLE = 6487, + STR_CHEAT_NO_CAP_ON_QUEUE_LENGTH = 6488, + STR_CHEAT_NO_CAP_ON_QUEUE_LENGTH_TOOLTIP = 6489, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working /* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings }; diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 53854975cf..ff8b4dc81e 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -879,6 +879,8 @@ enum constexpr uint32_t CONSTRUCTION_LIFT_HILL_SELECTED = 1 << 0; constexpr uint32_t CONSTRUCTION_INVERTED_TRACK_SELECTED = 1 << 1; +constexpr uint16_t MAX_RIDE_QUEUE_LENGTH = 1000; + Ride* get_ride(RideId index); struct RideManager