mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-27 08:45:00 +01:00
Make rct_windowclass strong type WindowClass
This already revealed some places where implicit conversions were done, including some where its use was nonsense (MouseInput.cpp). The changes to the Intent class were necessary to keep things working, and this splits things up more neatly.
This commit is contained in:
@@ -192,7 +192,7 @@ bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords)
|
||||
case EntityType::Guest:
|
||||
case EntityType::Staff:
|
||||
{
|
||||
auto intent = Intent(WC_PEEP);
|
||||
auto intent = Intent(WindowClass::Peep);
|
||||
intent.putExtra(INTENT_EXTRA_PEEP, entity);
|
||||
context_open_intent(&intent);
|
||||
break;
|
||||
@@ -231,7 +231,7 @@ bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords)
|
||||
return true;
|
||||
}
|
||||
case ViewportInteractionItem::ParkEntrance:
|
||||
context_open_window(WC_PARK_INFORMATION);
|
||||
context_open_window(WindowClass::ParkInformation);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -446,7 +446,8 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor
|
||||
|
||||
if (!(input_test_flag(INPUT_FLAG_6)) || !(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
{
|
||||
if (window_find_by_class(WC_RIDE_CONSTRUCTION) == nullptr && window_find_by_class(WC_FOOTPATH) == nullptr)
|
||||
if (window_find_by_class(WindowClass::RideConstruction) == nullptr
|
||||
&& window_find_by_class(WindowClass::Footpath) == nullptr)
|
||||
{
|
||||
info.SpriteType = ViewportInteractionItem::None;
|
||||
return info;
|
||||
@@ -617,7 +618,7 @@ static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const Co
|
||||
|
||||
auto z = tileElement->GetBaseZ();
|
||||
|
||||
w = window_find_by_class(WC_FOOTPATH);
|
||||
w = window_find_by_class(WindowClass::Footpath);
|
||||
if (w != nullptr)
|
||||
footpath_provisional_update();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user