diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index f0ccfb15f6..1eefabd4d3 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2723,11 +2723,15 @@ rct_window* WindowRideConstructionOpen() return nullptr; } - if (currentRide->type == RIDE_TYPE_MAZE) + const auto& rtd = currentRide->GetRideTypeDescriptor(); + switch (rtd.ConstructionWindowContext) { - return context_open_window_view(WV_MAZE_CONSTRUCTION); + case RideConstructionWindowContext::Maze: + return context_open_window_view(WV_MAZE_CONSTRUCTION); + case RideConstructionWindowContext::Default: + return WindowCreate( + WC_RIDE_CONSTRUCTION, ScreenCoordsXY(0, 29), 166, 394, WF_NO_AUTO_CLOSE); } - return WindowCreate(WC_RIDE_CONSTRUCTION, ScreenCoordsXY(0, 29), 166, 394, WF_NO_AUTO_CLOSE); } diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index f373a5717f..632c1064db 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -28,6 +28,7 @@ #include "../util/Util.h" #include "Ride.h" #include "RideAudio.h" +#include "RideConstruction.h" #include "RideEntry.h" #include "ShopItem.h" #include "Track.h" @@ -161,6 +162,12 @@ using StartRideMusicFunction = void (*)(const OpenRCT2::RideAudio::ViewportRideM using LightFXAddLightsMagicVehicleFunction = void (*)(const Vehicle* vehicle); using RideUpdateMeasurementsSpecialElementsFunc = void (*)(Ride* ride, const track_type_t trackType); +enum class RideConstructionWindowContext : uint8_t +{ + Default, + Maze, +}; + struct RideTypeDescriptor { uint8_t AlternateType; @@ -219,6 +226,8 @@ struct RideTypeDescriptor PeepUpdateRideLeaveEntranceFunc UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceDefault; + RideConstructionWindowContext ConstructionWindowContext = RideConstructionWindowContext::Default; + RideUpdateMeasurementsSpecialElementsFunc UpdateMeasurementsSpecialElements = RideUpdateMeasurementsSpecialElements_Default; bool HasFlag(uint64_t flag) const; diff --git a/src/openrct2/ride/coaster/meta/WaterCoaster.h b/src/openrct2/ride/coaster/meta/WaterCoaster.h index 46a3cbac11..24ef469c92 100644 --- a/src/openrct2/ride/coaster/meta/WaterCoaster.h +++ b/src/openrct2/ride/coaster/meta/WaterCoaster.h @@ -60,6 +60,7 @@ constexpr const RideTypeDescriptor WaterCoasterRTD = SET_FIELD(MusicUpdateFunction, DefaultMusicUpdate), SET_FIELD(Classification, RideClassification::Ride), SET_FIELD(UpdateLeaveEntrance, PeepUpdateRideLeaveEntranceDefault), + SET_FIELD(ConstructionWindowContext, RideConstructionWindowContext::Default), SET_FIELD(UpdateMeasurementsSpecialElements, RideUpdateMeasurementsSpecialElements_WaterCoaster), }; // clang-format on diff --git a/src/openrct2/ride/gentle/meta/Maze.h b/src/openrct2/ride/gentle/meta/Maze.h index 0addb195a0..5da339ce33 100644 --- a/src/openrct2/ride/gentle/meta/Maze.h +++ b/src/openrct2/ride/gentle/meta/Maze.h @@ -58,5 +58,6 @@ constexpr const RideTypeDescriptor MazeRTD = SET_FIELD(MusicUpdateFunction, DefaultMusicUpdate), SET_FIELD(Classification, RideClassification::Ride), SET_FIELD(UpdateLeaveEntrance, PeepUpdateRideLeaveEntranceMaze), + SET_FIELD(ConstructionWindowContext, RideConstructionWindowContext::Maze), }; // clang-format on diff --git a/src/openrct2/ride/gentle/meta/MiniGolf.h b/src/openrct2/ride/gentle/meta/MiniGolf.h index 75e39c05ee..07dbfccc60 100644 --- a/src/openrct2/ride/gentle/meta/MiniGolf.h +++ b/src/openrct2/ride/gentle/meta/MiniGolf.h @@ -58,6 +58,7 @@ constexpr const RideTypeDescriptor MiniGolfRTD = SET_FIELD(MusicUpdateFunction, DefaultMusicUpdate), SET_FIELD(Classification, RideClassification::Ride), SET_FIELD(UpdateLeaveEntrance, PeepUpdateRideLeaveEntranceDefault), + SET_FIELD(ConstructionWindowContext, RideConstructionWindowContext::Default), SET_FIELD(UpdateMeasurementsSpecialElements, RideUpdateMeasurementsSpecialElements_MiniGolf), }; // clang-format on