mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 13:03:11 +01:00
Add ConstructionWindowContext field to RTD (#17749)
This commit is contained in:
@@ -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<RideConstructionWindow>(
|
||||
WC_RIDE_CONSTRUCTION, ScreenCoordsXY(0, 29), 166, 394, WF_NO_AUTO_CLOSE);
|
||||
}
|
||||
|
||||
return WindowCreate<RideConstructionWindow>(WC_RIDE_CONSTRUCTION, ScreenCoordsXY(0, 29), 166, 394, WF_NO_AUTO_CLOSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user