diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 0ff09b543d..b44db1bb52 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3639,6 +3639,8 @@ STR_6533 :{WINDOW_COLOUR_2}Excitement Factor: {BLACK}-{COMMA16}% STR_6534 :{WINDOW_COLOUR_2}Intensity Factor: {BLACK}-{COMMA16}% STR_6535 :{WINDOW_COLOUR_2}Nausea Factor: {BLACK}-{COMMA16}% STR_6536 :This park was saved in a later version of OpenRCT2. The park was saved in v{INT32}, you are currently on v{INT32}. +STR_6537 :Allow using regular paths as queue +STR_6538 :Shows regular paths in the queues dropdown of the Footpaths window. ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index ba7af8b636..32289424fc 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.4.4 (in development) ------------------------------------------------------------------------ +- Feature: [#18744] Cheat to allow using a regular path as a queue path. - Improved: [#18826] [Plugin] Added all actions and their documentation to plugin API. 0.4.3 (2022-12-14) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index b530977d62..e365b013ae 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -3032,6 +3032,7 @@ declare global { sandboxMode: boolean; showAllOperatingModes: boolean; showVehiclesFromOtherTrackTypes: boolean; + allowRegularPathAsQueue: boolean; } /** diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 8b243bde16..1cec44c38b 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -149,6 +149,8 @@ enum WindowCheatsWidgetIdx WIDX_STAFF_GROUP, WIDX_STAFF_SPEED, WIDX_STAFF_SPEED_DROPDOWN_BUTTON, + WIDX_PARK_CONSTRUCTION_GROUP, + WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, WIDX_FIX_ALL = WIDX_TAB_CONTENT, WIDX_RENEW_RIDES, @@ -282,6 +284,10 @@ static rct_widget window_cheats_misc_widgets[] = MakeWidget ({ 5, 347}, {238, 35}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_STAFF_GROUP ), // Staff group MakeWidget ({126, 361}, {111, 14}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Staff speed MakeWidget ({225, 362}, { 11, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), // Staff speed + + MakeWidget ({ 5, 392}, {238, 35}, 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 + WIDGETS_END, }; static rct_widget window_cheats_rides_widgets[] = @@ -297,13 +303,13 @@ 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, 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 ), // Construction group + 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 @@ -475,6 +481,7 @@ public: SetCheckboxValue(WIDX_FREEZE_WEATHER, gCheatsFreezeWeather); SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gCheatsNeverendingMarketing); SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gCheatsDisablePlantAging); + SetCheckboxValue(WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, gCheatsAllowRegularPathAsQueue); break; case WINDOW_CHEATS_PAGE_RIDES: SetCheckboxValue(WIDX_UNLOCK_OPERATING_LIMITS, gCheatsUnlockOperatingLimits); @@ -896,6 +903,9 @@ private: CheatsSet(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); } break; + case WIDX_ALLOW_REGULAR_PATH_AS_QUEUE: + CheatsSet(CheatType::AllowRegularPathAsQueue, !gCheatsAllowRegularPathAsQueue); + break; } } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index a99315e12b..42897168af 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -652,10 +652,18 @@ private: { continue; } - if (showQueues != ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + // If regular paths can be used as queue, only hide the path if we’re _not_ looking at a queue, + // but the path surface is one. + if (gCheatsAllowRegularPathAsQueue && !showQueues && ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) { continue; } + // If the cheat is disabled, hide queues from the regular path view and vice versa. + else if (!gCheatsAllowRegularPathAsQueue && showQueues != ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + { + continue; + } + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL && i == (showQueues ? gFootpathSelection.QueueSurface : gFootpathSelection.NormalSurface)) { diff --git a/src/openrct2/Cheats.cpp b/src/openrct2/Cheats.cpp index f70e59f576..76c594c6ca 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 gCheatsAllowRegularPathAsQueue = false; void CheatsReset() { @@ -77,6 +78,7 @@ void CheatsReset() gCheatsIgnoreResearchStatus = false; gCheatsEnableAllDrawableTrackPieces = false; gCheatsAllowTrackPlaceInvalidHeights = false; + gCheatsAllowRegularPathAsQueue = 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::AllowRegularPathAsQueue, gCheatsAllowRegularPathAsQueue, count); // Remember current position and update count. uint64_t endOffset = stream.GetPosition(); @@ -217,6 +220,9 @@ void CheatsSerialise(DataSerialiser& ds) case CheatType::NoCapOnQueueLengthDummy: ds << dummyBool; break; + case CheatType::AllowRegularPathAsQueue: + ds << gCheatsAllowRegularPathAsQueue; + break; default: break; } @@ -320,6 +326,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::AllowRegularPathAsQueue: + return language_get_string(STR_CHEAT_ALLOW_PATH_AS_QUEUE); default: return "Unknown Cheat"; } diff --git a/src/openrct2/Cheats.h b/src/openrct2/Cheats.h index 3035eb75c8..4743f8e38d 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 gCheatsAllowRegularPathAsQueue; enum class CheatType : int32_t { @@ -86,6 +87,7 @@ enum class CheatType : int32_t RemoveDucks, AllowTrackPlaceInvalidHeights, NoCapOnQueueLengthDummy, // Removed; this dummy exists only for deserialisation parks that had it saved + AllowRegularPathAsQueue, Count, }; diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index a6f337a561..ae5a17e79e 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::AllowRegularPathAsQueue: + gCheatsAllowRegularPathAsQueue = _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::AllowRegularPathAsQueue: + [[fallthrough]]; case CheatType::OpenClosePark: return { { 0, 1 }, { 0, 0 } }; case CheatType::AddMoney: diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 235c93d00a..d3a5107a67 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3928,6 +3928,9 @@ enum : uint16_t STR_ERROR_PARK_VERSION_TOO_NEW_MESSAGE_2 = 6536, + STR_CHEAT_ALLOW_PATH_AS_QUEUE = 6537, + STR_CHEAT_ALLOW_PATH_AS_QUEUE_TIP = 6538, + // 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/scripting/bindings/game/ScCheats.hpp b/src/openrct2/scripting/bindings/game/ScCheats.hpp index 429afdd71c..44313f6710 100644 --- a/src/openrct2/scripting/bindings/game/ScCheats.hpp +++ b/src/openrct2/scripting/bindings/game/ScCheats.hpp @@ -40,6 +40,8 @@ namespace OpenRCT2::Scripting ctx, &ScCheats::disableLittering_get, &ScCheats::disableLittering_set, "disableLittering"); dukglue_register_property( ctx, &ScCheats::disablePlantAging_get, &ScCheats::disablePlantAging_set, "disablePlantAging"); + dukglue_register_property( + ctx, &ScCheats::allowRegularPathAsQueue_get, &ScCheats::allowRegularPathAsQueue_set, "allowRegularPathAsQueue"); dukglue_register_property( ctx, &ScCheats::disableRideValueAging_get, &ScCheats::disableRideValueAging_set, "disableRideValueAging"); dukglue_register_property( @@ -159,6 +161,17 @@ namespace OpenRCT2::Scripting gCheatsDisablePlantAging = value; } + bool allowRegularPathAsQueue_get() + { + return gCheatsAllowRegularPathAsQueue; + } + + void allowRegularPathAsQueue_set(bool value) + { + ThrowIfGameStateNotMutable(); + gCheatsAllowRegularPathAsQueue = value; + } + bool disableRideValueAging_get() { return gCheatsDisableRideValueAging;