mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 04:53:12 +01:00
Adjust window mode when switching from/to sandbox mode
This commit is contained in:
@@ -248,9 +248,26 @@ static Widget window_land_rights_widgets[] = {
|
||||
void OnUpdate() override
|
||||
{
|
||||
frame_no++;
|
||||
|
||||
// Close window if another tool is open
|
||||
if (!isToolActive(WindowClass::LandRights))
|
||||
{
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
|
||||
bool inRightsMode = _landRightsMode == LandRightsMode::BuyLand
|
||||
|| _landRightsMode == LandRightsMode::BuyConstructionRights;
|
||||
|
||||
if (!IsOwnershipMode() && !inRightsMode)
|
||||
{
|
||||
if (gLandRemainingOwnershipSales > 0)
|
||||
SwitchToMode(LandRightsMode::BuyLand);
|
||||
else
|
||||
SwitchToMode(LandRightsMode::BuyConstructionRights);
|
||||
}
|
||||
else if (IsOwnershipMode() && inRightsMode)
|
||||
SwitchToMode(LandRightsMode::SetLandUnowned);
|
||||
}
|
||||
|
||||
void PrepareDrawInGame()
|
||||
|
||||
Reference in New Issue
Block a user