1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 06:23:04 +01:00

Turn WindowDetail into strong enum

This commit is contained in:
Gymnasiast
2025-09-17 23:35:10 +02:00
parent a662c5ef8e
commit ea5fc03dd0
12 changed files with 40 additions and 38 deletions

View File

@@ -206,23 +206,23 @@ public:
}
}
WindowBase* OpenDetails(uint8_t type, int32_t id) override
WindowBase* openDetails(WindowDetail type, int32_t id) override
{
switch (type)
{
case WD_BANNER:
case WindowDetail::banner:
return BannerOpen(id);
case WD_NEW_CAMPAIGN:
case WindowDetail::newCampaign:
return NewCampaignOpen(id);
case WD_DEMOLISH_RIDE:
case WindowDetail::demolishRide:
return RideDemolishPromptOpen(*GetRide(RideId::FromUnderlying(id)));
case WD_REFURBISH_RIDE:
case WindowDetail::refurbishRide:
return RideRefurbishPromptOpen(*GetRide(RideId::FromUnderlying(id)));
case WD_SIGN:
case WindowDetail::sign:
return SignOpen(id);
case WD_SIGN_SMALL:
case WindowDetail::signSmall:
return SignSmallOpen(id);
case WD_PLAYER:
case WindowDetail::player:
return PlayerOpen(id);
default:
@@ -378,12 +378,12 @@ public:
switch (intent->GetWindowDetail())
{
case WD_VEHICLE:
case WindowDetail::vehicle:
return RideOpenVehicle(static_cast<Vehicle*>(intent->GetPointerExtra(INTENT_EXTRA_VEHICLE)));
case WD_TRACK:
case WindowDetail::track:
return RideOpenTrack(static_cast<TileElement*>(intent->GetPointerExtra(INTENT_EXTRA_TILE_ELEMENT)));
case WD_NULL:
case WindowDetail::null:
// Intent does not hold an window detail
break;