Merge pull request #24034 from Gymnasiast/refactor/gamestate-t-lower-camel-case

Change GameState_t members to lowerCamelCase
This commit is contained in:
Matt authored and GitHub committed 2025-03-21 23:32:02 +02:00
commit 94be70f8a8
179 files changed
+2619 -2619

No files matched your search

+1 -1
View File
@@ -1034,7 +1034,7 @@ public:
if (gLegacyScene == LegacyScene::scenarioEditor)
{
if (GetGameState().EditorStep != EditorStep::LandscapeEditor)
if (getGameState().editorStep != EditorStep::LandscapeEditor)
return;
}
+11 -11
View File
@@ -197,7 +197,7 @@ static void ShortcutAdjustLand()
if (gLegacyScene == LegacyScene::titleSequence)
return;
if (gLegacyScene == LegacyScene::scenarioEditor && GetGameState().EditorStep != EditorStep::LandscapeEditor)
if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor)
return;
if (isInTrackDesignerOrManager())
@@ -211,7 +211,7 @@ static void ShortcutAdjustWater()
if (gLegacyScene == LegacyScene::titleSequence)
return;
if (gLegacyScene == LegacyScene::scenarioEditor && GetGameState().EditorStep != EditorStep::LandscapeEditor)
if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor)
return;
if (isInTrackDesignerOrManager())
@@ -225,7 +225,7 @@ static void ShortcutBuildScenery()
if (gLegacyScene == LegacyScene::titleSequence)
return;
if (gLegacyScene == LegacyScene::scenarioEditor && GetGameState().EditorStep != EditorStep::LandscapeEditor)
if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor)
return;
if (isInTrackDesignerOrManager())
@@ -239,7 +239,7 @@ static void ShortcutBuildPaths()
if (gLegacyScene == LegacyScene::titleSequence)
return;
if (gLegacyScene == LegacyScene::scenarioEditor && GetGameState().EditorStep != EditorStep::LandscapeEditor)
if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor)
return;
if (isInTrackDesignerOrManager())
@@ -268,7 +268,7 @@ static void ShortcutShowFinancialInformation()
return;
if (!(isInTrackDesignerOrManager()))
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
ContextOpenWindow(WindowClass::Finances);
}
@@ -341,7 +341,7 @@ static void ShortcutShowMap()
if (gLegacyScene == LegacyScene::titleSequence)
return;
if (gLegacyScene != LegacyScene::scenarioEditor || GetGameState().EditorStep == EditorStep::LandscapeEditor)
if (gLegacyScene != LegacyScene::scenarioEditor || getGameState().editorStep == EditorStep::LandscapeEditor)
if (!(isInTrackDesignerOrManager()))
ContextOpenWindow(WindowClass::Map);
}
@@ -398,7 +398,7 @@ static void ShortcutClearScenery()
if (gLegacyScene == LegacyScene::titleSequence)
return;
if (gLegacyScene == LegacyScene::scenarioEditor && GetGameState().EditorStep != EditorStep::LandscapeEditor)
if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor)
return;
if (isInTrackDesignerOrManager())
@@ -420,7 +420,7 @@ static void ShortcutQuickSaveGame()
auto intent = Intent(WindowClass::Loadsave);
intent.PutEnumExtra<LoadSaveAction>(INTENT_EXTRA_LOADSAVE_ACTION, LoadSaveAction::save);
intent.PutEnumExtra<LoadSaveType>(INTENT_EXTRA_LOADSAVE_TYPE, LoadSaveType::landscape);
intent.PutExtra(INTENT_EXTRA_PATH, GetGameState().ScenarioName);
intent.PutExtra(INTENT_EXTRA_PATH, getGameState().scenarioName);
ContextOpenIntent(&intent);
}
}
@@ -438,7 +438,7 @@ static void ShortcutOpenSceneryPicker()
{
if ((gLegacyScene == LegacyScene::titleSequence || gLegacyScene == LegacyScene::trackDesigner
|| gLegacyScene == LegacyScene::trackDesignsManager)
|| (gLegacyScene == LegacyScene::scenarioEditor && GetGameState().EditorStep != EditorStep::LandscapeEditor))
|| (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor))
return;
auto* windowMgr = GetWindowManager();
@@ -610,7 +610,7 @@ static void ShortcutDecreaseElementHeight()
static void ShortcutToggleClearanceChecks()
{
auto cheatSetAction = CheatSetAction(
CheatType::DisableClearanceChecks, GetGameState().Cheats.disableClearanceChecks ? 0 : 1);
CheatType::DisableClearanceChecks, getGameState().cheats.disableClearanceChecks ? 0 : 1);
GameActions::Execute(&cheatSetAction);
}
@@ -758,7 +758,7 @@ void ShortcutManager::RegisterDefaultShortcuts()
{
windowMgr->CloseAll();
}
else if (GetGameState().EditorStep == EditorStep::LandscapeEditor)
else if (getGameState().editorStep == EditorStep::LandscapeEditor)
{
windowMgr->CloseTop();
}
+15 -15
View File
@@ -226,7 +226,7 @@ namespace OpenRCT2::Ui::FileBrowser
windowMgr->CloseByClass(WindowClass::RideConstruction);
windowMgr->CloseAllExceptClass(WindowClass::Loadsave);
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (action)
{
@@ -275,12 +275,12 @@ namespace OpenRCT2::Ui::FileBrowser
case (LoadSaveType::scenario):
{
SetAndSaveConfigPath(Config::Get().general.LastSaveScenarioDirectory, pathBuffer);
int32_t parkFlagsBackup = gameState.Park.Flags;
gameState.Park.Flags &= ~PARK_FLAGS_SPRITES_INITIALISED;
gameState.EditorStep = EditorStep::Invalid;
gameState.ScenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer)));
int32_t parkFlagsBackup = gameState.park.Flags;
gameState.park.Flags &= ~PARK_FLAGS_SPRITES_INITIALISED;
gameState.editorStep = EditorStep::Invalid;
gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer)));
int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 3 : 2);
gameState.Park.Flags = parkFlagsBackup;
gameState.park.Flags = parkFlagsBackup;
if (success)
{
@@ -293,7 +293,7 @@ namespace OpenRCT2::Ui::FileBrowser
else
{
ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_SCENARIO_SAVE_FAILED, {});
gameState.EditorStep = EditorStep::ObjectiveSelection;
gameState.editorStep = EditorStep::ObjectiveSelection;
InvokeCallback(ModalResult::fail, pathBuffer);
}
break;
@@ -346,7 +346,7 @@ namespace OpenRCT2::Ui::FileBrowser
case LoadSaveType::landscape:
{
SetAndSaveConfigPath(Config::Get().general.LastSaveLandscapeDirectory, pathBuffer);
gameState.ScenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer)));
gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer)));
if (ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 3 : 2))
{
gCurrentLoadedPath = pathBuffer;
@@ -364,12 +364,12 @@ namespace OpenRCT2::Ui::FileBrowser
case LoadSaveType::scenario:
{
SetAndSaveConfigPath(Config::Get().general.LastSaveScenarioDirectory, pathBuffer);
int32_t parkFlagsBackup = gameState.Park.Flags;
gameState.Park.Flags &= ~PARK_FLAGS_SPRITES_INITIALISED;
gameState.EditorStep = EditorStep::Invalid;
gameState.ScenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer)));
int32_t parkFlagsBackup = gameState.park.Flags;
gameState.park.Flags &= ~PARK_FLAGS_SPRITES_INITIALISED;
gameState.editorStep = EditorStep::Invalid;
gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer)));
int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.SavePluginData ? 3 : 2);
gameState.Park.Flags = parkFlagsBackup;
gameState.park.Flags = parkFlagsBackup;
if (success)
{
@@ -382,7 +382,7 @@ namespace OpenRCT2::Ui::FileBrowser
else
{
ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_SCENARIO_SAVE_FAILED, {});
gameState.EditorStep = EditorStep::ObjectiveSelection;
gameState.editorStep = EditorStep::ObjectiveSelection;
InvokeCallback(ModalResult::fail, pathBuffer);
}
break;
@@ -503,7 +503,7 @@ namespace OpenRCT2::Ui::FileBrowser
}
else
{
auto buffer = GetGameState().Park.Name;
auto buffer = getGameState().park.Name;
if (buffer.empty())
{
buffer = LanguageGetString(STR_UNNAMED_PARK);
@@ -86,7 +86,7 @@ namespace OpenRCT2::Ui
return info;
//
if (gLegacyScene == LegacyScene::trackDesigner && GetGameState().EditorStep != EditorStep::RollercoasterDesigner)
if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::RollercoasterDesigner)
return info;
info = GetMapCoordinatesFromPos(
@@ -146,8 +146,8 @@ namespace OpenRCT2::Ui
break;
case ViewportInteractionItem::ParkEntrance:
{
auto& gameState = GetGameState();
auto parkName = gameState.Park.Name.c_str();
auto& gameState = getGameState();
auto parkName = gameState.park.Name.c_str();
auto ft = Formatter();
ft.Add<StringId>(STR_STRING);
@@ -273,7 +273,7 @@ namespace OpenRCT2::Ui
return info;
//
if (gLegacyScene == LegacyScene::trackDesigner && GetGameState().EditorStep != EditorStep::RollercoasterDesigner)
if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::RollercoasterDesigner)
return info;
constexpr auto flags = static_cast<int32_t>(
@@ -377,7 +377,7 @@ namespace OpenRCT2::Ui
else
{
// FIXME: Why does it *2 the value?
if (!GetGameState().Cheats.sandboxMode && !MapIsLocationOwned({ info.Loc, tileElement->GetBaseZ() * 2 }))
if (!getGameState().cheats.sandboxMode && !MapIsLocationOwned({ info.Loc, tileElement->GetBaseZ() * 2 }))
{
info.interactionType = ViewportInteractionItem::None;
return info;
@@ -509,7 +509,7 @@ namespace OpenRCT2::Ui
return info;
}
case ViewportInteractionItem::ParkEntrance:
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
break;
if (tileElement->GetType() != TileElementType::Entrance)
+1 -1
View File
@@ -1124,7 +1124,7 @@ namespace OpenRCT2::Ui::Windows
if (gLegacyScene == LegacyScene::titleSequence)
return;
if (gLegacyScene == LegacyScene::scenarioEditor && GetGameState().EditorStep != EditorStep::LandscapeEditor)
if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor)
return;
if (gLegacyScene == LegacyScene::trackDesignsManager)
+1 -1
View File
@@ -230,7 +230,7 @@ namespace OpenRCT2
int32_t colour2 = RideGetUnusedPresetVehicleColour(rideEntryIndex);
auto gameAction = RideCreateAction(
listItem.Type, listItem.EntryIndex, colour1, colour2, GetGameState().LastEntranceStyle);
listItem.Type, listItem.EntryIndex, colour1, colour2, getGameState().lastEntranceStyle);
gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) {
if (result->Error != GameActions::Status::Ok)
+2 -2
View File
@@ -108,7 +108,7 @@ namespace OpenRCT2::Audio
if (gLegacyScene == LegacyScene::scenarioEditor)
return false;
if (gLegacyScene == LegacyScene::trackDesigner && GetGameState().EditorStep != EditorStep::RollercoasterDesigner)
if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::RollercoasterDesigner)
return false;
if (vehicle.sound1_id == SoundId::Null && vehicle.sound2_id == SoundId::Null)
@@ -516,7 +516,7 @@ namespace OpenRCT2::Audio
sound.Pan = sound_params->pan_x;
sound.Channel->SetPan(DStoMixerPan(sound_params->pan_x));
}
if (!(GetGameState().CurrentTicks & 3) && sound_params->frequency != sound.Frequency)
if (!(getGameState().currentTicks & 3) && sound_params->frequency != sound.Frequency)
{
sound.Frequency = sound_params->frequency;
if (ShouldUpdateChannelRate<type>(id))
@@ -259,7 +259,7 @@ namespace OpenRCT2::Scripting
objectMgr.LoadObjects(result.RequiredObjects);
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = GetGameState();
auto& gameState = getGameState();
parkImporter->Import(gameState);
auto old = gLoadKeepWindowsOpen;
@@ -324,7 +324,7 @@ namespace OpenRCT2::Title
ReportProgress(90);
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = GetGameState();
auto& gameState = getGameState();
parkImporter->Import(gameState);
ReportProgress(100);
@@ -380,7 +380,7 @@ namespace OpenRCT2::Title
ReportProgress(70);
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = GetGameState();
auto& gameState = getGameState();
parkImporter->Import(gameState);
ReportProgress(100);
@@ -431,8 +431,8 @@ namespace OpenRCT2::Title
void PrepareParkForPlayback()
{
auto windowManager = Ui::GetWindowManager();
auto& gameState = GetGameState();
windowManager->SetMainView(gameState.SavedView, gameState.SavedViewZoom, gameState.SavedViewRotation);
auto& gameState = getGameState();
windowManager->SetMainView(gameState.savedView, gameState.savedViewZoom, gameState.savedViewRotation);
ResetEntitySpatialIndices();
ResetAllSpriteQuadrantPlacements();
auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES);
+70 -70
View File
@@ -514,12 +514,12 @@ static StringId window_cheats_page_titles[] = {
// Set title
widgets[WIDX_TITLE].text = window_cheats_page_titles[page];
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (page)
{
case WINDOW_CHEATS_PAGE_MONEY:
{
auto moneyDisabled = (gameState.Park.Flags & PARK_FLAGS_NO_MONEY) != 0;
auto moneyDisabled = (gameState.park.Flags & PARK_FLAGS_NO_MONEY) != 0;
SetCheckboxValue(WIDX_NO_MONEY, moneyDisabled);
SetWidgetDisabled(WIDX_ADD_SET_MONEY_GROUP, moneyDisabled);
SetWidgetDisabled(WIDX_MONEY_SPINNER, moneyDisabled);
@@ -534,57 +534,57 @@ static StringId window_cheats_page_titles[] = {
{
auto ft = Formatter::Common();
ft.Add<money64>(1000.00_GBP);
SetCheckboxValue(WIDX_GUEST_IGNORE_RIDE_INTENSITY, gameState.Cheats.ignoreRideIntensity);
SetCheckboxValue(WIDX_GUEST_IGNORE_PRICE, gameState.Cheats.ignorePrice);
SetCheckboxValue(WIDX_DISABLE_VANDALISM, gameState.Cheats.disableVandalism);
SetCheckboxValue(WIDX_DISABLE_LITTERING, gameState.Cheats.disableLittering);
SetCheckboxValue(WIDX_GUEST_IGNORE_RIDE_INTENSITY, gameState.cheats.ignoreRideIntensity);
SetCheckboxValue(WIDX_GUEST_IGNORE_PRICE, gameState.cheats.ignorePrice);
SetCheckboxValue(WIDX_DISABLE_VANDALISM, gameState.cheats.disableVandalism);
SetCheckboxValue(WIDX_DISABLE_LITTERING, gameState.cheats.disableLittering);
break;
}
case WINDOW_CHEATS_PAGE_PARK:
widgets[WIDX_OPEN_CLOSE_PARK].text = STR_CHEAT_OPEN_PARK;
if (gameState.Park.Flags & PARK_FLAGS_PARK_OPEN)
if (gameState.park.Flags & PARK_FLAGS_PARK_OPEN)
widgets[WIDX_OPEN_CLOSE_PARK].text = STR_CHEAT_CLOSE_PARK;
SetCheckboxValue(WIDX_FORCE_PARK_RATING, Park::GetForcedRating() >= 0);
SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gameState.Cheats.neverendingMarketing);
SetCheckboxValue(WIDX_ALLOW_BUILD_IN_PAUSE_MODE, gameState.Cheats.buildInPauseMode);
SetCheckboxValue(WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, gameState.Cheats.allowRegularPathAsQueue);
SetCheckboxValue(WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES, gameState.Cheats.allowSpecialColourSchemes);
SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gameState.cheats.neverendingMarketing);
SetCheckboxValue(WIDX_ALLOW_BUILD_IN_PAUSE_MODE, gameState.cheats.buildInPauseMode);
SetCheckboxValue(WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, gameState.cheats.allowRegularPathAsQueue);
SetCheckboxValue(WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES, gameState.cheats.allowSpecialColourSchemes);
break;
case WINDOW_CHEATS_PAGE_RIDES:
SetCheckboxValue(WIDX_UNLOCK_OPERATING_LIMITS, gameState.Cheats.unlockOperatingLimits);
SetCheckboxValue(WIDX_DISABLE_BRAKES_FAILURE, gameState.Cheats.disableBrakesFailure);
SetCheckboxValue(WIDX_DISABLE_ALL_BREAKDOWNS, gameState.Cheats.disableAllBreakdowns);
SetCheckboxValue(WIDX_SHOW_ALL_OPERATING_MODES, gameState.Cheats.showAllOperatingModes);
SetCheckboxValue(WIDX_UNLOCK_OPERATING_LIMITS, gameState.cheats.unlockOperatingLimits);
SetCheckboxValue(WIDX_DISABLE_BRAKES_FAILURE, gameState.cheats.disableBrakesFailure);
SetCheckboxValue(WIDX_DISABLE_ALL_BREAKDOWNS, gameState.cheats.disableAllBreakdowns);
SetCheckboxValue(WIDX_SHOW_ALL_OPERATING_MODES, gameState.cheats.showAllOperatingModes);
SetCheckboxValue(
WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES, gameState.Cheats.showVehiclesFromOtherTrackTypes);
SetCheckboxValue(WIDX_DISABLE_TRAIN_LENGTH_LIMITS, gameState.Cheats.disableTrainLengthLimit);
SetCheckboxValue(WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, gameState.Cheats.enableChainLiftOnAllTrack);
SetCheckboxValue(WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES, gameState.Cheats.allowArbitraryRideTypeChanges);
SetCheckboxValue(WIDX_DISABLE_RIDE_VALUE_AGING, gameState.Cheats.disableRideValueAging);
SetCheckboxValue(WIDX_IGNORE_RESEARCH_STATUS, gameState.Cheats.ignoreResearchStatus);
SetCheckboxValue(WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES, gameState.Cheats.enableAllDrawableTrackPieces);
SetCheckboxValue(WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, gameState.Cheats.allowTrackPlaceInvalidHeights);
SetCheckboxValue(WIDX_MAKE_DESTRUCTIBLE, gameState.Cheats.makeAllDestructible);
WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES, gameState.cheats.showVehiclesFromOtherTrackTypes);
SetCheckboxValue(WIDX_DISABLE_TRAIN_LENGTH_LIMITS, gameState.cheats.disableTrainLengthLimit);
SetCheckboxValue(WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, gameState.cheats.enableChainLiftOnAllTrack);
SetCheckboxValue(WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES, gameState.cheats.allowArbitraryRideTypeChanges);
SetCheckboxValue(WIDX_DISABLE_RIDE_VALUE_AGING, gameState.cheats.disableRideValueAging);
SetCheckboxValue(WIDX_IGNORE_RESEARCH_STATUS, gameState.cheats.ignoreResearchStatus);
SetCheckboxValue(WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES, gameState.cheats.enableAllDrawableTrackPieces);
SetCheckboxValue(WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, gameState.cheats.allowTrackPlaceInvalidHeights);
SetCheckboxValue(WIDX_MAKE_DESTRUCTIBLE, gameState.cheats.makeAllDestructible);
break;
case WINDOW_CHEATS_PAGE_STAFF:
SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gameState.Cheats.disablePlantAging);
SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gameState.cheats.disablePlantAging);
break;
case WINDOW_CHEATS_PAGE_WEATHER:
SetCheckboxValue(WIDX_FREEZE_WEATHER, gameState.Cheats.freezeWeather);
SetCheckboxValue(WIDX_FREEZE_WEATHER, gameState.cheats.freezeWeather);
break;
}
// Current weather
if (page == WINDOW_CHEATS_PAGE_WEATHER)
{
widgets[WIDX_WEATHER].text = WeatherTypes[EnumValue(gameState.WeatherCurrent.weatherType)];
widgets[WIDX_WEATHER].text = WeatherTypes[EnumValue(gameState.weatherCurrent.weatherType)];
}
// Staff speed
if (page == WINDOW_CHEATS_PAGE_STAFF)
{
widgets[WIDX_STAFF_SPEED].text = _staffSpeedNames[EnumValue(gameState.Cheats.selectedStaffSpeed)];
widgets[WIDX_STAFF_SPEED].text = _staffSpeedNames[EnumValue(gameState.cheats.selectedStaffSpeed)];
}
if (isInEditorMode())
@@ -940,7 +940,7 @@ static StringId window_cheats_page_titles[] = {
switch (widgetIndex)
{
case WIDX_NO_MONEY:
CheatsSet(CheatType::NoMoney, GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY ? 0 : 1);
CheatsSet(CheatType::NoMoney, getGameState().park.Flags & PARK_FLAGS_NO_MONEY ? 0 : 1);
break;
case WIDX_MONEY_SPINNER:
MoneyToString(_moneySpinnerValue, _moneySpinnerText, kMoneyStringMaxlength, false);
@@ -984,7 +984,7 @@ static StringId window_cheats_page_titles[] = {
void OnMouseDownStaff(WidgetIndex widgetIndex)
{
auto* widget = &widgets[widgetIndex];
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_STAFF_SPEED_DROPDOWN_BUTTON:
@@ -1002,7 +1002,7 @@ static StringId window_cheats_page_titles[] = {
WindowDropdownShowTextCustomWidth(
{ windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1,
colours[1], 0, Dropdown::Flag::StayOpen, 3, dropdownWidget->width() - 3);
Dropdown::SetChecked(EnumValue(gameState.Cheats.selectedStaffSpeed), true);
Dropdown::SetChecked(EnumValue(gameState.cheats.selectedStaffSpeed), true);
}
}
}
@@ -1010,7 +1010,7 @@ static StringId window_cheats_page_titles[] = {
void OnMouseDownWeather(WidgetIndex widgetIndex)
{
auto* widget = &widgets[widgetIndex];
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_WEATHER_DROPDOWN_BUTTON:
@@ -1026,7 +1026,7 @@ static StringId window_cheats_page_titles[] = {
{ windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1,
colours[1], 0, Dropdown::Flag::StayOpen, std::size(WeatherTypes), dropdownWidget->width() - 3);
auto currentWeather = gameState.WeatherCurrent.weatherType;
auto currentWeather = gameState.weatherCurrent.weatherType;
Dropdown::SetChecked(EnumValue(currentWeather), true);
break;
@@ -1036,7 +1036,7 @@ static StringId window_cheats_page_titles[] = {
void OnMouseUpPark(WidgetIndex widgetIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_OWN_ALL_LAND:
@@ -1055,7 +1055,7 @@ static StringId window_cheats_page_titles[] = {
CheatsSet(CheatType::HaveFun);
break;
case WIDX_NEVERENDING_MARKETING:
CheatsSet(CheatType::NeverendingMarketing, !gameState.Cheats.neverendingMarketing);
CheatsSet(CheatType::NeverendingMarketing, !gameState.cheats.neverendingMarketing);
break;
case WIDX_FORCE_PARK_RATING:
if (Park::GetForcedRating() >= 0)
@@ -1068,20 +1068,20 @@ static StringId window_cheats_page_titles[] = {
}
break;
case WIDX_ALLOW_BUILD_IN_PAUSE_MODE:
CheatsSet(CheatType::BuildInPauseMode, !gameState.Cheats.buildInPauseMode);
CheatsSet(CheatType::BuildInPauseMode, !gameState.cheats.buildInPauseMode);
break;
case WIDX_ALLOW_REGULAR_PATH_AS_QUEUE:
CheatsSet(CheatType::AllowRegularPathAsQueue, !gameState.Cheats.allowRegularPathAsQueue);
CheatsSet(CheatType::AllowRegularPathAsQueue, !gameState.cheats.allowRegularPathAsQueue);
break;
case WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES:
CheatsSet(CheatType::AllowSpecialColourSchemes, !gameState.Cheats.allowSpecialColourSchemes);
CheatsSet(CheatType::AllowSpecialColourSchemes, !gameState.cheats.allowSpecialColourSchemes);
break;
}
}
void OnMouseUpStaff(WidgetIndex widgetIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_CLEAR_GRASS:
@@ -1100,18 +1100,18 @@ static StringId window_cheats_page_titles[] = {
CheatsSet(CheatType::RemoveLitter);
break;
case WIDX_DISABLE_PLANT_AGING:
CheatsSet(CheatType::DisablePlantAging, !gameState.Cheats.disablePlantAging);
CheatsSet(CheatType::DisablePlantAging, !gameState.cheats.disablePlantAging);
break;
}
}
void OnMouseUpWeather(WidgetIndex widgetIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_FREEZE_WEATHER:
CheatsSet(CheatType::FreezeWeather, !gameState.Cheats.freezeWeather);
CheatsSet(CheatType::FreezeWeather, !gameState.cheats.freezeWeather);
break;
case WIDX_CREATE_DUCKS:
CheatsSet(CheatType::CreateDucks, kCheatsDuckIncrement);
@@ -1132,21 +1132,21 @@ static StringId window_cheats_page_titles[] = {
if (widgetIndex == WIDX_STAFF_SPEED_DROPDOWN_BUTTON)
{
int32_t speed = kCheatsStaffNormalSpeed;
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (dropdownIndex)
{
case 0:
gameState.Cheats.selectedStaffSpeed = StaffSpeedCheat::None;
gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::None;
speed = kCheatsStaffNormalSpeed;
break;
case 1:
gameState.Cheats.selectedStaffSpeed = StaffSpeedCheat::Frozen;
gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::Frozen;
speed = kCheatsStaffFreezeSpeed;
break;
case 2:
gameState.Cheats.selectedStaffSpeed = StaffSpeedCheat::Fast;
gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::Fast;
speed = kCheatsStaffFastSpeed;
}
CheatsSet(CheatType::SetStaffSpeed, speed);
@@ -1168,7 +1168,7 @@ static StringId window_cheats_page_titles[] = {
void OnMouseUpGuests(WidgetIndex widgetIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_GUEST_HAPPINESS_MAX:
@@ -1240,42 +1240,42 @@ static StringId window_cheats_page_titles[] = {
CheatsSet(CheatType::GiveAllGuests, OBJECT_UMBRELLA);
break;
case WIDX_GUEST_IGNORE_RIDE_INTENSITY:
CheatsSet(CheatType::IgnoreRideIntensity, !gameState.Cheats.ignoreRideIntensity);
CheatsSet(CheatType::IgnoreRideIntensity, !gameState.cheats.ignoreRideIntensity);
break;
case WIDX_GUEST_IGNORE_PRICE:
CheatsSet(CheatType::IgnorePrice, !gameState.Cheats.ignorePrice);
CheatsSet(CheatType::IgnorePrice, !gameState.cheats.ignorePrice);
break;
case WIDX_DISABLE_VANDALISM:
CheatsSet(CheatType::DisableVandalism, !gameState.Cheats.disableVandalism);
CheatsSet(CheatType::DisableVandalism, !gameState.cheats.disableVandalism);
break;
case WIDX_DISABLE_LITTERING:
CheatsSet(CheatType::DisableLittering, !gameState.Cheats.disableLittering);
CheatsSet(CheatType::DisableLittering, !gameState.cheats.disableLittering);
break;
}
}
void OnMouseUpRides(WidgetIndex widgetIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_RENEW_RIDES:
CheatsSet(CheatType::RenewRides);
break;
case WIDX_MAKE_DESTRUCTIBLE:
CheatsSet(CheatType::MakeDestructible, !gameState.Cheats.makeAllDestructible);
CheatsSet(CheatType::MakeDestructible, !gameState.cheats.makeAllDestructible);
break;
case WIDX_FIX_ALL:
CheatsSet(CheatType::FixRides);
break;
case WIDX_UNLOCK_OPERATING_LIMITS:
CheatsSet(CheatType::FastLiftHill, !gameState.Cheats.unlockOperatingLimits);
CheatsSet(CheatType::FastLiftHill, !gameState.cheats.unlockOperatingLimits);
break;
case WIDX_DISABLE_BRAKES_FAILURE:
CheatsSet(CheatType::DisableBrakesFailure, !gameState.Cheats.disableBrakesFailure);
CheatsSet(CheatType::DisableBrakesFailure, !gameState.cheats.disableBrakesFailure);
break;
case WIDX_DISABLE_ALL_BREAKDOWNS:
CheatsSet(CheatType::DisableAllBreakdowns, !gameState.Cheats.disableAllBreakdowns);
CheatsSet(CheatType::DisableAllBreakdowns, !gameState.cheats.disableAllBreakdowns);
break;
case WIDX_RESET_CRASH_STATUS:
CheatsSet(CheatType::ResetCrashStatus);
@@ -1285,59 +1285,59 @@ static StringId window_cheats_page_titles[] = {
break;
case WIDX_SHOW_ALL_OPERATING_MODES:
{
if (!gameState.Cheats.showAllOperatingModes)
if (!gameState.cheats.showAllOperatingModes)
{
ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {});
}
CheatsSet(CheatType::ShowAllOperatingModes, !gameState.Cheats.showAllOperatingModes);
CheatsSet(CheatType::ShowAllOperatingModes, !gameState.cheats.showAllOperatingModes);
}
break;
case WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES:
{
if (!gameState.Cheats.showVehiclesFromOtherTrackTypes)
if (!gameState.cheats.showVehiclesFromOtherTrackTypes)
{
ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {});
}
CheatsSet(CheatType::ShowVehiclesFromOtherTrackTypes, !gameState.Cheats.showVehiclesFromOtherTrackTypes);
CheatsSet(CheatType::ShowVehiclesFromOtherTrackTypes, !gameState.cheats.showVehiclesFromOtherTrackTypes);
}
break;
case WIDX_DISABLE_TRAIN_LENGTH_LIMITS:
{
if (!gameState.Cheats.disableTrainLengthLimit)
if (!gameState.cheats.disableTrainLengthLimit)
{
ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {});
}
CheatsSet(CheatType::DisableTrainLengthLimit, !gameState.Cheats.disableTrainLengthLimit);
CheatsSet(CheatType::DisableTrainLengthLimit, !gameState.cheats.disableTrainLengthLimit);
}
break;
case WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK:
CheatsSet(CheatType::EnableChainLiftOnAllTrack, !gameState.Cheats.enableChainLiftOnAllTrack);
CheatsSet(CheatType::EnableChainLiftOnAllTrack, !gameState.cheats.enableChainLiftOnAllTrack);
break;
case WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES:
{
if (!gameState.Cheats.allowArbitraryRideTypeChanges)
if (!gameState.cheats.allowArbitraryRideTypeChanges)
{
ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {});
}
CheatsSet(CheatType::AllowArbitraryRideTypeChanges, !gameState.Cheats.allowArbitraryRideTypeChanges);
CheatsSet(CheatType::AllowArbitraryRideTypeChanges, !gameState.cheats.allowArbitraryRideTypeChanges);
}
break;
case WIDX_DISABLE_RIDE_VALUE_AGING:
CheatsSet(CheatType::DisableRideValueAging, !gameState.Cheats.disableRideValueAging);
CheatsSet(CheatType::DisableRideValueAging, !gameState.cheats.disableRideValueAging);
break;
case WIDX_IGNORE_RESEARCH_STATUS:
CheatsSet(CheatType::IgnoreResearchStatus, !gameState.Cheats.ignoreResearchStatus);
CheatsSet(CheatType::IgnoreResearchStatus, !gameState.cheats.ignoreResearchStatus);
break;
case WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES:
CheatsSet(CheatType::EnableAllDrawableTrackPieces, !gameState.Cheats.enableAllDrawableTrackPieces);
CheatsSet(CheatType::EnableAllDrawableTrackPieces, !gameState.cheats.enableAllDrawableTrackPieces);
break;
case WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS:
{
if (!gameState.Cheats.allowTrackPlaceInvalidHeights)
if (!gameState.cheats.allowTrackPlaceInvalidHeights)
{
ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {});
}
CheatsSet(CheatType::AllowTrackPlaceInvalidHeights, !gameState.Cheats.allowTrackPlaceInvalidHeights);
CheatsSet(CheatType::AllowTrackPlaceInvalidHeights, !gameState.cheats.allowTrackPlaceInvalidHeights);
}
break;
}
+1 -1
View File
@@ -197,7 +197,7 @@ namespace OpenRCT2::Ui::Windows
// Draw cost amount
if (_clearSceneryCost != kMoney64Undefined && _clearSceneryCost != 0
&& !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
&& !(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
auto ft = Formatter();
ft.Add<money64>(_clearSceneryCost);
@@ -82,7 +82,7 @@ namespace OpenRCT2::Ui::Windows
auto currentRide = GetRide(rideId);
if (currentRide != nullptr)
{
auto stringId = (GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) ? STR_DEMOLISH_RIDE_ID
auto stringId = (getGameState().park.Flags & PARK_FLAGS_NO_MONEY) ? STR_DEMOLISH_RIDE_ID
: STR_DEMOLISH_RIDE_ID_MONEY;
auto ft = Formatter();
currentRide->formatNameTo(ft);
+1 -1
View File
@@ -505,7 +505,7 @@ namespace OpenRCT2::Ui::Windows
{
int32_t defaultIndex = -1;
const bool specialColoursEnabled = !alwaysHideSpecialColours && GetGameState().Cheats.allowSpecialColourSchemes;
const bool specialColoursEnabled = !alwaysHideSpecialColours && getGameState().cheats.allowSpecialColourSchemes;
auto numColours = specialColoursEnabled ? static_cast<uint8_t>(COLOUR_COUNT) : kColourNumNormal;
// Set items
for (uint64_t i = 0; i < numColours; i++)
+20 -20
View File
@@ -93,19 +93,19 @@ namespace OpenRCT2::Ui::Windows
}
else
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
if (gameState.EditorStep == EditorStep::ObjectSelection)
if (gameState.editorStep == EditorStep::ObjectSelection)
{
HidePreviousStepButton();
}
else if (gameState.EditorStep == EditorStep::RollercoasterDesigner)
else if (gameState.editorStep == EditorStep::RollercoasterDesigner)
{
HideNextStepButton();
}
else if (gLegacyScene != LegacyScene::trackDesigner)
{
if (GetNumFreeEntities() != kMaxEntities || GetGameState().Park.Flags & PARK_FLAGS_SPRITES_INITIALISED)
if (GetNumFreeEntities() != kMaxEntities || getGameState().park.Flags & PARK_FLAGS_SPRITES_INITIALISED)
{
HidePreviousStepButton();
}
@@ -137,18 +137,18 @@ namespace OpenRCT2::Ui::Windows
void OnMouseUp(WidgetIndex widgetIndex) override
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
if (widgetIndex == WIDX_PREVIOUS_STEP_BUTTON)
{
if (gLegacyScene == LegacyScene::trackDesigner
|| (GetNumFreeEntities() == kMaxEntities && !(gameState.Park.Flags & PARK_FLAGS_SPRITES_INITIALISED)))
|| (GetNumFreeEntities() == kMaxEntities && !(gameState.park.Flags & PARK_FLAGS_SPRITES_INITIALISED)))
{
((this)->*(kPreviousButtonMouseUp[EnumValue(gameState.EditorStep)]))();
((this)->*(kPreviousButtonMouseUp[EnumValue(gameState.editorStep)]))();
}
}
else if (widgetIndex == WIDX_NEXT_STEP_BUTTON)
{
((this)->*(kNextButtonMouseUp[EnumValue(gameState.EditorStep)]))();
((this)->*(kNextButtonMouseUp[EnumValue(gameState.editorStep)]))();
}
}
@@ -158,7 +158,7 @@ namespace OpenRCT2::Ui::Windows
auto* windowMgr = Ui::GetWindowManager();
windowMgr->CloseAll();
GetGameState().EditorStep = EditorStep::ObjectSelection;
getGameState().editorStep = EditorStep::ObjectSelection;
GfxInvalidateScreen();
}
@@ -169,7 +169,7 @@ namespace OpenRCT2::Ui::Windows
SetAllSceneryItemsInvented();
WindowScenerySetDefaultPlacementConfiguration();
GetGameState().EditorStep = EditorStep::LandscapeEditor;
getGameState().editorStep = EditorStep::LandscapeEditor;
ContextOpenWindow(WindowClass::Map);
GfxInvalidateScreen();
}
@@ -180,7 +180,7 @@ namespace OpenRCT2::Ui::Windows
windowMgr->CloseAll();
ContextOpenWindow(WindowClass::EditorInventionList);
GetGameState().EditorStep = EditorStep::InventionsListSetUp;
getGameState().editorStep = EditorStep::InventionsListSetUp;
GfxInvalidateScreen();
}
@@ -190,7 +190,7 @@ namespace OpenRCT2::Ui::Windows
windowMgr->CloseAll();
ContextOpenWindow(WindowClass::EditorScenarioOptions);
GetGameState().EditorStep = EditorStep::OptionsSelection;
getGameState().editorStep = EditorStep::OptionsSelection;
GfxInvalidateScreen();
}
@@ -222,7 +222,7 @@ namespace OpenRCT2::Ui::Windows
auto* windowMgr = Ui::GetWindowManager();
windowMgr->CloseAll();
ContextOpenWindow(WindowClass::EditorInventionList);
GetGameState().EditorStep = EditorStep::InventionsListSetUp;
getGameState().editorStep = EditorStep::InventionsListSetUp;
}
else
{
@@ -238,7 +238,7 @@ namespace OpenRCT2::Ui::Windows
windowMgr->CloseAll();
ContextOpenWindow(WindowClass::EditorScenarioOptions);
GetGameState().EditorStep = EditorStep::OptionsSelection;
getGameState().editorStep = EditorStep::OptionsSelection;
GfxInvalidateScreen();
}
@@ -248,13 +248,13 @@ namespace OpenRCT2::Ui::Windows
windowMgr->CloseAll();
ContextOpenWindow(WindowClass::EditorObjectiveOptions);
GetGameState().EditorStep = EditorStep::ObjectiveSelection;
getGameState().editorStep = EditorStep::ObjectiveSelection;
GfxInvalidateScreen();
}
void JumpForwardToSaveScenario() const
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
const auto savePrepareResult = ScenarioPrepareForSave(gameState);
if (!savePrepareResult.Successful)
{
@@ -268,7 +268,7 @@ namespace OpenRCT2::Ui::Windows
auto intent = Intent(WindowClass::Loadsave);
intent.PutEnumExtra<LoadSaveAction>(INTENT_EXTRA_LOADSAVE_ACTION, LoadSaveAction::save);
intent.PutEnumExtra<LoadSaveType>(INTENT_EXTRA_LOADSAVE_TYPE, LoadSaveType::scenario);
intent.PutExtra(INTENT_EXTRA_PATH, gameState.ScenarioName);
intent.PutExtra(INTENT_EXTRA_PATH, gameState.scenarioName);
ContextOpenIntent(&intent);
}
@@ -314,7 +314,7 @@ namespace OpenRCT2::Ui::Windows
int16_t textX = (widgets[WIDX_PREVIOUS_IMAGE].left + 30 + widgets[WIDX_PREVIOUS_IMAGE].right) / 2 + windowPos.x;
int16_t textY = widgets[WIDX_PREVIOUS_IMAGE].top + 6 + windowPos.y;
StringId stringId = kEditorStepNames[EnumValue(GetGameState().EditorStep) - 1];
StringId stringId = kEditorStepNames[EnumValue(getGameState().editorStep) - 1];
if (gLegacyScene == LegacyScene::trackDesigner)
stringId = STR_EDITOR_STEP_OBJECT_SELECTION;
@@ -353,7 +353,7 @@ namespace OpenRCT2::Ui::Windows
int16_t textX = (widgets[WIDX_NEXT_IMAGE].left + widgets[WIDX_NEXT_IMAGE].right - 30) / 2 + windowPos.x;
int16_t textY = widgets[WIDX_NEXT_IMAGE].top + 6 + windowPos.y;
StringId stringId = kEditorStepNames[EnumValue(GetGameState().EditorStep) + 1];
StringId stringId = kEditorStepNames[EnumValue(getGameState().editorStep) + 1];
if (gLegacyScene == LegacyScene::trackDesigner)
stringId = STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER;
@@ -367,7 +367,7 @@ namespace OpenRCT2::Ui::Windows
int16_t stateY = height - 0x0C + windowPos.y;
auto colour = colours[2].withFlag(ColourFlag::translucent, false).withFlag(ColourFlag::withOutline, true);
DrawTextBasic(
dpi, { stateX, stateY }, kEditorStepNames[EnumValue(GetGameState().EditorStep)], {},
dpi, { stateX, stateY }, kEditorStepNames[EnumValue(getGameState().editorStep)], {},
{ colour, TextAlignment::CENTRE });
}
@@ -224,15 +224,15 @@ namespace OpenRCT2::Ui::Windows
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
ScreenSize size{};
if (scrollIndex == 0)
{
size.height = static_cast<int32_t>(gameState.ResearchItemsInvented.size()) * kScrollableRowHeight;
size.height = static_cast<int32_t>(gameState.researchItemsInvented.size()) * kScrollableRowHeight;
}
else
{
size.height = static_cast<int32_t>(gameState.ResearchItemsUninvented.size()) * kScrollableRowHeight;
size.height = static_cast<int32_t>(gameState.researchItemsUninvented.size()) * kScrollableRowHeight;
}
return size;
}
@@ -270,7 +270,7 @@ namespace OpenRCT2::Ui::Windows
void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
// Draw background
uint8_t paletteIndex = ColourMapA[colours[1].colour].mid_light;
@@ -280,7 +280,7 @@ namespace OpenRCT2::Ui::Windows
int32_t itemY = -kScrollableRowHeight;
auto* dragItem = WindowEditorInventionsListDragGetItem();
const auto& researchList = scrollIndex == 0 ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented;
const auto& researchList = scrollIndex == 0 ? gameState.researchItemsInvented : gameState.researchItemsUninvented;
for (const auto& researchItem : researchList)
{
itemY += kScrollableRowHeight;
@@ -522,7 +522,7 @@ namespace OpenRCT2::Ui::Windows
void MoveResearchItem(const ResearchItem& item, ResearchItem* beforeItem, bool isInvented)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
_selectedResearchItem = nullptr;
Invalidate();
@@ -535,7 +535,7 @@ namespace OpenRCT2::Ui::Windows
ResearchRemove(item);
auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented;
auto& researchList = isInvented ? gameState.researchItemsInvented : gameState.researchItemsUninvented;
if (beforeItem != nullptr)
{
for (size_t i = 0; i < researchList.size(); i++)
@@ -555,8 +555,8 @@ namespace OpenRCT2::Ui::Windows
private:
ResearchItem* GetItemFromScrollY(bool isInvented, int32_t y) const
{
auto& gameState = GetGameState();
auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented;
auto& gameState = getGameState();
auto& researchList = isInvented ? gameState.researchItemsInvented : gameState.researchItemsUninvented;
for (auto& researchItem : researchList)
{
y -= kScrollableRowHeight;
@@ -571,8 +571,8 @@ namespace OpenRCT2::Ui::Windows
ResearchItem* GetItemFromScrollYIncludeSeps(bool isInvented, int32_t y) const
{
auto& gameState = GetGameState();
auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented;
auto& gameState = getGameState();
auto& researchList = isInvented ? gameState.researchItemsInvented : gameState.researchItemsUninvented;
for (auto& researchItem : researchList)
{
y -= kScrollableRowHeight;
@@ -1598,7 +1598,7 @@ namespace OpenRCT2::Ui::Windows
SetEveryRideTypeInvented();
SetEveryRideEntryInvented();
GetGameState().EditorStep = EditorStep::DesignsManager;
getGameState().editorStep = EditorStep::DesignsManager;
int32_t entry_index = 0;
for (; ObjectEntryGetChunk(ObjectType::ride, entry_index) == nullptr; entry_index++)
@@ -385,8 +385,8 @@ namespace OpenRCT2::Ui::Windows
*/
void SetObjective(int32_t objective)
{
auto& gameState = GetGameState();
gameState.ScenarioObjective.Type = objective;
auto& gameState = getGameState();
gameState.scenarioObjective.Type = objective;
Invalidate();
// Set default objective arguments
@@ -398,37 +398,37 @@ namespace OpenRCT2::Ui::Windows
case OBJECTIVE_10_ROLLERCOASTERS:
break;
case OBJECTIVE_GUESTS_BY:
gameState.ScenarioObjective.Year = 3;
gameState.ScenarioObjective.NumGuests = 1500;
gameState.scenarioObjective.Year = 3;
gameState.scenarioObjective.NumGuests = 1500;
break;
case OBJECTIVE_PARK_VALUE_BY:
gameState.ScenarioObjective.Year = 3;
gameState.ScenarioObjective.Currency = 50000.00_GBP;
gameState.scenarioObjective.Year = 3;
gameState.scenarioObjective.Currency = 50000.00_GBP;
break;
case OBJECTIVE_GUESTS_AND_RATING:
gameState.ScenarioObjective.NumGuests = 2000;
gameState.scenarioObjective.NumGuests = 2000;
break;
case OBJECTIVE_MONTHLY_RIDE_INCOME:
gameState.ScenarioObjective.Currency = 10000.00_GBP;
gameState.scenarioObjective.Currency = 10000.00_GBP;
break;
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
gameState.ScenarioObjective.MinimumLength = 1200;
gameState.scenarioObjective.MinimumLength = 1200;
break;
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
gameState.ScenarioObjective.MinimumExcitement = MakeRideRating(6, 70);
gameState.scenarioObjective.MinimumExcitement = MakeRideRating(6, 70);
break;
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
gameState.ScenarioObjective.Currency = 50000.00_GBP;
gameState.scenarioObjective.Currency = 50000.00_GBP;
break;
case OBJECTIVE_MONTHLY_FOOD_INCOME:
gameState.ScenarioObjective.Currency = 1000.00_GBP;
gameState.scenarioObjective.Currency = 1000.00_GBP;
break;
}
}
void ShowObjectiveDropdown()
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
int32_t numItems = 0, objectiveType;
Widget* dropdownWidget;
@@ -439,7 +439,7 @@ namespace OpenRCT2::Ui::Windows
if (i == OBJECTIVE_NONE || i == OBJECTIVE_BUILD_THE_BEST)
continue;
const bool objectiveAllowedByMoneyUsage = !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY)
const bool objectiveAllowedByMoneyUsage = !(getGameState().park.Flags & PARK_FLAGS_NO_MONEY)
|| !ObjectiveNeedsMoney(i);
// This objective can only work if the player can ask money for rides.
const bool objectiveAllowedByPaymentSettings = (i != OBJECTIVE_MONTHLY_RIDE_INCOME)
@@ -456,7 +456,7 @@ namespace OpenRCT2::Ui::Windows
{ windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1,
colours[1], 0, Dropdown::Flag::StayOpen, numItems, dropdownWidget->width() - 3);
objectiveType = gameState.ScenarioObjective.Type;
objectiveType = gameState.scenarioObjective.Type;
for (int32_t j = 0; j < numItems; j++)
{
if (gDropdownItems[j].Args - STR_OBJECTIVE_DROPDOWN_NONE == objectiveType)
@@ -482,68 +482,68 @@ namespace OpenRCT2::Ui::Windows
WindowDropdownShowTextCustomWidth(
{ windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1,
colours[1], 0, Dropdown::Flag::StayOpen, 5, dropdownWidget->width() - 3);
Dropdown::SetChecked(GetGameState().ScenarioCategory, true);
Dropdown::SetChecked(getGameState().scenarioCategory, true);
}
void Arg1Increase()
{
auto& gameState = GetGameState();
switch (gameState.ScenarioObjective.Type)
auto& gameState = getGameState();
switch (gameState.scenarioObjective.Type)
{
case OBJECTIVE_PARK_VALUE_BY:
case OBJECTIVE_MONTHLY_RIDE_INCOME:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
if (gameState.ScenarioObjective.Currency >= kObjectiveCurrencyLoanAndValueMax)
if (gameState.scenarioObjective.Currency >= kObjectiveCurrencyLoanAndValueMax)
{
ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.Currency += kObjectiveCurrencyLoanAndValueAdjustment;
gameState.scenarioObjective.Currency += kObjectiveCurrencyLoanAndValueAdjustment;
Invalidate();
}
break;
case OBJECTIVE_MONTHLY_FOOD_INCOME:
if (gameState.ScenarioObjective.Currency >= kObjectiveCurrencyFoodMax)
if (gameState.scenarioObjective.Currency >= kObjectiveCurrencyFoodMax)
{
ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.Currency += kObjectiveCurrencyFoodAdjustment;
gameState.scenarioObjective.Currency += kObjectiveCurrencyFoodAdjustment;
Invalidate();
}
break;
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
if (gameState.ScenarioObjective.MinimumLength >= kObjectiveLengthMax)
if (gameState.scenarioObjective.MinimumLength >= kObjectiveLengthMax)
{
ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.MinimumLength += kObjectiveLengthAdjustment;
gameState.scenarioObjective.MinimumLength += kObjectiveLengthAdjustment;
Invalidate();
}
break;
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
if (gameState.ScenarioObjective.MinimumExcitement >= kObjectiveExcitementMax)
if (gameState.scenarioObjective.MinimumExcitement >= kObjectiveExcitementMax)
{
ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.MinimumExcitement += kObjectiveExcitementAdjustment;
gameState.scenarioObjective.MinimumExcitement += kObjectiveExcitementAdjustment;
Invalidate();
}
break;
default:
if (gameState.ScenarioObjective.NumGuests >= kObjectiveGuestsMax)
if (gameState.scenarioObjective.NumGuests >= kObjectiveGuestsMax)
{
ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.NumGuests += kObjectiveGuestsAdjustment;
gameState.scenarioObjective.NumGuests += kObjectiveGuestsAdjustment;
Invalidate();
}
break;
@@ -552,63 +552,63 @@ namespace OpenRCT2::Ui::Windows
void Arg1Decrease()
{
auto& gameState = GetGameState();
switch (gameState.ScenarioObjective.Type)
auto& gameState = getGameState();
switch (gameState.scenarioObjective.Type)
{
case OBJECTIVE_PARK_VALUE_BY:
case OBJECTIVE_MONTHLY_RIDE_INCOME:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
if (gameState.ScenarioObjective.Currency <= kObjectiveCurrencyLoanAndValueMin)
if (gameState.scenarioObjective.Currency <= kObjectiveCurrencyLoanAndValueMin)
{
ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.Currency -= kObjectiveCurrencyLoanAndValueAdjustment;
gameState.scenarioObjective.Currency -= kObjectiveCurrencyLoanAndValueAdjustment;
Invalidate();
}
break;
case OBJECTIVE_MONTHLY_FOOD_INCOME:
if (gameState.ScenarioObjective.Currency <= kObjectiveCurrencyFoodMin)
if (gameState.scenarioObjective.Currency <= kObjectiveCurrencyFoodMin)
{
ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.Currency -= kObjectiveCurrencyFoodAdjustment;
gameState.scenarioObjective.Currency -= kObjectiveCurrencyFoodAdjustment;
Invalidate();
}
break;
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
if (gameState.ScenarioObjective.MinimumLength <= kObjectiveLengthMin)
if (gameState.scenarioObjective.MinimumLength <= kObjectiveLengthMin)
{
ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.MinimumLength -= kObjectiveLengthAdjustment;
gameState.scenarioObjective.MinimumLength -= kObjectiveLengthAdjustment;
Invalidate();
}
break;
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
if (gameState.ScenarioObjective.MinimumExcitement <= kObjectiveExcitementMin)
if (gameState.scenarioObjective.MinimumExcitement <= kObjectiveExcitementMin)
{
ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.MinimumExcitement -= kObjectiveExcitementAdjustment;
gameState.scenarioObjective.MinimumExcitement -= kObjectiveExcitementAdjustment;
Invalidate();
}
break;
default:
if (gameState.ScenarioObjective.NumGuests <= kObjectiveGuestsMin)
if (gameState.scenarioObjective.NumGuests <= kObjectiveGuestsMin)
{
ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.NumGuests -= kObjectiveGuestsAdjustment;
gameState.scenarioObjective.NumGuests -= kObjectiveGuestsAdjustment;
Invalidate();
}
break;
@@ -617,28 +617,28 @@ namespace OpenRCT2::Ui::Windows
void Arg2Increase()
{
auto& gameState = GetGameState();
if (gameState.ScenarioObjective.Year >= kObjectiveYearMax)
auto& gameState = getGameState();
if (gameState.scenarioObjective.Year >= kObjectiveYearMax)
{
ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.Year += kObjectiveYearAdjustment;
gameState.scenarioObjective.Year += kObjectiveYearAdjustment;
Invalidate();
}
}
void Arg2Decrease()
{
auto& gameState = GetGameState();
if (gameState.ScenarioObjective.Year <= kObjectiveYearMin)
auto& gameState = getGameState();
if (gameState.scenarioObjective.Year <= kObjectiveYearMin)
{
ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {});
}
else
{
gameState.ScenarioObjective.Year -= kObjectiveYearAdjustment;
gameState.scenarioObjective.Year -= kObjectiveYearAdjustment;
Invalidate();
}
}
@@ -651,25 +651,25 @@ namespace OpenRCT2::Ui::Windows
*/
void OnMouseUpMain(WidgetIndex widgetIndex)
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_PARK_NAME:
{
WindowTextInputRawOpen(
this, WIDX_PARK_NAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, {}, gameState.Park.Name.c_str(),
this, WIDX_PARK_NAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, {}, gameState.park.Name.c_str(),
kParkNameMaxLength);
break;
}
case WIDX_SCENARIO_NAME:
WindowTextInputRawOpen(
this, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, {},
gameState.ScenarioName.c_str(), kScenarioNameMaxLength);
gameState.scenarioName.c_str(), kScenarioNameMaxLength);
break;
case WIDX_DETAILS:
WindowTextInputRawOpen(
this, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, {},
gameState.ScenarioDetails.c_str(), kScenarioDetailsNameMaxLength);
gameState.scenarioDetails.c_str(), kScenarioDetailsNameMaxLength);
break;
}
}
@@ -718,7 +718,7 @@ namespace OpenRCT2::Ui::Windows
*/
void OnDropdownMain(WidgetIndex widgetIndex, int32_t dropdownIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
uint8_t newObjectiveType;
if (dropdownIndex == -1)
@@ -729,13 +729,13 @@ namespace OpenRCT2::Ui::Windows
case WIDX_OBJECTIVE_DROPDOWN:
// TODO: Don't rely on string ID order
newObjectiveType = static_cast<uint8_t>(gDropdownItems[dropdownIndex].Args - STR_OBJECTIVE_DROPDOWN_NONE);
if (gameState.ScenarioObjective.Type != newObjectiveType)
if (gameState.scenarioObjective.Type != newObjectiveType)
SetObjective(newObjectiveType);
break;
case WIDX_CATEGORY_DROPDOWN:
if (gameState.ScenarioCategory != static_cast<uint8_t>(dropdownIndex))
if (gameState.scenarioCategory != static_cast<uint8_t>(dropdownIndex))
{
gameState.ScenarioCategory = static_cast<SCENARIO_CATEGORY>(dropdownIndex);
gameState.scenarioCategory = static_cast<SCENARIO_CATEGORY>(dropdownIndex);
Invalidate();
}
break;
@@ -754,10 +754,10 @@ namespace OpenRCT2::Ui::Windows
OnPrepareDraw();
InvalidateWidget(WIDX_TAB_1);
objectiveType = GetGameState().ScenarioObjective.Type;
objectiveType = getGameState().scenarioObjective.Type;
// Check if objective is allowed by money and pay-per-ride settings.
const bool objectiveAllowedByMoneyUsage = !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY)
const bool objectiveAllowedByMoneyUsage = !(getGameState().park.Flags & PARK_FLAGS_NO_MONEY)
|| !ObjectiveNeedsMoney(objectiveType);
// This objective can only work if the player can ask money for rides.
const bool objectiveAllowedByPaymentSettings = (objectiveType != OBJECTIVE_MONTHLY_RIDE_INCOME)
@@ -778,7 +778,7 @@ namespace OpenRCT2::Ui::Windows
if (text.empty())
return;
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_PARK_NAME:
@@ -786,18 +786,18 @@ namespace OpenRCT2::Ui::Windows
auto action = ParkSetNameAction(std::string(text));
GameActions::Execute(&action);
if (gameState.ScenarioName.empty())
if (gameState.scenarioName.empty())
{
gameState.ScenarioName = gameState.Park.Name;
gameState.scenarioName = gameState.park.Name;
}
break;
}
case WIDX_SCENARIO_NAME:
gameState.ScenarioName = text;
gameState.scenarioName = text;
Invalidate();
break;
case WIDX_DETAILS:
gameState.ScenarioDetails = text;
gameState.scenarioDetails = text;
Invalidate();
break;
}
@@ -809,11 +809,11 @@ namespace OpenRCT2::Ui::Windows
*/
void OnPrepareDrawMain()
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
SetPressedTab();
switch (gameState.ScenarioObjective.Type)
switch (gameState.scenarioObjective.Type)
{
case OBJECTIVE_GUESTS_BY:
case OBJECTIVE_PARK_VALUE_BY:
@@ -859,7 +859,7 @@ namespace OpenRCT2::Ui::Windows
*/
void OnDrawMain(DrawPixelInfo& dpi)
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
int32_t widthToSet;
StringId stringId;
@@ -873,14 +873,14 @@ namespace OpenRCT2::Ui::Windows
// Objective value
screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_OBJECTIVE].left + 1, widgets[WIDX_OBJECTIVE].top };
auto ft = Formatter();
ft.Add<StringId>(ObjectiveDropdownOptionNames[gameState.ScenarioObjective.Type]);
ft.Add<StringId>(ObjectiveDropdownOptionNames[gameState.scenarioObjective.Type]);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
if (widgets[WIDX_OBJECTIVE_ARG_1].type != WindowWidgetType::Empty)
{
// Objective argument 1 label
screenCoords = windowPos + ScreenCoordsXY{ 28, widgets[WIDX_OBJECTIVE_ARG_1].top };
switch (gameState.ScenarioObjective.Type)
switch (gameState.scenarioObjective.Type)
{
case OBJECTIVE_GUESTS_BY:
case OBJECTIVE_GUESTS_AND_RATING:
@@ -909,31 +909,31 @@ namespace OpenRCT2::Ui::Windows
screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_OBJECTIVE_ARG_1].left + 1, widgets[WIDX_OBJECTIVE_ARG_1].top };
ft = Formatter();
switch (gameState.ScenarioObjective.Type)
switch (gameState.scenarioObjective.Type)
{
case OBJECTIVE_GUESTS_BY:
case OBJECTIVE_GUESTS_AND_RATING:
stringId = STR_WINDOW_COLOUR_2_COMMA32;
ft.Add<int32_t>(gameState.ScenarioObjective.NumGuests);
ft.Add<int32_t>(gameState.scenarioObjective.NumGuests);
break;
case OBJECTIVE_PARK_VALUE_BY:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
case OBJECTIVE_MONTHLY_RIDE_INCOME:
case OBJECTIVE_MONTHLY_FOOD_INCOME:
stringId = STR_CURRENCY_FORMAT_LABEL;
ft.Add<money64>(gameState.ScenarioObjective.Currency);
ft.Add<money64>(gameState.scenarioObjective.Currency);
break;
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
stringId = STR_WINDOW_COLOUR_2_LENGTH;
ft.Add<uint16_t>(gameState.ScenarioObjective.MinimumLength);
ft.Add<uint16_t>(gameState.scenarioObjective.MinimumLength);
break;
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
stringId = STR_WINDOW_COLOUR_2_COMMA2DP32;
ft.Add<uint16_t>(gameState.ScenarioObjective.MinimumExcitement);
ft.Add<uint16_t>(gameState.scenarioObjective.MinimumExcitement);
break;
default:
stringId = STR_WINDOW_COLOUR_2_COMMA2DP32;
ft.Add<money64>(gameState.ScenarioObjective.Currency);
ft.Add<money64>(gameState.scenarioObjective.Currency);
break;
}
DrawTextBasic(dpi, screenCoords, stringId, ft, { COLOUR_BLACK });
@@ -949,7 +949,7 @@ namespace OpenRCT2::Ui::Windows
screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_OBJECTIVE_ARG_2].left + 1, widgets[WIDX_OBJECTIVE_ARG_2].top };
ft = Formatter();
ft.Add<uint16_t>((gameState.ScenarioObjective.Year * MONTH_COUNT) - 1);
ft.Add<uint16_t>((gameState.scenarioObjective.Year * MONTH_COUNT) - 1);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, ft);
}
@@ -958,7 +958,7 @@ namespace OpenRCT2::Ui::Windows
widthToSet = widgets[WIDX_PARK_NAME].left - 16;
{
auto parkName = GetGameState().Park.Name.c_str();
auto parkName = getGameState().park.Name.c_str();
ft = Formatter();
ft.Add<StringId>(STR_STRING);
@@ -972,7 +972,7 @@ namespace OpenRCT2::Ui::Windows
ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(gameState.ScenarioName.c_str());
ft.Add<const char*>(gameState.scenarioName.c_str());
DrawTextEllipsised(dpi, screenCoords, widthToSet, STR_WINDOW_SCENARIO_NAME, ft);
// Scenario details label
@@ -985,7 +985,7 @@ namespace OpenRCT2::Ui::Windows
ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(gameState.ScenarioDetails.c_str());
ft.Add<const char*>(gameState.scenarioDetails.c_str());
DrawTextWrapped(dpi, screenCoords, widthToSet, STR_BLACK_STRING, ft);
// Scenario category label
@@ -995,7 +995,7 @@ namespace OpenRCT2::Ui::Windows
// Scenario category value
screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_CATEGORY].left + 1, widgets[WIDX_CATEGORY].top };
ft = Formatter();
ft.Add<StringId>(kScenarioCategoryStringIds[gameState.ScenarioCategory]);
ft.Add<StringId>(kScenarioCategoryStringIds[gameState.scenarioCategory]);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
}
@@ -359,7 +359,7 @@ namespace OpenRCT2::Ui::Windows
void FinancialMouseUp(WidgetIndex widgetIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_CLOSE:
@@ -372,7 +372,7 @@ namespace OpenRCT2::Ui::Windows
break;
case WIDX_NO_MONEY:
{
auto newMoneySetting = (gameState.Park.Flags & PARK_FLAGS_NO_MONEY) ? 0 : 1;
auto newMoneySetting = (gameState.park.Flags & PARK_FLAGS_NO_MONEY) ? 0 : 1;
auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::NoMoney, newMoneySetting);
GameActions::Execute(&scenarioSetSetting);
Invalidate();
@@ -382,7 +382,7 @@ namespace OpenRCT2::Ui::Windows
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::ForbidMarketingCampaigns,
gameState.Park.Flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN ? 0 : 1);
gameState.park.Flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN ? 0 : 1);
GameActions::Execute(&scenarioSetSetting);
Invalidate();
break;
@@ -390,7 +390,7 @@ namespace OpenRCT2::Ui::Windows
case WIDX_RCT1_INTEREST:
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::UseRCT1Interest, gameState.Park.Flags & PARK_FLAGS_RCT1_INTEREST ? 0 : 1);
ScenarioSetSetting::UseRCT1Interest, gameState.park.Flags & PARK_FLAGS_RCT1_INTEREST ? 0 : 1);
GameActions::Execute(&scenarioSetSetting);
Invalidate();
break;
@@ -405,14 +405,14 @@ namespace OpenRCT2::Ui::Windows
void FinancialMouseDown(WidgetIndex widgetIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_INITIAL_CASH_INCREASE:
if (gameState.InitialCash < 1000000.00_GBP)
if (gameState.initialCash < 1000000.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::InitialCash, gameState.InitialCash + 500.00_GBP);
ScenarioSetSetting::InitialCash, gameState.initialCash + 500.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -422,10 +422,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_INITIAL_CASH_DECREASE:
if (gameState.InitialCash > 0.00_GBP)
if (gameState.initialCash > 0.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::InitialCash, gameState.InitialCash - 500.00_GBP);
ScenarioSetSetting::InitialCash, gameState.initialCash - 500.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -435,10 +435,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_INITIAL_LOAN_INCREASE:
if (gameState.BankLoan < 5000000.00_GBP)
if (gameState.bankLoan < 5000000.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::InitialLoan, gameState.BankLoan + 1000.00_GBP);
ScenarioSetSetting::InitialLoan, gameState.bankLoan + 1000.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -448,10 +448,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_INITIAL_LOAN_DECREASE:
if (gameState.BankLoan > 0.00_GBP)
if (gameState.bankLoan > 0.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::InitialLoan, gameState.BankLoan - 1000.00_GBP);
ScenarioSetSetting::InitialLoan, gameState.bankLoan - 1000.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -461,10 +461,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_MAXIMUM_LOAN_INCREASE:
if (gameState.MaxBankLoan < 5000000.00_GBP)
if (gameState.maxBankLoan < 5000000.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::MaximumLoanSize, gameState.MaxBankLoan + 1000.00_GBP);
ScenarioSetSetting::MaximumLoanSize, gameState.maxBankLoan + 1000.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -474,10 +474,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_MAXIMUM_LOAN_DECREASE:
if (gameState.MaxBankLoan > 0.00_GBP)
if (gameState.maxBankLoan > 0.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::MaximumLoanSize, gameState.MaxBankLoan - 1000.00_GBP);
ScenarioSetSetting::MaximumLoanSize, gameState.maxBankLoan - 1000.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -487,10 +487,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_INTEREST_RATE_INCREASE:
if (gameState.BankLoanInterestRate < MaxBankLoanInterestRate)
if (gameState.bankLoanInterestRate < MaxBankLoanInterestRate)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::AnnualInterestRate, gameState.BankLoanInterestRate + 1);
ScenarioSetSetting::AnnualInterestRate, gameState.bankLoanInterestRate + 1);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -500,9 +500,9 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_INTEREST_RATE_DECREASE:
if (gameState.BankLoanInterestRate > 0)
if (gameState.bankLoanInterestRate > 0)
{
auto interest = std::min<uint8_t>(MaxBankLoanInterestRate, gameState.BankLoanInterestRate - 1);
auto interest = std::min<uint8_t>(MaxBankLoanInterestRate, gameState.bankLoanInterestRate - 1);
auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::AnnualInterestRate, interest);
GameActions::Execute(&scenarioSetSetting);
}
@@ -533,8 +533,8 @@ namespace OpenRCT2::Ui::Windows
{
SetPressedTab();
auto& gameState = GetGameState();
if (gameState.Park.Flags & PARK_FLAGS_NO_MONEY)
auto& gameState = getGameState();
if (gameState.park.Flags & PARK_FLAGS_NO_MONEY)
{
SetWidgetPressed(WIDX_NO_MONEY, true);
for (int32_t i = WIDX_INITIAL_CASH; i <= WIDX_RCT1_INTEREST; i++)
@@ -554,7 +554,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_MAXIMUM_LOAN_DECREASE].type = WindowWidgetType::Button;
widgets[WIDX_FORBID_MARKETING].type = WindowWidgetType::Checkbox;
if (gameState.Park.Flags & PARK_FLAGS_RCT1_INTEREST)
if (gameState.park.Flags & PARK_FLAGS_RCT1_INTEREST)
{
widgets[WIDX_INTEREST_RATE].type = WindowWidgetType::Empty;
widgets[WIDX_INTEREST_RATE_INCREASE].type = WindowWidgetType::Empty;
@@ -571,7 +571,7 @@ namespace OpenRCT2::Ui::Windows
}
}
SetWidgetPressed(WIDX_FORBID_MARKETING, gameState.Park.Flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN);
SetWidgetPressed(WIDX_FORBID_MARKETING, gameState.park.Flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN);
widgets[WIDX_CLOSE].type = gLegacyScene == LegacyScene::scenarioEditor ? WindowWidgetType::Empty
: WindowWidgetType::CloseBox;
@@ -586,7 +586,7 @@ namespace OpenRCT2::Ui::Windows
WindowDrawWidgets(*this, dpi);
DrawTabImages(dpi);
auto& gameState = GetGameState();
auto& gameState = getGameState();
const auto& initialCashWidget = widgets[WIDX_INITIAL_CASH];
if (initialCashWidget.type != WindowWidgetType::Empty)
@@ -596,7 +596,7 @@ namespace OpenRCT2::Ui::Windows
screenCoords = windowPos + ScreenCoordsXY{ initialCashWidget.left + 1, initialCashWidget.top };
auto ft = Formatter();
ft.Add<money64>(GetGameState().InitialCash);
ft.Add<money64>(getGameState().initialCash);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
@@ -608,7 +608,7 @@ namespace OpenRCT2::Ui::Windows
screenCoords = windowPos + ScreenCoordsXY{ initialLoanWidget.left + 1, initialLoanWidget.top };
auto ft = Formatter();
ft.Add<money64>(gameState.BankLoan);
ft.Add<money64>(gameState.bankLoan);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
@@ -620,7 +620,7 @@ namespace OpenRCT2::Ui::Windows
screenCoords = windowPos + ScreenCoordsXY{ maximumLoanWidget.left + 1, maximumLoanWidget.top };
auto ft = Formatter();
ft.Add<money64>(GetGameState().MaxBankLoan);
ft.Add<money64>(getGameState().maxBankLoan);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
@@ -634,7 +634,7 @@ namespace OpenRCT2::Ui::Windows
auto ft = Formatter();
ft.Add<int16_t>(
std::clamp<int16_t>(static_cast<int16_t>(gameState.BankLoanInterestRate), INT16_MIN, INT16_MAX));
std::clamp<int16_t>(static_cast<int16_t>(gameState.bankLoanInterestRate), INT16_MIN, INT16_MAX));
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
}
}
@@ -665,15 +665,15 @@ namespace OpenRCT2::Ui::Windows
void GuestsMouseDown(WidgetIndex widgetIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_CASH_PER_GUEST_INCREASE:
if (gameState.GuestInitialCash < 1000.00_GBP)
if (gameState.guestInitialCash < 1000.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::AverageCashPerGuest, gameState.GuestInitialCash + 1.00_GBP);
ScenarioSetSetting::AverageCashPerGuest, gameState.guestInitialCash + 1.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -683,10 +683,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_CASH_PER_GUEST_DECREASE:
if (gameState.GuestInitialCash > 0.00_GBP)
if (gameState.guestInitialCash > 0.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::AverageCashPerGuest, gameState.GuestInitialCash - 1.00_GBP);
ScenarioSetSetting::AverageCashPerGuest, gameState.guestInitialCash - 1.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -696,10 +696,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_GUEST_INITIAL_HAPPINESS_INCREASE:
if (gameState.GuestInitialHappiness < 250)
if (gameState.guestInitialHappiness < 250)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::GuestInitialHappiness, gameState.GuestInitialHappiness + 4);
ScenarioSetSetting::GuestInitialHappiness, gameState.guestInitialHappiness + 4);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -709,10 +709,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_GUEST_INITIAL_HAPPINESS_DECREASE:
if (gameState.GuestInitialHappiness > 40)
if (gameState.guestInitialHappiness > 40)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::GuestInitialHappiness, gameState.GuestInitialHappiness - 4);
ScenarioSetSetting::GuestInitialHappiness, gameState.guestInitialHappiness - 4);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -722,10 +722,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_GUEST_INITIAL_HUNGER_INCREASE:
if (gameState.GuestInitialHunger > 40)
if (gameState.guestInitialHunger > 40)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::GuestInitialHunger, gameState.GuestInitialHunger - 4);
ScenarioSetSetting::GuestInitialHunger, gameState.guestInitialHunger - 4);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -735,10 +735,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_GUEST_INITIAL_HUNGER_DECREASE:
if (gameState.GuestInitialHunger < 250)
if (gameState.guestInitialHunger < 250)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::GuestInitialHunger, gameState.GuestInitialHunger + 4);
ScenarioSetSetting::GuestInitialHunger, gameState.guestInitialHunger + 4);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -748,10 +748,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_GUEST_INITIAL_THIRST_INCREASE:
if (gameState.GuestInitialThirst > 40)
if (gameState.guestInitialThirst > 40)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::GuestInitialThirst, gameState.GuestInitialThirst - 4);
ScenarioSetSetting::GuestInitialThirst, gameState.guestInitialThirst - 4);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -761,10 +761,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_GUEST_INITIAL_THIRST_DECREASE:
if (gameState.GuestInitialThirst < 250)
if (gameState.guestInitialThirst < 250)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::GuestInitialThirst, gameState.GuestInitialThirst + 4);
ScenarioSetSetting::GuestInitialThirst, gameState.guestInitialThirst + 4);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -792,8 +792,8 @@ namespace OpenRCT2::Ui::Windows
{ windowPos.x + dropdownWidget.left, windowPos.y + dropdownWidget.top }, dropdownWidget.height() - 1,
colours[1], 0, Dropdown::Flag::StayOpen, 4, dropdownWidget.width() - 3);
const auto preferLess = gameState.Park.Flags & PARK_FLAGS_PREF_LESS_INTENSE_RIDES;
const auto preferMore = gameState.Park.Flags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES;
const auto preferLess = gameState.park.Flags & PARK_FLAGS_PREF_LESS_INTENSE_RIDES;
const auto preferMore = gameState.park.Flags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES;
auto prefItem = 1;
if (preferLess && preferMore)
@@ -837,8 +837,8 @@ namespace OpenRCT2::Ui::Windows
{
SetPressedTab();
auto& gameState = GetGameState();
if (gameState.Park.Flags & PARK_FLAGS_NO_MONEY)
auto& gameState = getGameState();
if (gameState.park.Flags & PARK_FLAGS_NO_MONEY)
{
widgets[WIDX_CASH_PER_GUEST].type = WindowWidgetType::Empty;
widgets[WIDX_CASH_PER_GUEST_INCREASE].type = WindowWidgetType::Empty;
@@ -863,7 +863,7 @@ namespace OpenRCT2::Ui::Windows
WindowDrawWidgets(*this, dpi);
DrawTabImages(dpi);
auto& gameState = GetGameState();
auto& gameState = getGameState();
const auto& cashPerGuestWidget = widgets[WIDX_CASH_PER_GUEST];
if (cashPerGuestWidget.type != WindowWidgetType::Empty)
@@ -875,7 +875,7 @@ namespace OpenRCT2::Ui::Windows
// Cash per guest value
screenCoords = windowPos + ScreenCoordsXY{ cashPerGuestWidget.left + 1, cashPerGuestWidget.top };
auto ft = Formatter();
ft.Add<money64>(gameState.GuestInitialCash);
ft.Add<money64>(gameState.guestInitialCash);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
@@ -887,7 +887,7 @@ namespace OpenRCT2::Ui::Windows
// Guest initial happiness value
screenCoords = windowPos + ScreenCoordsXY{ initialHappinessWidget.left + 1, initialHappinessWidget.top };
auto ft = Formatter();
ft.Add<uint16_t>((gameState.GuestInitialHappiness * 100) / 255);
ft.Add<uint16_t>((gameState.guestInitialHappiness * 100) / 255);
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
// Guest initial hunger label
@@ -898,7 +898,7 @@ namespace OpenRCT2::Ui::Windows
// Guest initial hunger value
screenCoords = windowPos + ScreenCoordsXY{ initialHungerWidget.left + 1, initialHungerWidget.top };
ft = Formatter();
ft.Add<uint16_t>(((255 - gameState.GuestInitialHunger) * 100) / 255);
ft.Add<uint16_t>(((255 - gameState.guestInitialHunger) * 100) / 255);
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
// Guest initial thirst label
@@ -909,7 +909,7 @@ namespace OpenRCT2::Ui::Windows
// Guest initial thirst value
screenCoords = windowPos + ScreenCoordsXY{ initialThirstWidget.left + 1, initialThirstWidget.top };
ft = Formatter();
ft.Add<uint16_t>(((255 - gameState.GuestInitialThirst) * 100) / 255);
ft.Add<uint16_t>(((255 - gameState.guestInitialThirst) * 100) / 255);
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
// Guests' intensity value
@@ -917,8 +917,8 @@ namespace OpenRCT2::Ui::Windows
const auto& guestsIntensity = widgets[WIDX_GUESTS_INTENSITY_PREFERENCE];
screenCoords = windowPos + ScreenCoordsXY{ guestsIntensity.left + 1, guestsIntensity.top };
const auto preferLess = gameState.Park.Flags & PARK_FLAGS_PREF_LESS_INTENSE_RIDES;
const auto preferMore = gameState.Park.Flags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES;
const auto preferLess = gameState.park.Flags & PARK_FLAGS_PREF_LESS_INTENSE_RIDES;
const auto preferMore = gameState.park.Flags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES;
StringId prefString = STR_GUESTS_PREFER_INTENSITY_BALANCED;
if (preferLess && preferMore)
@@ -940,7 +940,7 @@ namespace OpenRCT2::Ui::Windows
void ParkMouseUp(WidgetIndex widgetIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_CLOSE:
@@ -954,7 +954,7 @@ namespace OpenRCT2::Ui::Windows
case WIDX_FORBID_TREE_REMOVAL:
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::ForbidTreeRemoval, gameState.Park.Flags & PARK_FLAGS_FORBID_TREE_REMOVAL ? 0 : 1);
ScenarioSetSetting::ForbidTreeRemoval, gameState.park.Flags & PARK_FLAGS_FORBID_TREE_REMOVAL ? 0 : 1);
GameActions::Execute(&scenarioSetSetting);
Invalidate();
break;
@@ -963,7 +963,7 @@ namespace OpenRCT2::Ui::Windows
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::ForbidLandscapeChanges,
gameState.Park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES ? 0 : 1);
gameState.park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES ? 0 : 1);
GameActions::Execute(&scenarioSetSetting);
Invalidate();
break;
@@ -972,7 +972,7 @@ namespace OpenRCT2::Ui::Windows
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::ForbidHighConstruction,
gameState.Park.Flags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION ? 0 : 1);
gameState.park.Flags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION ? 0 : 1);
GameActions::Execute(&scenarioSetSetting);
Invalidate();
break;
@@ -981,7 +981,7 @@ namespace OpenRCT2::Ui::Windows
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::ParkRatingHigherDifficultyLevel,
gameState.Park.Flags & PARK_FLAGS_DIFFICULT_PARK_RATING ? 0 : 1);
gameState.park.Flags & PARK_FLAGS_DIFFICULT_PARK_RATING ? 0 : 1);
GameActions::Execute(&scenarioSetSetting);
Invalidate();
break;
@@ -990,7 +990,7 @@ namespace OpenRCT2::Ui::Windows
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::GuestGenerationHigherDifficultyLevel,
gameState.Park.Flags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION ? 0 : 1);
gameState.park.Flags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION ? 0 : 1);
GameActions::Execute(&scenarioSetSetting);
Invalidate();
break;
@@ -1008,14 +1008,14 @@ namespace OpenRCT2::Ui::Windows
Widget* dropdownWidget;
Widget* widget = &widgets[widgetIndex];
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_LAND_COST_INCREASE:
if (gameState.LandPrice < 200.00_GBP)
if (gameState.landPrice < 200.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::CostToBuyLand, gameState.LandPrice + 1.00_GBP);
ScenarioSetSetting::CostToBuyLand, gameState.landPrice + 1.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -1025,10 +1025,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_LAND_COST_DECREASE:
if (gameState.LandPrice > 5.00_GBP)
if (gameState.landPrice > 5.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::CostToBuyLand, gameState.LandPrice - 1.00_GBP);
ScenarioSetSetting::CostToBuyLand, gameState.landPrice - 1.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -1038,10 +1038,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_CONSTRUCTION_RIGHTS_COST_INCREASE:
if (gameState.ConstructionRightsPrice < 200.00_GBP)
if (gameState.constructionRightsPrice < 200.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::CostToBuyConstructionRights, gameState.ConstructionRightsPrice + 1.00_GBP);
ScenarioSetSetting::CostToBuyConstructionRights, gameState.constructionRightsPrice + 1.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -1051,10 +1051,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_CONSTRUCTION_RIGHTS_COST_DECREASE:
if (gameState.ConstructionRightsPrice > 5.00_GBP)
if (gameState.constructionRightsPrice > 5.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::CostToBuyConstructionRights, gameState.ConstructionRightsPrice - 1.00_GBP);
ScenarioSetSetting::CostToBuyConstructionRights, gameState.constructionRightsPrice - 1.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -1064,10 +1064,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_ENTRY_PRICE_INCREASE:
if (gameState.Park.EntranceFee < kMaxEntranceFee)
if (gameState.park.EntranceFee < kMaxEntranceFee)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::ParkChargeEntryFee, gameState.Park.EntranceFee + 1.00_GBP);
ScenarioSetSetting::ParkChargeEntryFee, gameState.park.EntranceFee + 1.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -1077,10 +1077,10 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
break;
case WIDX_ENTRY_PRICE_DECREASE:
if (gameState.Park.EntranceFee > 0.00_GBP)
if (gameState.park.EntranceFee > 0.00_GBP)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::ParkChargeEntryFee, gameState.Park.EntranceFee - 1.00_GBP);
ScenarioSetSetting::ParkChargeEntryFee, gameState.park.EntranceFee - 1.00_GBP);
GameActions::Execute(&scenarioSetSetting);
}
else
@@ -1103,9 +1103,9 @@ namespace OpenRCT2::Ui::Windows
{ windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() - 1,
colours[1], 0, Dropdown::Flag::StayOpen, 3, dropdownWidget->width() - 3);
if (gameState.Park.Flags & PARK_FLAGS_UNLOCK_ALL_PRICES)
if (gameState.park.Flags & PARK_FLAGS_UNLOCK_ALL_PRICES)
Dropdown::SetChecked(2, true);
else if (gameState.Park.Flags & PARK_FLAGS_PARK_FREE_ENTRY)
else if (gameState.park.Flags & PARK_FLAGS_PARK_FREE_ENTRY)
Dropdown::SetChecked(0, true);
else
Dropdown::SetChecked(1, true);
@@ -1144,8 +1144,8 @@ namespace OpenRCT2::Ui::Windows
{
SetPressedTab();
auto& gameState = GetGameState();
if (gameState.Park.Flags & PARK_FLAGS_NO_MONEY)
auto& gameState = getGameState();
if (gameState.park.Flags & PARK_FLAGS_NO_MONEY)
{
for (int32_t i = WIDX_LAND_COST; i <= WIDX_ENTRY_PRICE_DECREASE; i++)
widgets[i].type = WindowWidgetType::Empty;
@@ -1175,11 +1175,11 @@ namespace OpenRCT2::Ui::Windows
}
}
SetWidgetPressed(WIDX_FORBID_TREE_REMOVAL, gameState.Park.Flags & PARK_FLAGS_FORBID_TREE_REMOVAL);
SetWidgetPressed(WIDX_FORBID_LANDSCAPE_CHANGES, gameState.Park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES);
SetWidgetPressed(WIDX_FORBID_HIGH_CONSTRUCTION, gameState.Park.Flags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION);
SetWidgetPressed(WIDX_HARD_PARK_RATING, gameState.Park.Flags & PARK_FLAGS_DIFFICULT_PARK_RATING);
SetWidgetPressed(WIDX_HARD_GUEST_GENERATION, gameState.Park.Flags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION);
SetWidgetPressed(WIDX_FORBID_TREE_REMOVAL, gameState.park.Flags & PARK_FLAGS_FORBID_TREE_REMOVAL);
SetWidgetPressed(WIDX_FORBID_LANDSCAPE_CHANGES, gameState.park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES);
SetWidgetPressed(WIDX_FORBID_HIGH_CONSTRUCTION, gameState.park.Flags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION);
SetWidgetPressed(WIDX_HARD_PARK_RATING, gameState.park.Flags & PARK_FLAGS_DIFFICULT_PARK_RATING);
SetWidgetPressed(WIDX_HARD_GUEST_GENERATION, gameState.park.Flags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION);
widgets[WIDX_CLOSE].type = gLegacyScene == LegacyScene::scenarioEditor ? WindowWidgetType::Empty
: WindowWidgetType::CloseBox;
@@ -1194,7 +1194,7 @@ namespace OpenRCT2::Ui::Windows
WindowDrawWidgets(*this, dpi);
DrawTabImages(dpi);
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
const auto& landCostWidget = widgets[WIDX_LAND_COST];
if (landCostWidget.type != WindowWidgetType::Empty)
{
@@ -1205,7 +1205,7 @@ namespace OpenRCT2::Ui::Windows
// Cost to buy land value
screenCoords = windowPos + ScreenCoordsXY{ landCostWidget.left + 1, landCostWidget.top };
auto ft = Formatter();
ft.Add<money64>(gameState.LandPrice);
ft.Add<money64>(gameState.landPrice);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
@@ -1220,7 +1220,7 @@ namespace OpenRCT2::Ui::Windows
screenCoords = windowPos
+ ScreenCoordsXY{ constructionRightsCostWidget.left + 1, constructionRightsCostWidget.top };
auto ft = Formatter();
ft.Add<money64>(gameState.ConstructionRightsPrice);
ft.Add<money64>(gameState.constructionRightsPrice);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
@@ -1232,9 +1232,9 @@ namespace OpenRCT2::Ui::Windows
auto ft = Formatter();
// Pay for park and/or rides value
if (gameState.Park.Flags & PARK_FLAGS_UNLOCK_ALL_PRICES)
if (gameState.park.Flags & PARK_FLAGS_UNLOCK_ALL_PRICES)
ft.Add<StringId>(STR_PAID_ENTRY_PAID_RIDES);
else if (gameState.Park.Flags & PARK_FLAGS_PARK_FREE_ENTRY)
else if (gameState.park.Flags & PARK_FLAGS_PARK_FREE_ENTRY)
ft.Add<StringId>(STR_FREE_PARK_ENTER);
else
ft.Add<StringId>(STR_PAY_PARK_ENTER);
@@ -1252,7 +1252,7 @@ namespace OpenRCT2::Ui::Windows
// Entry price value
screenCoords = windowPos + ScreenCoordsXY{ entryPriceWidget.left + 1, entryPriceWidget.top };
auto ft = Formatter();
ft.Add<money64>(gameState.Park.EntranceFee);
ft.Add<money64>(gameState.park.EntranceFee);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
}
+30 -30
View File
@@ -230,7 +230,7 @@ namespace OpenRCT2::Ui::Windows
void SetDisabledTabs()
{
disabled_widgets = (GetGameState().Park.Flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN) ? (1uLL << WIDX_TAB_5) : 0;
disabled_widgets = (getGameState().park.Flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN) ? (1uLL << WIDX_TAB_5) : 0;
}
public:
@@ -333,17 +333,17 @@ namespace OpenRCT2::Ui::Windows
case WINDOW_FINANCES_PAGE_VALUE_GRAPH:
graphPageWidget = &widgets[WIDX_PAGE_BACKGROUND];
centredGraph = false;
_graphProps.series = GetGameState().Park.ValueHistory;
_graphProps.series = getGameState().park.ValueHistory;
break;
case WINDOW_FINANCES_PAGE_PROFIT_GRAPH:
graphPageWidget = &widgets[WIDX_PAGE_BACKGROUND];
centredGraph = true;
_graphProps.series = GetGameState().WeeklyProfitHistory;
_graphProps.series = getGameState().weeklyProfitHistory;
break;
case WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH:
graphPageWidget = &widgets[WIDX_PAGE_BACKGROUND];
centredGraph = true;
_graphProps.series = GetGameState().CashHistory;
_graphProps.series = getGameState().cashHistory;
break;
}
OnPrepareDrawGraph(graphPageWidget, centredGraph);
@@ -361,22 +361,22 @@ namespace OpenRCT2::Ui::Windows
break;
case WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH:
{
auto& gameState = GetGameState();
const auto cashLessLoan = gameState.Cash - gameState.BankLoan;
auto& gameState = getGameState();
const auto cashLessLoan = gameState.cash - gameState.bankLoan;
const auto fmt = cashLessLoan >= 0 ? STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_POSITIVE
: STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_NEGATIVE;
OnDrawGraph(dpi, cashLessLoan, fmt);
break;
}
case WINDOW_FINANCES_PAGE_VALUE_GRAPH:
OnDrawGraph(dpi, GetGameState().Park.Value, STR_FINANCES_PARK_VALUE);
OnDrawGraph(dpi, getGameState().park.Value, STR_FINANCES_PARK_VALUE);
break;
case WINDOW_FINANCES_PAGE_PROFIT_GRAPH:
{
auto& gameState = GetGameState();
const auto fmt = gameState.CurrentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE
auto& gameState = getGameState();
const auto fmt = gameState.currentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE
: STR_FINANCES_WEEKLY_PROFIT_LOSS;
OnDrawGraph(dpi, gameState.CurrentProfit, fmt);
OnDrawGraph(dpi, gameState.currentProfit, fmt);
break;
}
case WINDOW_FINANCES_PAGE_MARKETING:
@@ -422,7 +422,7 @@ namespace OpenRCT2::Ui::Windows
screenCoords.y += kTableCellHeight;
}
auto& gameState = GetGameState();
auto& gameState = getGameState();
// Expenditure / Income values for each month
auto currentMonthYear = GetDate().GetMonthsElapsed();
for (int32_t i = SummaryMaxAvailableMonth(); i >= 0; i--)
@@ -445,7 +445,7 @@ namespace OpenRCT2::Ui::Windows
money64 profit = 0;
for (int32_t j = 0; j < static_cast<int32_t>(ExpenditureType::Count); j++)
{
auto expenditure = gameState.ExpenditureTable[i][j];
auto expenditure = gameState.expenditureTable[i][j];
if (expenditure != 0)
{
profit += expenditure;
@@ -536,17 +536,17 @@ namespace OpenRCT2::Ui::Windows
void OnMouseDownSummary(WidgetIndex widgetIndex)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_LOAN_INCREASE:
{
// If loan can be increased, do so.
// If not, action shows error message.
auto newLoan = gameState.BankLoan + 1000.00_GBP;
if (gameState.BankLoan < gameState.MaxBankLoan)
auto newLoan = gameState.bankLoan + 1000.00_GBP;
if (gameState.bankLoan < gameState.maxBankLoan)
{
newLoan = std::min(gameState.MaxBankLoan, newLoan);
newLoan = std::min(gameState.maxBankLoan, newLoan);
}
auto gameAction = ParkSetLoanAction(newLoan);
GameActions::Execute(&gameAction);
@@ -557,10 +557,10 @@ namespace OpenRCT2::Ui::Windows
// If loan is positive, decrease it.
// If loan is negative, action shows error message.
// If loan is exactly 0, prevent error message.
if (gameState.BankLoan != 0)
if (gameState.bankLoan != 0)
{
auto newLoan = gameState.BankLoan - 1000.00_GBP;
if (gameState.BankLoan > 0)
auto newLoan = gameState.bankLoan - 1000.00_GBP;
if (gameState.bankLoan > 0)
{
newLoan = std::max(static_cast<money64>(0LL), newLoan);
}
@@ -579,7 +579,7 @@ namespace OpenRCT2::Ui::Windows
// drawing has completed.
auto ft = Formatter::Common();
ft.Increment(6);
ft.Add<money64>(GetGameState().BankLoan);
ft.Add<money64>(getGameState().bankLoan);
// Keep up with new months being added in the first two years.
if (GetDate().GetMonthsElapsed() != _lastPaintedMonth)
@@ -590,7 +590,7 @@ namespace OpenRCT2::Ui::Windows
{
auto titleBarBottom = widgets[WIDX_TITLE].bottom;
auto screenCoords = windowPos + ScreenCoordsXY{ 8, titleBarBottom + 37 };
auto& gameState = GetGameState();
auto& gameState = getGameState();
// Expenditure / Income heading
DrawTextBasic(
@@ -621,22 +621,22 @@ namespace OpenRCT2::Ui::Windows
// Loan and interest rate
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, titleBarBottom + 265 }, STR_FINANCES_SUMMARY_LOAN);
if (!(gameState.Park.Flags & PARK_FLAGS_RCT1_INTEREST))
if (!(gameState.park.Flags & PARK_FLAGS_RCT1_INTEREST))
{
auto ft = Formatter();
ft.Add<uint16_t>(gameState.BankLoanInterestRate);
ft.Add<uint16_t>(gameState.bankLoanInterestRate);
DrawTextBasic(
dpi, windowPos + ScreenCoordsXY{ 167, titleBarBottom + 265 }, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, ft);
}
// Current cash
auto ft = Formatter();
ft.Add<money64>(gameState.Cash);
StringId stringId = gameState.Cash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL;
ft.Add<money64>(gameState.cash);
StringId stringId = gameState.cash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL;
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, titleBarBottom + 280 }, stringId, ft);
// Objective related financial information
if (gameState.ScenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME)
if (gameState.scenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME)
{
auto lastMonthProfit = FinanceGetLastMonthShopProfit();
ft = Formatter();
@@ -649,10 +649,10 @@ namespace OpenRCT2::Ui::Windows
{
// Park value and company value
ft = Formatter();
ft.Add<money64>(gameState.Park.Value);
ft.Add<money64>(gameState.park.Value);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 280, titleBarBottom + 265 }, STR_PARK_VALUE_LABEL, ft);
ft = Formatter();
ft.Add<money64>(gameState.CompanyValue);
ft.Add<money64>(gameState.companyValue);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 280, titleBarBottom + 280 }, STR_COMPANY_VALUE_LABEL, ft);
}
}
@@ -677,7 +677,7 @@ namespace OpenRCT2::Ui::Windows
void OnPrepareDrawMarketing()
{
// Count number of active campaigns
int32_t numActiveCampaigns = static_cast<int32_t>(GetGameState().MarketingCampaigns.size());
int32_t numActiveCampaigns = static_cast<int32_t>(getGameState().marketingCampaigns.size());
int32_t y = std::max(1, numActiveCampaigns) * kListRowHeight + 92;
// Update group box positions
@@ -739,7 +739,7 @@ namespace OpenRCT2::Ui::Windows
break;
default:
{
auto parkName = GetGameState().Park.Name.c_str();
auto parkName = getGameState().park.Name.c_str();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(parkName);
}
+7 -7
View File
@@ -532,7 +532,7 @@ namespace OpenRCT2::Ui::Windows
+ ScreenCoordsXY{ widgets[WIDX_CONSTRUCT].midX(), widgets[WIDX_CONSTRUCT].bottom - 12 };
if (_windowFootpathCost != kMoney64Undefined)
{
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
auto ft = Formatter();
ft.Add<money64>(_windowFootpathCost);
@@ -670,7 +670,7 @@ namespace OpenRCT2::Ui::Windows
uint32_t numPathTypes = 0;
// If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor
bool showEditorPaths = (gLegacyScene == LegacyScene::scenarioEditor || GetGameState().Cheats.sandboxMode);
bool showEditorPaths = (gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode);
_dropdownEntries.clear();
std::optional<size_t> defaultIndex;
@@ -688,14 +688,14 @@ namespace OpenRCT2::Ui::Windows
}
// If regular paths can be used as queue, only hide the path if we’re _not_ looking at a queue,
// but the path surface is one.
if (GetGameState().Cheats.allowRegularPathAsQueue && !showQueues
if (getGameState().cheats.allowRegularPathAsQueue && !showQueues
&& ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0))
{
continue;
}
// If the cheat is disabled, hide queues from the regular path view and vice versa.
else if (
!GetGameState().Cheats.allowRegularPathAsQueue
!getGameState().cheats.allowRegularPathAsQueue
&& showQueues != ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0))
{
continue;
@@ -821,7 +821,7 @@ namespace OpenRCT2::Ui::Windows
auto info = GetMapCoordinatesFromPos(screenCoords, interactionFlags);
if (info.interactionType != ViewportInteractionItem::None)
{
const bool allowInvalidHeights = GetGameState().Cheats.allowTrackPlaceInvalidHeights;
const bool allowInvalidHeights = getGameState().cheats.allowTrackPlaceInvalidHeights;
const auto heightStep = kCoordsZStep * (!allowInvalidHeights ? 2 : 1);
_footpathPlaceCtrlZ = floor2(info.Element->GetBaseZ(), heightStep);
@@ -854,7 +854,7 @@ namespace OpenRCT2::Ui::Windows
_footpathPlaceShiftZ = mainWnd->viewport->zoom.ApplyTo(_footpathPlaceShiftZ);
}
const bool allowInvalidHeights = GetGameState().Cheats.allowTrackPlaceInvalidHeights;
const bool allowInvalidHeights = getGameState().cheats.allowTrackPlaceInvalidHeights;
const auto heightStep = kCoordsZStep * (!allowInvalidHeights ? 2 : 1);
_footpathPlaceShiftZ = floor2(_footpathPlaceShiftZ, heightStep);
@@ -1592,7 +1592,7 @@ namespace OpenRCT2::Ui::Windows
void KeyboardShortcutDemolishCurrent()
{
if (IsWidgetDisabled(WIDX_REMOVE) || widgets[WIDX_REMOVE].type == WindowWidgetType::Empty
|| (!GetGameState().Cheats.buildInPauseMode && GameIsPaused()))
|| (!getGameState().cheats.buildInPauseMode && GameIsPaused()))
{
return;
}
+18 -18
View File
@@ -97,19 +97,19 @@ namespace OpenRCT2::Ui::Windows
// Figure out how much line height we have to work with.
uint32_t line_height = FontGetLineHeight(FontStyle::Medium);
auto& gameState = GetGameState();
auto& gameState = getGameState();
// Draw money
if (!(gameState.Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(gameState.park.Flags & PARK_FLAGS_NO_MONEY))
{
const auto& widget = widgets[WIDX_MONEY];
auto screenCoords = ScreenCoordsXY{ windowPos.x + widget.midX(),
windowPos.y + widget.midY() - (line_height == 10 ? 5 : 6) };
auto colour = GetHoverWidgetColour(WIDX_MONEY);
StringId stringId = gameState.Cash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH;
StringId stringId = gameState.cash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH;
auto ft = Formatter();
ft.Add<money64>(gameState.Cash);
ft.Add<money64>(gameState.cash);
DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
}
@@ -130,11 +130,11 @@ namespace OpenRCT2::Ui::Windows
const auto& widget = widgets[WIDX_GUESTS];
auto screenCoords = ScreenCoordsXY{ windowPos.x + widget.midX(), windowPos.y + widget.midY() - 6 };
StringId stringId = gameState.NumGuestsInPark == 1 ? _guestCountFormatsSingular[gameState.GuestChangeModifier]
: _guestCountFormats[gameState.GuestChangeModifier];
StringId stringId = gameState.numGuestsInPark == 1 ? _guestCountFormatsSingular[gameState.guestChangeModifier]
: _guestCountFormats[gameState.guestChangeModifier];
auto colour = GetHoverWidgetColour(WIDX_GUESTS);
auto ft = Formatter();
ft.Add<uint32_t>(gameState.NumGuestsInPark);
ft.Add<uint32_t>(gameState.numGuestsInPark);
DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
}
@@ -143,7 +143,7 @@ namespace OpenRCT2::Ui::Windows
const auto& widget = widgets[WIDX_PARK_RATING];
auto screenCoords = windowPos + ScreenCoordsXY{ widget.left + 11, widget.midY() - 5 };
DrawParkRating(dpi, colours[3].colour, screenCoords, std::max(10, ((gameState.Park.Rating / 4) * 263) / 256));
DrawParkRating(dpi, colours[3].colour, screenCoords, std::max(10, ((gameState.park.Rating / 4) * 263) / 256));
}
}
@@ -199,7 +199,7 @@ namespace OpenRCT2::Ui::Windows
// Temperature
screenCoords = { windowPos.x + rightPanelWidget.left + 15, static_cast<int32_t>(screenCoords.y + line_height + 1) };
int32_t temperature = GetGameState().WeatherCurrent.temperature;
int32_t temperature = getGameState().weatherCurrent.temperature;
StringId format = STR_CELSIUS_VALUE;
if (Config::Get().general.TemperatureFormat == TemperatureUnit::Fahrenheit)
{
@@ -212,14 +212,14 @@ namespace OpenRCT2::Ui::Windows
screenCoords.x += 30;
// Current weather
auto currentWeatherSpriteId = ClimateGetWeatherSpriteId(GetGameState().WeatherCurrent.weatherType);
auto currentWeatherSpriteId = ClimateGetWeatherSpriteId(getGameState().weatherCurrent.weatherType);
GfxDrawSprite(dpi, ImageId(currentWeatherSpriteId), screenCoords);
// Next weather
auto nextWeatherSpriteId = ClimateGetWeatherSpriteId(GetGameState().WeatherNext.weatherType);
auto nextWeatherSpriteId = ClimateGetWeatherSpriteId(getGameState().weatherNext.weatherType);
if (currentWeatherSpriteId != nextWeatherSpriteId)
{
if (GetGameState().WeatherUpdateTimer < 960)
if (getGameState().weatherUpdateTimer < 960)
{
GfxDrawSprite(dpi, ImageId(SPR_NEXT_WEATHER), screenCoords + ScreenCoordsXY{ 27, 5 });
GfxDrawSprite(dpi, ImageId(nextWeatherSpriteId), screenCoords + ScreenCoordsXY{ 40, 0 });
@@ -432,7 +432,7 @@ namespace OpenRCT2::Ui::Windows
{
case WIDX_LEFT_OUTSET:
case WIDX_MONEY:
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
ContextOpenWindow(WindowClass::Finances);
break;
case WIDX_GUESTS:
@@ -481,17 +481,17 @@ namespace OpenRCT2::Ui::Windows
OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
auto ft = Formatter();
switch (widgetIndex)
{
case WIDX_MONEY:
ft.Add<money64>(gameState.CurrentProfit);
ft.Add<money64>(gameState.Park.Value);
ft.Add<money64>(gameState.currentProfit);
ft.Add<money64>(gameState.park.Value);
break;
case WIDX_PARK_RATING:
ft.Add<int16_t>(gameState.Park.Rating);
ft.Add<int16_t>(gameState.park.Rating);
break;
}
return { fallback, ft };
@@ -514,7 +514,7 @@ namespace OpenRCT2::Ui::Windows
+ 1;
// Reposition left widgets in accordance with line height... depending on whether there is money in play.
if (GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY)
if (getGameState().park.Flags & PARK_FLAGS_NO_MONEY)
{
widgets[WIDX_MONEY].type = WindowWidgetType::Empty;
widgets[WIDX_GUESTS].top = 1;
+4 -4
View File
@@ -493,7 +493,7 @@ namespace OpenRCT2::Ui::Windows
if (!WidgetIsDisabled(*this, WIDX_PICKUP))
Invalidate();
}
if (GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY)
if (getGameState().park.Flags & PARK_FLAGS_NO_MONEY)
{
newDisabledWidgets |= (1uLL << WIDX_TAB_4); // Disable finance tab if no money
}
@@ -1135,7 +1135,7 @@ namespace OpenRCT2::Ui::Windows
int32_t guestEntryTime = peep->GetParkEntryTime();
if (guestEntryTime != -1)
{
int32_t timeInPark = (GetGameState().CurrentTicks - guestEntryTime) >> 11;
int32_t timeInPark = (getGameState().currentTicks - guestEntryTime) >> 11;
auto ft = Formatter();
ft.Add<uint16_t>(timeInPark & 0xFFFF);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TIME_IN_PARK, ft);
@@ -1219,7 +1219,7 @@ namespace OpenRCT2::Ui::Windows
}
// Every 2048 ticks do a full window_invalidate
int32_t numTicks = GetGameState().CurrentTicks - guest->GetParkEntryTime();
int32_t numTicks = getGameState().currentTicks - guest->GetParkEntryTime();
if (!(numTicks & 0x7FF))
Invalidate();
@@ -1606,7 +1606,7 @@ namespace OpenRCT2::Ui::Windows
std::pair<ImageId, Formatter> InventoryFormatItem(Guest& guest, ShopItem item) const
{
auto parkName = GetGameState().Park.Name.c_str();
auto parkName = getGameState().park.Name.c_str();
// Default item image
auto& itemDesc = GetShopItemDescriptor(item);
+3 -3
View File
@@ -800,7 +800,7 @@ namespace OpenRCT2::Ui::Windows
bool IsRefreshOfGroupsRequired()
{
uint32_t tick256 = floor2(GetGameState().CurrentTicks, 256);
uint32_t tick256 = floor2(getGameState().currentTicks, 256);
if (_selectedView == _lastFindGroupsSelectedView)
{
if (_lastFindGroupsWait != 0 || _lastFindGroupsTick == tick256)
@@ -828,7 +828,7 @@ namespace OpenRCT2::Ui::Windows
void RefreshGroups()
{
_lastFindGroupsTick = floor2(GetGameState().CurrentTicks, 256);
_lastFindGroupsTick = floor2(getGameState().currentTicks, 256);
_lastFindGroupsSelectedView = _selectedView;
_lastFindGroupsWait = 320;
_groups.clear();
@@ -946,7 +946,7 @@ namespace OpenRCT2::Ui::Windows
static GuestItem::CompareFunc GetGuestCompareFunc()
{
return GetGameState().Park.Flags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES ? CompareGuestItem<true>
return getGameState().park.Flags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES ? CompareGuestItem<true>
: CompareGuestItem<false>;
}
};
+1 -1
View File
@@ -280,7 +280,7 @@ namespace OpenRCT2::Ui::Windows
screenCoords = { windowPos.x + previewWidget->midX(), windowPos.y + previewWidget->bottom + 5 };
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
// Draw raise cost amount
if (_landToolRaiseCost != kMoney64Undefined && _landToolRaiseCost != 0)
+2 -2
View File
@@ -98,7 +98,7 @@ namespace OpenRCT2::Ui::Windows
bool IsOwnershipMode() const
{
return isInEditorMode() != 0 || GetGameState().Cheats.sandboxMode;
return isInEditorMode() != 0 || getGameState().cheats.sandboxMode;
}
void SwitchToMode(LandRightsMode mode)
@@ -408,7 +408,7 @@ namespace OpenRCT2::Ui::Windows
// Draw cost amount
if (_landRightsCost != kMoney64Undefined && _landRightsCost != 0
&& !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
&& !(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
auto ft = Formatter();
ft.Add<money64>(_landRightsCost);
+12 -12
View File
@@ -57,7 +57,7 @@ namespace OpenRCT2::Ui::Windows
static int32_t getPracticalMapSize()
{
// Take non-square maps into account
return std::max(GetGameState().MapSize.x, GetGameState().MapSize.y) - 2;
return std::max(getGameState().mapSize.x, getGameState().mapSize.y) - 2;
}
static int32_t getPracticalMapSizeBig()
{
@@ -74,7 +74,7 @@ namespace OpenRCT2::Ui::Windows
static bool isEditorOrSandbox()
{
return gLegacyScene == LegacyScene::scenarioEditor || GetGameState().Cheats.sandboxMode;
return gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode;
}
static constexpr StringId WINDOW_TITLE = STR_MAP_LABEL;
@@ -254,8 +254,8 @@ namespace OpenRCT2::Ui::Windows
CentreMapOnViewPoint();
FootpathSelectDefault();
auto& gameState = GetGameState();
_mapWidthAndHeightLinked = gameState.MapSize.x == gameState.MapSize.y;
auto& gameState = getGameState();
_mapWidthAndHeightLinked = gameState.mapSize.x == gameState.mapSize.y;
// Reset land rights tool size
_landRightsToolSize = 1;
@@ -511,7 +511,7 @@ namespace OpenRCT2::Ui::Windows
size = std::clamp(
size, static_cast<int>(kMinimumMapSizeTechnical), static_cast<int>(kMaximumMapSizeTechnical));
TileCoordsXY newMapSize = GetGameState().MapSize;
TileCoordsXY newMapSize = getGameState().mapSize;
if (_resizeDirection != ResizeDirection::X)
newMapSize.y = size;
if (_resizeDirection != ResizeDirection::Y)
@@ -615,8 +615,8 @@ namespace OpenRCT2::Ui::Windows
pressed_widgets |= (1uLL << WIDX_MAP_GENERATOR);
// Set disabled widgets
auto& gameState = GetGameState();
SetWidgetDisabled(WIDX_MAP_SIZE_LINK, gameState.MapSize.x != gameState.MapSize.y);
auto& gameState = getGameState();
SetWidgetDisabled(WIDX_MAP_SIZE_LINK, gameState.mapSize.x != gameState.mapSize.y);
// Resize widgets to window size
ResizeFrameWithPage();
@@ -764,7 +764,7 @@ namespace OpenRCT2::Ui::Windows
void IncreaseMapSize()
{
auto newMapSize = GetGameState().MapSize;
auto newMapSize = getGameState().mapSize;
if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::Y)
newMapSize.y++;
if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::X)
@@ -776,7 +776,7 @@ namespace OpenRCT2::Ui::Windows
void DecreaseMapSize()
{
auto newMapSize = GetGameState().MapSize;
auto newMapSize = getGameState().mapSize;
if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::Y)
newMapSize.y--;
if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::X)
@@ -1112,10 +1112,10 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_MAP_SIZE_SPINNER_X_DOWN].type = WindowWidgetType::Button;
// Push width (Y) and height (X) to the common formatter arguments for the map size spinners to use
auto& gameState = GetGameState();
auto& gameState = getGameState();
auto ft = Formatter::Common();
ft.Add<uint16_t>(gameState.MapSize.y - 2);
ft.Add<uint16_t>(gameState.MapSize.x - 2);
ft.Add<uint16_t>(gameState.mapSize.y - 2);
ft.Add<uint16_t>(gameState.mapSize.x - 2);
}
void InputMapSize(WidgetIndex callingWidget)
+4 -4
View File
@@ -624,7 +624,7 @@ namespace OpenRCT2::Ui::Windows
auto currentRideEntry = GetRideEntryByIndex(rideEntryIndex);
// Skip if vehicle type is not invented yet
if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.ignoreResearchStatus)
if (!RideEntryIsInvented(rideEntryIndex) && !getGameState().cheats.ignoreResearchStatus)
{
continue;
}
@@ -686,7 +686,7 @@ namespace OpenRCT2::Ui::Windows
for (auto rideEntryIndex : rideEntries)
{
// Skip if vehicle type is not invented yet
if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.ignoreResearchStatus)
if (!RideEntryIsInvented(rideEntryIndex) && !getGameState().cheats.ignoreResearchStatus)
continue;
// Ride entries
@@ -852,7 +852,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP].type = WindowWidgetType::Groupbox;
widgets[WIDX_LAST_DEVELOPMENT_GROUP].type = WindowWidgetType::Groupbox;
widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WindowWidgetType::FlatBtn;
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
widgets[WIDX_RESEARCH_FUNDING_BUTTON].type = WindowWidgetType::FlatBtn;
newWidth = 300;
@@ -962,7 +962,7 @@ namespace OpenRCT2::Ui::Windows
DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ 0, 51 }, designCountStringId, ft);
// Price
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
// Get price of ride
auto startPieceId = GetRideTypeDescriptor(item.Type).StartTrackPiece;
+6 -6
View File
@@ -94,14 +94,14 @@ namespace OpenRCT2::Ui::Windows
size_t j = _pressedNewsItemIndex;
_pressedNewsItemIndex = -1;
auto& gameState = GetGameState();
auto& gameState = getGameState();
if (j >= gameState.NewsItems.GetArchived().size())
if (j >= gameState.newsItems.GetArchived().size())
{
return;
}
const auto& newsItem = gameState.NewsItems.GetArchived()[j];
const auto& newsItem = gameState.newsItems.GetArchived()[j];
if (newsItem.HasButton())
{
return;
@@ -124,7 +124,7 @@ namespace OpenRCT2::Ui::Windows
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
{
int32_t scrollHeight = static_cast<int32_t>(GetGameState().NewsItems.GetArchived().size()) * CalculateItemHeight();
int32_t scrollHeight = static_cast<int32_t>(getGameState().newsItems.GetArchived().size()) * CalculateItemHeight();
return { WW, scrollHeight };
}
@@ -134,7 +134,7 @@ namespace OpenRCT2::Ui::Windows
int32_t i = 0;
int32_t buttonIndex = 0;
auto mutableScreenCoords = screenCoords;
for (const auto& newsItem : GetGameState().NewsItems.GetArchived())
for (const auto& newsItem : getGameState().newsItems.GetArchived())
{
if (mutableScreenCoords.y < itemHeight)
{
@@ -181,7 +181,7 @@ namespace OpenRCT2::Ui::Windows
int32_t y = 0;
int32_t i = 0;
for (const auto& newsItem : GetGameState().NewsItems.GetArchived())
for (const auto& newsItem : getGameState().newsItems.GetArchived())
{
if (y >= dpi.y + dpi.height)
break;
+40 -40
View File
@@ -407,12 +407,12 @@ namespace OpenRCT2::Ui::Windows
void SetDisabledTabs()
{
// Disable price tab if money is disabled
disabled_widgets = (GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) ? (1uLL << WIDX_TAB_4) : 0;
disabled_widgets = (getGameState().park.Flags & PARK_FLAGS_NO_MONEY) ? (1uLL << WIDX_TAB_4) : 0;
}
void PrepareWindowTitleText()
{
auto parkName = GetGameState().Park.Name.c_str();
auto parkName = getGameState().park.Name.c_str();
auto ft = Formatter::Common();
ft.Add<StringId>(STR_STRING);
@@ -432,7 +432,7 @@ namespace OpenRCT2::Ui::Windows
break;
case WIDX_RENAME:
{
auto& park = GetGameState().Park;
auto& park = getGameState().park;
WindowTextInputRawOpen(
this, WIDX_RENAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, {}, park.Name.c_str(), kUserStringMaxLength);
break;
@@ -465,7 +465,7 @@ namespace OpenRCT2::Ui::Windows
WindowDropdownShowText(
{ windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1], 0, 2);
if (GetGameState().Park.IsOpen())
if (getGameState().park.IsOpen())
{
gDropdownDefaultIndex = 0;
Dropdown::SetChecked(1, true);
@@ -513,7 +513,7 @@ namespace OpenRCT2::Ui::Windows
void OnPrepareDrawEntrance()
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
SetWidgets(_pagedWidgets[page]);
InitScrollWidgets();
@@ -521,13 +521,13 @@ namespace OpenRCT2::Ui::Windows
// Set open / close park button state
{
auto parkName = gameState.Park.Name.c_str();
auto parkName = gameState.park.Name.c_str();
auto ft = Formatter::Common();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(parkName);
}
const bool parkIsOpen = gameState.Park.IsOpen();
const bool parkIsOpen = gameState.park.IsOpen();
widgets[WIDX_OPEN_OR_CLOSE].image = ImageId(parkIsOpen ? SPR_OPEN : SPR_CLOSED);
const auto closeLightImage = SPR_G2_RCT1_CLOSE_BUTTON_0 + !parkIsOpen * 2
+ WidgetIsPressed(*this, WIDX_CLOSE_LIGHT);
@@ -536,13 +536,13 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_OPEN_LIGHT].image = ImageId(openLightImage);
// Only allow closing of park for guest / rating objective
if (gameState.ScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING)
if (gameState.scenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING)
disabled_widgets |= (1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT);
else
disabled_widgets &= ~((1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT));
// Only allow purchase of land when there is money
if (gameState.Park.Flags & PARK_FLAGS_NO_MONEY)
if (gameState.park.Flags & PARK_FLAGS_NO_MONEY)
widgets[WIDX_BUY_LAND_RIGHTS].type = WindowWidgetType::Empty;
else
widgets[WIDX_BUY_LAND_RIGHTS].type = WindowWidgetType::FlatBtn;
@@ -561,7 +561,7 @@ namespace OpenRCT2::Ui::Windows
if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_PARK)
{
widgets[WIDX_OPEN_OR_CLOSE].type = WindowWidgetType::Empty;
if (gameState.ScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING)
if (gameState.scenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING)
{
widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::FlatBtn;
widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::FlatBtn;
@@ -614,7 +614,7 @@ namespace OpenRCT2::Ui::Windows
// Draw park closed / open label
auto ft = Formatter();
ft.Add<StringId>(GetGameState().Park.IsOpen() ? STR_PARK_OPEN : STR_PARK_CLOSED);
ft.Add<StringId>(getGameState().park.IsOpen() ? STR_PARK_OPEN : STR_PARK_CLOSED);
auto* labelWidget = &widgets[WIDX_STATUS];
DrawTextEllipsised(
@@ -627,12 +627,12 @@ namespace OpenRCT2::Ui::Windows
if (page != WINDOW_PARK_PAGE_ENTRANCE)
return;
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
std::optional<Focus> newFocus = std::nullopt;
if (!gameState.Park.Entrances.empty())
if (!gameState.park.Entrances.empty())
{
const auto& entrance = gameState.Park.Entrances[0];
const auto& entrance = gameState.park.Entrances[0];
newFocus = Focus(CoordsXYZ{ entrance.x + 16, entrance.y + 16, entrance.z + 32 });
}
@@ -700,7 +700,7 @@ namespace OpenRCT2::Ui::Windows
_ratingProps.min = 0;
_ratingProps.max = 1000;
_ratingProps.series = GetGameState().Park.RatingHistory;
_ratingProps.series = getGameState().park.RatingHistory;
const Widget* background = &widgets[WIDX_PAGE_BACKGROUND];
_ratingGraphBounds = { windowPos + ScreenCoordsXY{ background->left + 4, background->top + 15 },
windowPos + ScreenCoordsXY{ background->right - 4, background->bottom - 4 } };
@@ -724,7 +724,7 @@ namespace OpenRCT2::Ui::Windows
// Current value
Formatter ft;
ft.Add<uint16_t>(GetGameState().Park.Rating);
ft.Add<uint16_t>(getGameState().park.Rating);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft);
// Graph border
@@ -767,8 +767,8 @@ namespace OpenRCT2::Ui::Windows
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7);
AnchorBorderWidgets();
const auto& gameState = GetGameState();
_guestProps.series = gameState.GuestsInParkHistory;
const auto& gameState = getGameState();
_guestProps.series = gameState.guestsInParkHistory;
const Widget* background = &widgets[WIDX_PAGE_BACKGROUND];
_guestGraphBounds = { windowPos + ScreenCoordsXY{ background->left + 4, background->top + 15 },
windowPos + ScreenCoordsXY{ background->right - 4, background->bottom - 4 } };
@@ -776,9 +776,9 @@ namespace OpenRCT2::Ui::Windows
// Calculate Y axis max and min
_guestProps.min = 0;
_guestProps.max = 5000;
for (size_t i = 0; i < std::size(gameState.GuestsInParkHistory); i++)
for (size_t i = 0; i < std::size(gameState.guestsInParkHistory); i++)
{
auto value = gameState.GuestsInParkHistory[i];
auto value = gameState.guestsInParkHistory[i];
if (value == kGuestsInParkHistoryUndefined)
continue;
while (value > _guestProps.max)
@@ -804,7 +804,7 @@ namespace OpenRCT2::Ui::Windows
// Current value
Formatter ft;
ft.Add<uint32_t>(GetGameState().NumGuestsInPark);
ft.Add<uint32_t>(getGameState().numGuestsInPark);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft);
// Graph border
@@ -829,19 +829,19 @@ namespace OpenRCT2::Ui::Windows
void OnMouseDownPrice(WidgetIndex widgetIndex)
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
switch (widgetIndex)
{
case WIDX_INCREASE_PRICE:
{
const auto newFee = std::min(kMaxEntranceFee, gameState.Park.EntranceFee + 1.00_GBP);
const auto newFee = std::min(kMaxEntranceFee, gameState.park.EntranceFee + 1.00_GBP);
auto gameAction = ParkSetEntranceFeeAction(newFee);
GameActions::Execute(&gameAction);
break;
}
case WIDX_DECREASE_PRICE:
{
const auto newFee = std::max(0.00_GBP, gameState.Park.EntranceFee - 1.00_GBP);
const auto newFee = std::max(0.00_GBP, gameState.park.EntranceFee - 1.00_GBP);
auto gameAction = ParkSetEntranceFeeAction(newFee);
GameActions::Execute(&gameAction);
break;
@@ -878,7 +878,7 @@ namespace OpenRCT2::Ui::Windows
}
// If the entry price is locked at free, disable the widget, unless the unlock_all_prices cheat is active.
if ((GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) || !Park::EntranceFeeUnlocked())
if ((getGameState().park.Flags & PARK_FLAGS_NO_MONEY) || !Park::EntranceFeeUnlocked())
{
widgets[WIDX_PRICE].type = WindowWidgetType::LabelCentred;
widgets[WIDX_INCREASE_PRICE].type = WindowWidgetType::Empty;
@@ -903,7 +903,7 @@ namespace OpenRCT2::Ui::Windows
auto screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 30 };
auto ft = Formatter();
ft.Add<money64>(GetGameState().TotalIncomeFromAdmissions);
ft.Add<money64>(getGameState().totalIncomeFromAdmissions);
DrawTextBasic(dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft);
money64 parkEntranceFee = Park::GetEntranceFee();
@@ -964,9 +964,9 @@ namespace OpenRCT2::Ui::Windows
auto screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 };
auto& gameState = GetGameState();
auto& gameState = getGameState();
// Draw park size
auto parkSize = gameState.Park.Size * 10;
auto parkSize = gameState.park.Size * 10;
auto stringIndex = STR_PARK_SIZE_METRIC_LABEL;
if (Config::Get().general.MeasurementFormat == MeasurementFormat::Imperial)
{
@@ -998,12 +998,12 @@ namespace OpenRCT2::Ui::Windows
// Draw number of guests in park
ft = Formatter();
ft.Add<uint32_t>(gameState.NumGuestsInPark);
ft.Add<uint32_t>(gameState.numGuestsInPark);
DrawTextBasic(dpi, screenCoords, STR_GUESTS_IN_PARK_LABEL, ft);
screenCoords.y += kListRowHeight;
ft = Formatter();
ft.Add<uint32_t>(gameState.TotalAdmissions);
ft.Add<uint32_t>(gameState.totalAdmissions);
DrawTextBasic(dpi, screenCoords, STR_TOTAL_ADMISSIONS, ft);
}
#pragma endregion
@@ -1042,7 +1042,7 @@ namespace OpenRCT2::Ui::Windows
if (widgetIndex == WIDX_ENTER_NAME && !text.empty())
{
std::string strText(text);
ScenarioSuccessSubmitName(GetGameState(), strText.c_str());
ScenarioSuccessSubmitName(getGameState(), strText.c_str());
Invalidate();
}
}
@@ -1070,7 +1070,7 @@ namespace OpenRCT2::Ui::Windows
PrepareWindowTitleText();
// Show name input button on scenario completion.
if (GetGameState().Park.Flags & PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT)
if (getGameState().park.Flags & PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT)
{
widgets[WIDX_ENTER_NAME].type = WindowWidgetType::Button;
widgets[WIDX_ENTER_NAME].top = height - 19;
@@ -1085,7 +1085,7 @@ namespace OpenRCT2::Ui::Windows
void OnDrawObjective(DrawPixelInfo& dpi)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
DrawWidgets(dpi);
DrawTabImages(dpi);
@@ -1094,7 +1094,7 @@ namespace OpenRCT2::Ui::Windows
+ ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 7 };
auto ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(gameState.ScenarioDetails.c_str());
ft.Add<const char*>(gameState.scenarioDetails.c_str());
screenCoords.y += DrawTextWrapped(dpi, screenCoords, 222, STR_BLACK_STRING, ft);
screenCoords.y += 5;
@@ -1104,15 +1104,15 @@ namespace OpenRCT2::Ui::Windows
// Objective
ft = Formatter();
formatObjective(ft, gameState.ScenarioObjective);
formatObjective(ft, gameState.scenarioObjective);
screenCoords.y += DrawTextWrapped(dpi, screenCoords, 221, kObjectiveNames[gameState.ScenarioObjective.Type], ft);
screenCoords.y += DrawTextWrapped(dpi, screenCoords, 221, kObjectiveNames[gameState.scenarioObjective.Type], ft);
screenCoords.y += 5;
// Objective outcome
if (gameState.ScenarioCompletedCompanyValue != kMoney64Undefined)
if (gameState.scenarioCompletedCompanyValue != kMoney64Undefined)
{
if (gameState.ScenarioCompletedCompanyValue == kCompanyValueOnFailedObjective)
if (gameState.scenarioCompletedCompanyValue == kCompanyValueOnFailedObjective)
{
// Objective failed
DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_FAILED);
@@ -1121,7 +1121,7 @@ namespace OpenRCT2::Ui::Windows
{
// Objective completed
ft = Formatter();
ft.Add<money64>(gameState.ScenarioCompletedCompanyValue);
ft.Add<money64>(gameState.scenarioCompletedCompanyValue);
DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_ACHIEVED, ft);
}
}
@@ -1157,7 +1157,7 @@ namespace OpenRCT2::Ui::Windows
auto screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 };
auto& currentAwards = GetGameState().CurrentAwards;
auto& currentAwards = getGameState().currentAwards;
for (const auto& award : currentAwards)
{
@@ -81,7 +81,7 @@ namespace OpenRCT2::Ui::Windows
auto currentRide = GetRide(rideId);
if (currentRide != nullptr)
{
auto stringId = (GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) ? STR_REFURBISH_RIDE_ID_NO_MONEY
auto stringId = (getGameState().park.Flags & PARK_FLAGS_NO_MONEY) ? STR_REFURBISH_RIDE_ID_NO_MONEY
: STR_REFURBISH_RIDE_ID_MONEY;
auto ft = Formatter();
currentRide->formatNameTo(ft);
+42 -42
View File
@@ -326,26 +326,26 @@ namespace OpenRCT2::Ui::Windows
void WindowResearchDevelopmentMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex)
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP);
if (widgetIndex == (WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset))
{
News::OpenSubject(News::ItemType::Research, gameState.ResearchLastItem->rawValue);
News::OpenSubject(News::ItemType::Research, gameState.researchLastItem->rawValue);
}
}
void WindowResearchDevelopmentPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex)
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
// Offset the widget index to allow reuse from other windows
auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP);
w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].type = WindowWidgetType::Empty;
// Display button to link to the last development, if there is one
if (gameState.ResearchLastItem.has_value())
if (gameState.researchLastItem.has_value())
{
auto type = gameState.ResearchLastItem->type;
auto type = gameState.researchLastItem->type;
w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].type = WindowWidgetType::FlatBtn;
const auto image = type == Research::EntryType::Ride ? SPR_NEW_RIDE : SPR_NEW_SCENERY;
w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].image = ImageId(image);
@@ -354,13 +354,13 @@ namespace OpenRCT2::Ui::Windows
void WindowResearchDevelopmentDraw(WindowBase* w, DrawPixelInfo& dpi, WidgetIndex baseWidgetIndex)
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP);
auto screenCoords = w->windowPos
+ ScreenCoordsXY{ 10, w->widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP + widgetOffset].top + 12 };
if (gameState.ResearchProgressStage == RESEARCH_STAGE_FINISHED_ALL)
if (gameState.researchProgressStage == RESEARCH_STAGE_FINISHED_ALL)
{
// Research type
auto ft = Formatter();
@@ -384,53 +384,53 @@ namespace OpenRCT2::Ui::Windows
// Research type
auto ft = Formatter();
StringId label = STR_RESEARCH_TYPE_LABEL;
if (gameState.ResearchProgressStage == RESEARCH_STAGE_INITIAL_RESEARCH)
if (gameState.researchProgressStage == RESEARCH_STAGE_INITIAL_RESEARCH)
{
ft.Add<StringId>(STR_RESEARCH_UNKNOWN);
}
else if (gameState.ResearchProgressStage == RESEARCH_STAGE_DESIGNING)
else if (gameState.researchProgressStage == RESEARCH_STAGE_DESIGNING)
{
ft.Add<StringId>(gameState.ResearchNextItem->GetCategoryName());
ft.Add<StringId>(gameState.researchNextItem->GetCategoryName());
}
else if (gameState.ResearchNextItem->type == Research::EntryType::Ride)
else if (gameState.researchNextItem->type == Research::EntryType::Ride)
{
const auto& rtd = GetRideTypeDescriptor(gameState.ResearchNextItem->baseRideType);
const auto& rtd = GetRideTypeDescriptor(gameState.researchNextItem->baseRideType);
if (rtd.HasFlag(RtdFlag::listVehiclesSeparately))
{
ft.Add<StringId>(gameState.ResearchNextItem->GetName());
ft.Add<StringId>(gameState.researchNextItem->GetName());
}
else if (gameState.ResearchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
else if (gameState.researchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
{
ft.Add<StringId>(rtd.Naming.Name);
}
else
{
ft.Add<StringId>(gameState.ResearchNextItem->GetName());
ft.Add<StringId>(gameState.researchNextItem->GetName());
ft.Add<StringId>(rtd.Naming.Name);
label = STR_RESEARCH_TYPE_LABEL_VEHICLE;
}
}
else
{
ft.Add<StringId>(gameState.ResearchNextItem->GetName());
ft.Add<StringId>(gameState.researchNextItem->GetName());
}
DrawTextWrapped(dpi, screenCoords, 296, label, ft);
screenCoords.y += 25;
// Progress
ft = Formatter();
ft.Add<StringId>(ResearchStageNames[gameState.ResearchProgressStage]);
ft.Add<StringId>(ResearchStageNames[gameState.researchProgressStage]);
DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft);
screenCoords.y += 15;
// Expected
ft = Formatter();
if (gameState.ResearchProgressStage != RESEARCH_STAGE_INITIAL_RESEARCH && gameState.ResearchExpectedDay != 255)
if (gameState.researchProgressStage != RESEARCH_STAGE_INITIAL_RESEARCH && gameState.researchExpectedDay != 255)
{
// TODO: Should probably use game date format setting
ft.Add<StringId>(STR_RESEARCH_EXPECTED_FORMAT);
ft.Add<StringId>(DateDayNames[gameState.ResearchExpectedDay]);
ft.Add<StringId>(DateGameMonthNames[gameState.ResearchExpectedMonth]);
ft.Add<StringId>(DateDayNames[gameState.researchExpectedDay]);
ft.Add<StringId>(DateGameMonthNames[gameState.researchExpectedMonth]);
}
else
{
@@ -442,30 +442,30 @@ namespace OpenRCT2::Ui::Windows
// Last development
screenCoords = w->windowPos + ScreenCoordsXY{ 10, w->widgets[WIDX_LAST_DEVELOPMENT_GROUP + widgetOffset].top + 12 };
if (gameState.ResearchLastItem.has_value())
if (gameState.researchLastItem.has_value())
{
StringId lastDevelopmentFormat = kStringIdEmpty;
auto ft = Formatter();
if (gameState.ResearchLastItem->type == Research::EntryType::Scenery)
if (gameState.researchLastItem->type == Research::EntryType::Scenery)
{
lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL;
ft.Add<StringId>(gameState.ResearchLastItem->GetName());
ft.Add<StringId>(gameState.researchLastItem->GetName());
}
else
{
lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL;
const auto& rtd = GetRideTypeDescriptor(gameState.ResearchLastItem->baseRideType);
const auto& rtd = GetRideTypeDescriptor(gameState.researchLastItem->baseRideType);
if (rtd.HasFlag(RtdFlag::listVehiclesSeparately))
{
ft.Add<StringId>(gameState.ResearchLastItem->GetName());
ft.Add<StringId>(gameState.researchLastItem->GetName());
}
else if (gameState.ResearchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
else if (gameState.researchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
{
ft.Add<StringId>(rtd.Naming.Name);
}
else
{
ft.Add<StringId>(gameState.ResearchLastItem->GetName());
ft.Add<StringId>(gameState.researchLastItem->GetName());
ft.Add<StringId>(rtd.Naming.Name);
lastDevelopmentFormat = STR_RESEARCH_VEHICLE_LABEL;
}
@@ -481,7 +481,7 @@ namespace OpenRCT2::Ui::Windows
void WindowResearchFundingMouseDown(WindowBase* w, WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex)
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING);
if (widgetIndex != (WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset))
@@ -498,13 +498,13 @@ namespace OpenRCT2::Ui::Windows
{ w->windowPos.x + dropdownWidget->left, w->windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1,
w->colours[1], 0, Dropdown::Flag::StayOpen, 4, dropdownWidget->width() - 3);
int32_t currentResearchLevel = gameState.ResearchFundingLevel;
int32_t currentResearchLevel = gameState.researchFundingLevel;
Dropdown::SetChecked(currentResearchLevel, true);
}
void WindowResearchFundingMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex)
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING);
switch (widgetIndex - widgetOffset)
@@ -517,9 +517,9 @@ namespace OpenRCT2::Ui::Windows
case WIDX_SHOPS_AND_STALLS:
case WIDX_SCENERY_AND_THEMING:
{
auto activeResearchTypes = gameState.ResearchPriorities;
auto activeResearchTypes = gameState.researchPriorities;
activeResearchTypes ^= 1uLL << (widgetIndex - (WIDX_TRANSPORT_RIDES + widgetOffset));
auto gameAction = ParkSetResearchFundingAction(activeResearchTypes, gameState.ResearchFundingLevel);
auto gameAction = ParkSetResearchFundingAction(activeResearchTypes, gameState.researchFundingLevel);
GameActions::Execute(&gameAction);
break;
}
@@ -528,22 +528,22 @@ namespace OpenRCT2::Ui::Windows
void WindowResearchFundingDropdown(WidgetIndex widgetIndex, int32_t selectedIndex, WidgetIndex baseWidgetIndex)
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING);
if (widgetIndex != (WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset) || selectedIndex == -1)
return;
auto gameAction = ParkSetResearchFundingAction(gameState.ResearchPriorities, selectedIndex);
auto gameAction = ParkSetResearchFundingAction(gameState.researchPriorities, selectedIndex);
GameActions::Execute(&gameAction);
}
void WindowResearchFundingPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex)
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING);
if ((gameState.Park.Flags & PARK_FLAGS_NO_MONEY) || gameState.ResearchProgressStage == RESEARCH_STAGE_FINISHED_ALL)
if ((gameState.park.Flags & PARK_FLAGS_NO_MONEY) || gameState.researchProgressStage == RESEARCH_STAGE_FINISHED_ALL)
{
w->widgets[WIDX_RESEARCH_FUNDING + widgetOffset].type = WindowWidgetType::Empty;
w->widgets[WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset].type = WindowWidgetType::Empty;
@@ -555,12 +555,12 @@ namespace OpenRCT2::Ui::Windows
}
// Current funding
int32_t currentResearchLevel = gameState.ResearchFundingLevel;
int32_t currentResearchLevel = gameState.researchFundingLevel;
w->widgets[WIDX_RESEARCH_FUNDING + widgetOffset].text = kResearchFundingLevelNames[currentResearchLevel];
// Checkboxes
uint8_t activeResearchTypes = gameState.ResearchPriorities;
int32_t uncompletedResearchTypes = gameState.ResearchUncompletedCategories;
uint8_t activeResearchTypes = gameState.researchPriorities;
int32_t uncompletedResearchTypes = gameState.researchUncompletedCategories;
for (int32_t i = 0; i < 7; i++)
{
int32_t mask = 1 << i;
@@ -587,11 +587,11 @@ namespace OpenRCT2::Ui::Windows
void WindowResearchFundingDraw(WindowBase* w, DrawPixelInfo& dpi)
{
const auto& gameState = GetGameState();
if (gameState.Park.Flags & PARK_FLAGS_NO_MONEY)
const auto& gameState = getGameState();
if (gameState.park.Flags & PARK_FLAGS_NO_MONEY)
return;
int32_t currentResearchLevel = gameState.ResearchFundingLevel;
int32_t currentResearchLevel = gameState.researchFundingLevel;
auto ft = Formatter();
ft.Add<money64>(research_cost_table[currentResearchLevel]);
DrawTextBasic(
+37 -37
View File
@@ -1383,7 +1383,7 @@ namespace OpenRCT2::Ui::Windows
}
if (rtd.specialType == RtdSpecialType::cashMachine || rtd.specialType == RtdSpecialType::firstAid
|| (GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) != 0)
|| (getGameState().park.Flags & PARK_FLAGS_NO_MONEY) != 0)
disabledTabs |= (1uLL << WIDX_TAB_9); // 0x1000
if (gLegacyScene == LegacyScene::trackDesigner)
@@ -1707,7 +1707,7 @@ namespace OpenRCT2::Ui::Windows
}
}
}
if (GetGameState().Cheats.allowArbitraryRideTypeChanges)
if (getGameState().cheats.allowArbitraryRideTypeChanges)
{
minHeight += 15;
}
@@ -2007,9 +2007,9 @@ namespace OpenRCT2::Ui::Windows
bool selectionShouldBeExpanded;
ride_type_t rideTypeIterator, rideTypeIteratorMax;
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
const auto& rtd = ride.getRideTypeDescriptor();
if (gameState.Cheats.showVehiclesFromOtherTrackTypes
if (gameState.cheats.showVehiclesFromOtherTrackTypes
&& !(
rtd.HasFlag(RtdFlag::isFlatRide) || rtd.specialType == RtdSpecialType::maze
|| rtd.specialType == RtdSpecialType::miniGolf))
@@ -2050,7 +2050,7 @@ namespace OpenRCT2::Ui::Windows
continue;
// Skip if vehicle type has not been invented yet
if (!RideEntryIsInvented(rideEntryIndex) && !gameState.Cheats.ignoreResearchStatus)
if (!RideEntryIsInvented(rideEntryIndex) && !gameState.cheats.ignoreResearchStatus)
continue;
auto name = currentRideEntry->naming.Name;
@@ -2328,10 +2328,10 @@ namespace OpenRCT2::Ui::Windows
if (ride == nullptr)
return;
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
disabled_widgets &= ~((1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_CONSTRUCTION));
if (ride->lifecycleFlags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)
&& !gameState.Cheats.makeAllDestructible)
&& !gameState.cheats.makeAllDestructible)
disabled_widgets |= (1uLL << WIDX_DEMOLISH);
auto ft = Formatter::Common();
@@ -2370,7 +2370,7 @@ namespace OpenRCT2::Ui::Windows
AnchorBorderWidgets();
const int32_t offset = gameState.Cheats.allowArbitraryRideTypeChanges ? 15 : 0;
const int32_t offset = gameState.cheats.allowArbitraryRideTypeChanges ? 15 : 0;
// Anchor main page specific widgets
widgets[WIDX_VIEWPORT].right = width - 26;
widgets[WIDX_VIEWPORT].bottom = height - (14 + offset);
@@ -2388,7 +2388,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_RIDE_TYPE_DROPDOWN].top = height - 16;
widgets[WIDX_RIDE_TYPE_DROPDOWN].bottom = height - 5;
if (!gameState.Cheats.allowArbitraryRideTypeChanges)
if (!gameState.cheats.allowArbitraryRideTypeChanges)
{
widgets[WIDX_RIDE_TYPE].type = WindowWidgetType::Empty;
widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Empty;
@@ -2795,9 +2795,9 @@ namespace OpenRCT2::Ui::Windows
// Vehicle type
widgets[WIDX_VEHICLE_TYPE].text = rideEntry->naming.Name;
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
// Trains
if (rideEntry->cars_per_flat_ride > 1 || gameState.Cheats.disableTrainLengthLimit)
if (rideEntry->cars_per_flat_ride > 1 || gameState.cheats.disableTrainLengthLimit)
{
widgets[WIDX_VEHICLE_TRAINS].type = WindowWidgetType::Spinner;
widgets[WIDX_VEHICLE_TRAINS_INCREASE].type = WindowWidgetType::Button;
@@ -2811,7 +2811,7 @@ namespace OpenRCT2::Ui::Windows
}
// Cars per train
if (rideEntry->zero_cars + 1 < rideEntry->max_cars_in_train || gameState.Cheats.disableTrainLengthLimit)
if (rideEntry->zero_cars + 1 < rideEntry->max_cars_in_train || gameState.cheats.disableTrainLengthLimit)
{
widgets[WIDX_VEHICLE_CARS_PER_TRAIN].type = WindowWidgetType::Spinner;
widgets[WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE].type = WindowWidgetType::Button;
@@ -2825,7 +2825,7 @@ namespace OpenRCT2::Ui::Windows
}
if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::allowReversedTrains)
|| (gameState.Cheats.disableTrainLengthLimit && !ride->getRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide)))
|| (gameState.cheats.disableTrainLengthLimit && !ride->getRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide)))
{
widgets[WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX].type = WindowWidgetType::Checkbox;
if (ride->hasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS))
@@ -3065,11 +3065,11 @@ namespace OpenRCT2::Ui::Windows
return;
const auto& operatingSettings = ride->getRideTypeDescriptor().OperatingSettings;
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
uint8_t maxValue = operatingSettings.MaxValue;
uint8_t minValue = gameState.Cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue;
uint8_t minValue = gameState.cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue;
if (gameState.Cheats.unlockOperatingLimits)
if (gameState.cheats.unlockOperatingLimits)
{
maxValue = OpenRCT2::Limits::kCheatsMaxOperatingLimit;
}
@@ -3087,10 +3087,10 @@ namespace OpenRCT2::Ui::Windows
return;
const auto& operatingSettings = ride->getRideTypeDescriptor().OperatingSettings;
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
uint8_t maxValue = operatingSettings.MaxValue;
uint8_t minValue = gameState.Cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue;
if (gameState.Cheats.unlockOperatingLimits)
uint8_t minValue = gameState.cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue;
if (gameState.cheats.unlockOperatingLimits)
{
maxValue = OpenRCT2::Limits::kCheatsMaxOperatingLimit;
}
@@ -3228,10 +3228,10 @@ namespace OpenRCT2::Ui::Windows
ModeTweakDecrease();
break;
case WIDX_LIFT_HILL_SPEED_INCREASE:
upperBound = GetGameState().Cheats.unlockOperatingLimits
upperBound = getGameState().cheats.unlockOperatingLimits
? OpenRCT2::Limits::kCheatsMaxOperatingLimit
: ride->getRideTypeDescriptor().LiftData.maximum_speed;
lowerBound = GetGameState().Cheats.unlockOperatingLimits
lowerBound = getGameState().cheats.unlockOperatingLimits
? 0
: ride->getRideTypeDescriptor().LiftData.minimum_speed;
SetOperatingSetting(
@@ -3239,10 +3239,10 @@ namespace OpenRCT2::Ui::Windows
std::clamp<int16_t>(ride->liftHillSpeed + 1, lowerBound, upperBound));
break;
case WIDX_LIFT_HILL_SPEED_DECREASE:
upperBound = GetGameState().Cheats.unlockOperatingLimits
upperBound = getGameState().cheats.unlockOperatingLimits
? OpenRCT2::Limits::kCheatsMaxOperatingLimit
: ride->getRideTypeDescriptor().LiftData.maximum_speed;
lowerBound = GetGameState().Cheats.unlockOperatingLimits
lowerBound = getGameState().cheats.unlockOperatingLimits
? 0
: ride->getRideTypeDescriptor().LiftData.minimum_speed;
SetOperatingSetting(
@@ -3290,7 +3290,7 @@ namespace OpenRCT2::Ui::Windows
LoadDropdown(&widgets[widgetIndex]);
break;
case WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE:
upperBound = GetGameState().Cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit
upperBound = getGameState().cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit
: OpenRCT2::Limits::kMaxCircuitsPerRide;
lowerBound = 1;
SetOperatingSetting(
@@ -3298,7 +3298,7 @@ namespace OpenRCT2::Ui::Windows
std::clamp<int16_t>(ride->numCircuits + 1, lowerBound, upperBound));
break;
case WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE:
upperBound = GetGameState().Cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit
upperBound = getGameState().cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit
: OpenRCT2::Limits::kMaxCircuitsPerRide;
lowerBound = 1;
SetOperatingSetting(
@@ -3342,10 +3342,10 @@ namespace OpenRCT2::Ui::Windows
}
const auto& operatingSettings = ride.getRideTypeDescriptor().OperatingSettings;
const auto& gameState = GetGameState();
int16_t maxValue = gameState.Cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit
const auto& gameState = getGameState();
int16_t maxValue = gameState.cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit
: operatingSettings.MaxValue;
int16_t minValue = gameState.Cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue;
int16_t minValue = gameState.cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue;
const auto& title = widgets[WIDX_MODE_TWEAK_LABEL].text;
Formatter ft;
@@ -3425,10 +3425,10 @@ namespace OpenRCT2::Ui::Windows
if (widgetIndex == WIDX_MODE_TWEAK)
{
const auto& operatingSettings = ride->getRideTypeDescriptor().OperatingSettings;
const auto& gameState = GetGameState();
uint32_t maxValue = gameState.Cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit
const auto& gameState = getGameState();
uint32_t maxValue = gameState.cheats.unlockOperatingLimits ? OpenRCT2::Limits::kCheatsMaxOperatingLimit
: operatingSettings.MaxValue;
uint32_t minValue = gameState.Cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue;
uint32_t minValue = gameState.cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue;
auto multiplier = ride->getRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier;
try
@@ -4052,7 +4052,7 @@ namespace OpenRCT2::Ui::Windows
// Locate mechanic button image
Widget* widget = &widgets[WIDX_LOCATE_MECHANIC];
auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top };
auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, GetGameState().StaffMechanicColour);
auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, getGameState().staffMechanicColour);
GfxDrawSprite(dpi, image, screenCoords);
// Inspection label
@@ -4501,7 +4501,7 @@ namespace OpenRCT2::Ui::Windows
rideSetAppearanceAction.SetCallback([objIndex](const GameAction*, const GameActions::Result* res) {
if (res->Error != GameActions::Status::Ok)
return;
GetGameState().LastEntranceStyle = objIndex;
getGameState().lastEntranceStyle = objIndex;
});
GameActions::Execute(&rideSetAppearanceAction);
break;
@@ -4879,7 +4879,7 @@ namespace OpenRCT2::Ui::Windows
{
colour_t spriteColour = COLOUR_BLACK;
// Limit update rate of preview to avoid making people dizzy.
if ((GetGameState().CurrentTicks % 64) == 0)
if ((getGameState().currentTicks % 64) == 0)
{
spriteColour++;
if (spriteColour >= kColourNumNormal)
@@ -5079,7 +5079,7 @@ namespace OpenRCT2::Ui::Windows
}
}
if (GetGameState().Cheats.unlockOperatingLimits || musicObj->SupportsRideType(ride->type))
if (getGameState().cheats.unlockOperatingLimits || musicObj->SupportsRideType(ride->type))
{
musicOrder.push_back(i);
}
@@ -6240,8 +6240,8 @@ namespace OpenRCT2::Ui::Windows
static void UpdateSamePriceThroughoutFlags(ShopItem shop_item)
{
const auto& gameState = GetGameState();
const auto existingFlags = gameState.SamePriceThroughoutPark;
const auto& gameState = getGameState();
const auto existingFlags = gameState.samePriceThroughoutPark;
auto newFlags = existingFlags;
if (GetShopItemDescriptor(shop_item).IsPhoto())
+19 -19
View File
@@ -434,7 +434,7 @@ namespace OpenRCT2::Ui::Windows
}
}
if (currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::upInclineRequiresLift)
&& !GetGameState().Cheats.enableAllDrawableTrackPieces)
&& !getGameState().cheats.enableAllDrawableTrackPieces)
{
// Disable lift hill toggle and banking if current track piece is uphill
if (_previousTrackPitchEnd == TrackPitch::Up25 || _previousTrackPitchEnd == TrackPitch::Up60
@@ -772,7 +772,7 @@ namespace OpenRCT2::Ui::Windows
{
disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN);
}
if ((_currentTrackHasLiftHill) && !GetGameState().Cheats.enableChainLiftOnAllTrack)
if ((_currentTrackHasLiftHill) && !getGameState().cheats.enableChainLiftOnAllTrack)
{
if (_currentTrackPitchEnd != TrackPitch::None && !IsTrackEnabled(TrackGroup::liftHillCurve))
{
@@ -867,7 +867,7 @@ namespace OpenRCT2::Ui::Windows
{
if (_currentTrackPitchEnd == TrackPitch::None && _previousTrackRollEnd != TrackRoll::None
&& (!currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::upInclineRequiresLift)
|| GetGameState().Cheats.enableAllDrawableTrackPieces))
|| getGameState().cheats.enableAllDrawableTrackPieces))
{
disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP);
}
@@ -931,7 +931,7 @@ namespace OpenRCT2::Ui::Windows
}
// If chain lift cheat is enabled then show the chain lift widget no matter what
if (GetGameState().Cheats.enableChainLiftOnAllTrack)
if (getGameState().cheats.enableChainLiftOnAllTrack)
{
disabledWidgets &= ~(1uLL << WIDX_CHAIN_LIFT);
}
@@ -1352,7 +1352,7 @@ namespace OpenRCT2::Ui::Windows
case WIDX_CHAIN_LIFT:
RideConstructionInvalidateCurrentTrack();
_currentTrackHasLiftHill = !_currentTrackHasLiftHill;
if ((_currentTrackHasLiftHill) && !GetGameState().Cheats.enableChainLiftOnAllTrack)
if ((_currentTrackHasLiftHill) && !getGameState().cheats.enableChainLiftOnAllTrack)
_currentTrackAlternative.unset(AlternativeTrackFlag::alternativePieces);
_currentTrackPrice = kMoney64Undefined;
WindowRideConstructionUpdateActiveElements();
@@ -1405,7 +1405,7 @@ namespace OpenRCT2::Ui::Windows
{
auto trackSpeedIncrement = kDefaultSpeedIncrement;
auto trackSpeedMinimum = kDefaultMinimumSpeed;
if (GetGameState().Cheats.unlockOperatingLimits)
if (getGameState().cheats.unlockOperatingLimits)
{
trackSpeedMinimum = 0;
}
@@ -1436,7 +1436,7 @@ namespace OpenRCT2::Ui::Windows
case WIDX_O_TRACK:
RideConstructionInvalidateCurrentTrack();
_currentTrackAlternative.set(AlternativeTrackFlag::alternativePieces);
if (!GetGameState().Cheats.enableChainLiftOnAllTrack)
if (!getGameState().cheats.enableChainLiftOnAllTrack)
_currentTrackHasLiftHill = false;
_currentTrackPrice = kMoney64Undefined;
WindowRideConstructionUpdateActiveElements();
@@ -1655,7 +1655,7 @@ namespace OpenRCT2::Ui::Windows
DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE });
screenCoords.y += 11;
if (_currentTrackPrice != kMoney64Undefined && !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (_currentTrackPrice != kMoney64Undefined && !(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
auto ft = Formatter();
ft.Add<money64>(_currentTrackPrice);
@@ -1793,16 +1793,16 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_SLOPE_UP_STEEP].type = WindowWidgetType::FlatBtn;
}
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
if (currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::upInclineRequiresLift)
&& (_currentTrackPitchEnd == TrackPitch::Up25 || _currentTrackPitchEnd == TrackPitch::Up60)
&& !gameState.Cheats.enableAllDrawableTrackPieces)
&& !gameState.cheats.enableAllDrawableTrackPieces)
{
_currentTrackHasLiftHill = true;
}
if ((IsTrackEnabled(TrackGroup::liftHill) && !_currentlySelectedTrack.isTrackType)
|| (gameState.Cheats.enableChainLiftOnAllTrack
|| (gameState.cheats.enableChainLiftOnAllTrack
&& currentRide->getRideTypeDescriptor().HasFlag(RtdFlag::hasTrack)))
{
widgets[WIDX_CHAIN_LIFT].type = WindowWidgetType::FlatBtn;
@@ -2485,7 +2485,7 @@ namespace OpenRCT2::Ui::Windows
{
_currentTrackPitchEnd = slope;
_currentTrackPrice = kMoney64Undefined;
if (_rideConstructionState == RideConstructionState::Front && !GetGameState().Cheats.enableChainLiftOnAllTrack)
if (_rideConstructionState == RideConstructionState::Front && !getGameState().cheats.enableChainLiftOnAllTrack)
{
switch (slope)
{
@@ -2685,10 +2685,10 @@ namespace OpenRCT2::Ui::Windows
return;
}
auto& gameState = GetGameState();
auto preserveMapSize = gameState.MapSize;
auto& gameState = getGameState();
auto preserveMapSize = gameState.mapSize;
gameState.MapSize = { kMaximumMapSizeTechnical, kMaximumMapSizeTechnical };
gameState.mapSize = { kMaximumMapSizeTechnical, kMaximumMapSizeTechnical };
// Setup non changing parts of the temporary track tile element
tempTrackTileElement.SetType(TileElementType::Track);
@@ -2754,7 +2754,7 @@ namespace OpenRCT2::Ui::Windows
MapSetTileElement(southTileCoords, backupTileElementArrays[4]);
}
gameState.MapSize = preserveMapSize;
gameState.mapSize = preserveMapSize;
PaintSessionArrange(*session);
PaintDrawStructs(*session);
@@ -3607,7 +3607,7 @@ namespace OpenRCT2::Ui::Windows
// FIX not sure exactly why it starts trial and error place from a lower Z, but it causes issues with disable
// clearance
if (!GetGameState().Cheats.disableClearanceChecks && z > kMinimumLandZ)
if (!getGameState().cheats.disableClearanceChecks && z > kMinimumLandZ)
{
z -= kLandHeightStep;
}
@@ -4986,7 +4986,7 @@ namespace OpenRCT2::Ui::Windows
if (coveredVariant != TrackElemType::None && (availableGroups.get(EnumValue(ted.definition.group))))
{
trackType = coveredVariant;
if (!GetGameState().Cheats.enableChainLiftOnAllTrack)
if (!getGameState().cheats.enableChainLiftOnAllTrack)
liftHillAndInvertedState.unset(LiftHillAndInverted::liftHill);
}
}
@@ -5036,7 +5036,7 @@ namespace OpenRCT2::Ui::Windows
turnOffLiftHill = true;
}
if (turnOffLiftHill && !GetGameState().Cheats.enableChainLiftOnAllTrack)
if (turnOffLiftHill && !getGameState().cheats.enableChainLiftOnAllTrack)
{
liftHillAndInvertedState.unset(LiftHillAndInverted::liftHill);
_currentTrackHasLiftHill = false;
+1 -1
View File
@@ -301,7 +301,7 @@ namespace OpenRCT2::Ui::Windows
int32_t selectedIndex = -1;
for (int32_t type = INFORMATION_TYPE_STATUS; type <= lastType; type++)
{
if ((GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if ((getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
if (ride_info_type_money_mapping[type])
{
+1 -1
View File
@@ -171,7 +171,7 @@ namespace OpenRCT2::Ui::Windows
intent = std::make_unique<Intent>(WindowClass::Loadsave);
intent->PutEnumExtra<LoadSaveAction>(INTENT_EXTRA_LOADSAVE_ACTION, LoadSaveAction::save);
intent->PutEnumExtra<LoadSaveType>(INTENT_EXTRA_LOADSAVE_TYPE, LoadSaveType::landscape);
intent->PutExtra(INTENT_EXTRA_PATH, GetGameState().ScenarioName);
intent->PutExtra(INTENT_EXTRA_PATH, getGameState().scenarioName);
}
else
{
+3 -3
View File
@@ -691,7 +691,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn;
}
if (gLegacyScene == LegacyScene::scenarioEditor || GetGameState().Cheats.sandboxMode)
if (gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode)
{
widgets[WIDX_RESTRICT_SCENERY].type = WindowWidgetType::Button;
if (IsSceneryItemRestricted(tabSelectedScenery))
@@ -842,7 +842,7 @@ namespace OpenRCT2::Ui::Windows
}
auto [name, price] = GetNameAndPrice(selectedSceneryEntry);
if (price != kMoney64Undefined && !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (price != kMoney64Undefined && !(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
auto ft = Formatter();
ft.Add<money64>(price);
@@ -2366,7 +2366,7 @@ namespace OpenRCT2::Ui::Windows
void Sub6E1F34UpdateScreenCoordsAndButtonsPressed(bool canRaiseItem, ScreenCoordsXY& screenPos)
{
if (!canRaiseItem && !GetGameState().Cheats.disableSupportLimits)
if (!canRaiseItem && !getGameState().cheats.disableSupportLimits)
{
gSceneryCtrlPressed = false;
gSceneryShiftPressed = false;
+1 -1
View File
@@ -931,7 +931,7 @@ namespace OpenRCT2::Ui::Windows
auto screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_RESIZE].left + 4, widgets[WIDX_RESIZE].top + 4 };
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
auto ft = Formatter();
ft.Add<money64>(GetStaffWage(staff->AssignedStaffType));
+5 -5
View File
@@ -281,7 +281,7 @@ namespace OpenRCT2::Ui::Windows
DrawWidgets(dpi);
DrawTabImages(dpi);
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
auto ft = Formatter();
ft.Add<money64>(GetStaffWage(GetSelectedStaffType()));
@@ -594,10 +594,10 @@ namespace OpenRCT2::Ui::Windows
void DrawTabImages(DrawPixelInfo& dpi) const
{
const auto& gameState = GetGameState();
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_HANDYMEN, AnimationPeepType::Handyman, gameState.StaffHandymanColour);
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_MECHANICS, AnimationPeepType::Mechanic, gameState.StaffMechanicColour);
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_SECURITY, AnimationPeepType::Security, gameState.StaffSecurityColour);
const auto& gameState = getGameState();
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_HANDYMEN, AnimationPeepType::Handyman, gameState.staffHandymanColour);
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_MECHANICS, AnimationPeepType::Mechanic, gameState.staffMechanicColour);
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_SECURITY, AnimationPeepType::Security, gameState.staffSecurityColour);
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_ENTERTAINERS, AnimationPeepType::Entertainer);
}
+19 -19
View File
@@ -466,7 +466,7 @@ namespace OpenRCT2::Ui::Windows
auto intent = Intent(WindowClass::Loadsave);
intent.PutEnumExtra<LoadSaveAction>(INTENT_EXTRA_LOADSAVE_ACTION, LoadSaveAction::save);
intent.PutEnumExtra<LoadSaveType>(INTENT_EXTRA_LOADSAVE_TYPE, LoadSaveType::landscape);
intent.PutExtra(INTENT_EXTRA_PATH, GetGameState().ScenarioName);
intent.PutExtra(INTENT_EXTRA_PATH, getGameState().scenarioName);
ContextOpenIntent(&intent);
}
else
@@ -650,7 +650,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_PAUSE].type = WindowWidgetType::Empty;
}
if ((GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) || !Config::Get().interface.ToolbarShowFinances)
if ((getGameState().park.Flags & PARK_FLAGS_NO_MONEY) || !Config::Get().interface.ToolbarShowFinances)
widgets[WIDX_FINANCES].type = WindowWidgetType::Empty;
}
@@ -669,22 +669,22 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_NEWS].type = WindowWidgetType::Empty;
widgets[WIDX_NETWORK].type = WindowWidgetType::Empty;
auto& gameState = GetGameState();
if (gameState.EditorStep != EditorStep::LandscapeEditor)
auto& gameState = getGameState();
if (gameState.editorStep != EditorStep::LandscapeEditor)
{
widgets[WIDX_LAND].type = WindowWidgetType::Empty;
widgets[WIDX_WATER].type = WindowWidgetType::Empty;
}
if (gameState.EditorStep != EditorStep::RollercoasterDesigner)
if (gameState.editorStep != EditorStep::RollercoasterDesigner)
{
widgets[WIDX_RIDES].type = WindowWidgetType::Empty;
widgets[WIDX_CONSTRUCT_RIDE].type = WindowWidgetType::Empty;
widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty;
}
if (gameState.EditorStep != EditorStep::LandscapeEditor
&& gameState.EditorStep != EditorStep::RollercoasterDesigner)
if (gameState.editorStep != EditorStep::LandscapeEditor
&& gameState.editorStep != EditorStep::RollercoasterDesigner)
{
widgets[WIDX_MAP].type = WindowWidgetType::Empty;
widgets[WIDX_SCENERY].type = WindowWidgetType::Empty;
@@ -878,7 +878,7 @@ namespace OpenRCT2::Ui::Windows
void OnDraw(DrawPixelInfo& dpi) override
{
const auto& gameState = GetGameState();
const auto& gameState = getGameState();
int32_t imgId;
WindowDrawWidgets(*this, dpi);
@@ -891,7 +891,7 @@ namespace OpenRCT2::Ui::Windows
imgId = SPR_TOOLBAR_STAFF;
if (WidgetIsPressed(*this, WIDX_STAFF))
imgId++;
GfxDrawSprite(dpi, ImageId(imgId, gameState.StaffHandymanColour, gameState.StaffMechanicColour), screenPos);
GfxDrawSprite(dpi, ImageId(imgId, gameState.staffHandymanColour, gameState.staffMechanicColour), screenPos);
}
// Draw fast forward button
@@ -922,7 +922,7 @@ namespace OpenRCT2::Ui::Windows
GfxDrawSprite(dpi, ImageId(SPR_G2_SANDBOX), screenPos);
// Draw an overlay if clearance checks are disabled
if (GetGameState().Cheats.disableClearanceChecks)
if (getGameState().cheats.disableClearanceChecks)
{
auto colour = ColourWithFlags{ COLOUR_DARK_ORANGE }.withFlag(ColourFlag::withOutline, true);
DrawTextBasic(
@@ -1185,7 +1185,7 @@ namespace OpenRCT2::Ui::Windows
auto i = 0;
gDropdownItems[i++].Format = STR_SHORTCUT_SHOW_MAP;
gDropdownItems[i++].Format = STR_EXTRA_VIEWPORT;
if (gLegacyScene == LegacyScene::scenarioEditor && GetGameState().EditorStep == EditorStep::LandscapeEditor)
if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep == EditorStep::LandscapeEditor)
{
gDropdownItems[i++].Format = STR_MAPGEN_MENU_ITEM;
}
@@ -1217,7 +1217,7 @@ namespace OpenRCT2::Ui::Windows
void TopToolbar::MapMenuDropdown(int16_t dropdownIndex)
{
int32_t customStartIndex = 3;
if (gLegacyScene == LegacyScene::scenarioEditor && GetGameState().EditorStep == EditorStep::LandscapeEditor)
if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep == EditorStep::LandscapeEditor)
{
customStartIndex++;
}
@@ -1437,16 +1437,16 @@ namespace OpenRCT2::Ui::Windows
Dropdown::SetDisabled(DDIDX_ENABLE_SANDBOX_MODE, true);
}
auto& gameState = GetGameState();
if (gameState.Cheats.sandboxMode)
auto& gameState = getGameState();
if (gameState.cheats.sandboxMode)
{
Dropdown::SetChecked(DDIDX_ENABLE_SANDBOX_MODE, true);
}
if (gameState.Cheats.disableClearanceChecks)
if (gameState.cheats.disableClearanceChecks)
{
Dropdown::SetChecked(DDIDX_DISABLE_CLEARANCE_CHECKS, true);
}
if (gameState.Cheats.disableSupportLimits)
if (gameState.cheats.disableSupportLimits)
{
Dropdown::SetChecked(DDIDX_DISABLE_SUPPORT_LIMITS, true);
}
@@ -1481,13 +1481,13 @@ namespace OpenRCT2::Ui::Windows
ContextOpenWindow(WindowClass::EditorObjectiveOptions);
break;
case DDIDX_ENABLE_SANDBOX_MODE:
CheatsSet(CheatType::SandboxMode, !GetGameState().Cheats.sandboxMode);
CheatsSet(CheatType::SandboxMode, !getGameState().cheats.sandboxMode);
break;
case DDIDX_DISABLE_CLEARANCE_CHECKS:
CheatsSet(CheatType::DisableClearanceChecks, !GetGameState().Cheats.disableClearanceChecks);
CheatsSet(CheatType::DisableClearanceChecks, !getGameState().cheats.disableClearanceChecks);
break;
case DDIDX_DISABLE_SUPPORT_LIMITS:
CheatsSet(CheatType::DisableSupportLimits, !GetGameState().Cheats.disableSupportLimits);
CheatsSet(CheatType::DisableSupportLimits, !getGameState().cheats.disableSupportLimits);
break;
}
}
+2 -2
View File
@@ -206,7 +206,7 @@ namespace OpenRCT2::Ui::Windows
}
money64 cost = kMoney64Undefined;
if (GameIsNotPaused() || GetGameState().Cheats.buildInPauseMode)
if (GameIsNotPaused() || getGameState().cheats.buildInPauseMode)
{
ClearProvisional();
auto res = FindValidTrackDesignPlaceHeight(trackLoc, GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST);
@@ -355,7 +355,7 @@ namespace OpenRCT2::Ui::Windows
}
// Price
if (_placementCost != kMoney64Undefined && !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (_placementCost != kMoney64Undefined && !(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
ft = Formatter();
ft.Add<money64>(_placementCost);
+1 -1
View File
@@ -149,7 +149,7 @@ namespace OpenRCT2::Ui::Windows
// Locate mechanic button image
const auto& widget = widgets[WIDX_HIDE_STAFF];
auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top };
auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, GetGameState().StaffMechanicColour);
auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, getGameState().staffMechanicColour);
GfxDrawSprite(dpi, image, screenCoords);
}
+1 -1
View File
@@ -163,7 +163,7 @@ namespace OpenRCT2::Ui::Windows
dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
}
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(getGameState().park.Flags & PARK_FLAGS_NO_MONEY))
{
// Draw raise cost amount
screenCoords = { widgets[WIDX_PREVIEW].midX() + windowPos.x, widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 };
+86 -86
View File
@@ -28,35 +28,35 @@ using namespace OpenRCT2;
void CheatsReset()
{
auto& gameState = GetGameState();
gameState.Cheats.sandboxMode = false;
gameState.Cheats.disableClearanceChecks = false;
gameState.Cheats.disableSupportLimits = false;
gameState.Cheats.showAllOperatingModes = false;
gameState.Cheats.showVehiclesFromOtherTrackTypes = false;
gameState.Cheats.disableTrainLengthLimit = false;
gameState.Cheats.enableChainLiftOnAllTrack = false;
gameState.Cheats.unlockOperatingLimits = false;
gameState.Cheats.disableBrakesFailure = false;
gameState.Cheats.disableAllBreakdowns = false;
gameState.Cheats.buildInPauseMode = false;
gameState.Cheats.ignoreRideIntensity = false;
gameState.Cheats.ignorePrice = false;
gameState.Cheats.disableVandalism = false;
gameState.Cheats.disableLittering = false;
gameState.Cheats.neverendingMarketing = false;
gameState.Cheats.freezeWeather = false;
gameState.Cheats.disablePlantAging = false;
gameState.Cheats.allowArbitraryRideTypeChanges = false;
gameState.Cheats.disableRideValueAging = false;
gameState.Cheats.ignoreResearchStatus = false;
gameState.Cheats.enableAllDrawableTrackPieces = false;
gameState.Cheats.allowTrackPlaceInvalidHeights = false;
gameState.Cheats.allowRegularPathAsQueue = false;
gameState.Cheats.allowSpecialColourSchemes = false;
gameState.Cheats.makeAllDestructible = false;
gameState.Cheats.selectedStaffSpeed = StaffSpeedCheat::None;
gameState.Cheats.forcedParkRating = kForcedParkRatingDisabled;
auto& gameState = getGameState();
gameState.cheats.sandboxMode = false;
gameState.cheats.disableClearanceChecks = false;
gameState.cheats.disableSupportLimits = false;
gameState.cheats.showAllOperatingModes = false;
gameState.cheats.showVehiclesFromOtherTrackTypes = false;
gameState.cheats.disableTrainLengthLimit = false;
gameState.cheats.enableChainLiftOnAllTrack = false;
gameState.cheats.unlockOperatingLimits = false;
gameState.cheats.disableBrakesFailure = false;
gameState.cheats.disableAllBreakdowns = false;
gameState.cheats.buildInPauseMode = false;
gameState.cheats.ignoreRideIntensity = false;
gameState.cheats.ignorePrice = false;
gameState.cheats.disableVandalism = false;
gameState.cheats.disableLittering = false;
gameState.cheats.neverendingMarketing = false;
gameState.cheats.freezeWeather = false;
gameState.cheats.disablePlantAging = false;
gameState.cheats.allowArbitraryRideTypeChanges = false;
gameState.cheats.disableRideValueAging = false;
gameState.cheats.ignoreResearchStatus = false;
gameState.cheats.enableAllDrawableTrackPieces = false;
gameState.cheats.allowTrackPlaceInvalidHeights = false;
gameState.cheats.allowRegularPathAsQueue = false;
gameState.cheats.allowSpecialColourSchemes = false;
gameState.cheats.makeAllDestructible = false;
gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::None;
gameState.cheats.forcedParkRating = kForcedParkRatingDisabled;
}
void CheatsSet(CheatType cheatType, int64_t param1 /* = 0*/, int64_t param2 /* = 0*/)
@@ -75,7 +75,7 @@ static void CheatEntrySerialise(DataSerialiser& ds, CheatType type, const T& val
void CheatsSerialise(DataSerialiser& ds)
{
uint16_t count = 0;
auto& gameState = GetGameState();
auto& gameState = getGameState();
if (ds.IsSaving())
{
@@ -85,37 +85,37 @@ void CheatsSerialise(DataSerialiser& ds)
uint64_t countOffset = stream.GetPosition();
ds << count;
CheatEntrySerialise(ds, CheatType::SandboxMode, gameState.Cheats.sandboxMode, count);
CheatEntrySerialise(ds, CheatType::DisableClearanceChecks, gameState.Cheats.disableClearanceChecks, count);
CheatEntrySerialise(ds, CheatType::DisableSupportLimits, gameState.Cheats.disableSupportLimits, count);
CheatEntrySerialise(ds, CheatType::ShowAllOperatingModes, gameState.Cheats.showAllOperatingModes, count);
CheatEntrySerialise(ds, CheatType::SandboxMode, gameState.cheats.sandboxMode, count);
CheatEntrySerialise(ds, CheatType::DisableClearanceChecks, gameState.cheats.disableClearanceChecks, count);
CheatEntrySerialise(ds, CheatType::DisableSupportLimits, gameState.cheats.disableSupportLimits, count);
CheatEntrySerialise(ds, CheatType::ShowAllOperatingModes, gameState.cheats.showAllOperatingModes, count);
CheatEntrySerialise(
ds, CheatType::ShowVehiclesFromOtherTrackTypes, gameState.Cheats.showVehiclesFromOtherTrackTypes, count);
CheatEntrySerialise(ds, CheatType::FastLiftHill, gameState.Cheats.unlockOperatingLimits, count);
CheatEntrySerialise(ds, CheatType::DisableBrakesFailure, gameState.Cheats.disableBrakesFailure, count);
CheatEntrySerialise(ds, CheatType::DisableAllBreakdowns, gameState.Cheats.disableAllBreakdowns, count);
CheatEntrySerialise(ds, CheatType::BuildInPauseMode, gameState.Cheats.buildInPauseMode, count);
CheatEntrySerialise(ds, CheatType::IgnoreRideIntensity, gameState.Cheats.ignoreRideIntensity, count);
CheatEntrySerialise(ds, CheatType::DisableVandalism, gameState.Cheats.disableVandalism, count);
CheatEntrySerialise(ds, CheatType::DisableLittering, gameState.Cheats.disableLittering, count);
CheatEntrySerialise(ds, CheatType::NeverendingMarketing, gameState.Cheats.neverendingMarketing, count);
CheatEntrySerialise(ds, CheatType::FreezeWeather, gameState.Cheats.freezeWeather, count);
CheatEntrySerialise(ds, CheatType::DisableTrainLengthLimit, gameState.Cheats.disableTrainLengthLimit, count);
CheatEntrySerialise(ds, CheatType::DisablePlantAging, gameState.Cheats.disablePlantAging, count);
CheatEntrySerialise(ds, CheatType::EnableChainLiftOnAllTrack, gameState.Cheats.enableChainLiftOnAllTrack, count);
ds, CheatType::ShowVehiclesFromOtherTrackTypes, gameState.cheats.showVehiclesFromOtherTrackTypes, count);
CheatEntrySerialise(ds, CheatType::FastLiftHill, gameState.cheats.unlockOperatingLimits, count);
CheatEntrySerialise(ds, CheatType::DisableBrakesFailure, gameState.cheats.disableBrakesFailure, count);
CheatEntrySerialise(ds, CheatType::DisableAllBreakdowns, gameState.cheats.disableAllBreakdowns, count);
CheatEntrySerialise(ds, CheatType::BuildInPauseMode, gameState.cheats.buildInPauseMode, count);
CheatEntrySerialise(ds, CheatType::IgnoreRideIntensity, gameState.cheats.ignoreRideIntensity, count);
CheatEntrySerialise(ds, CheatType::DisableVandalism, gameState.cheats.disableVandalism, count);
CheatEntrySerialise(ds, CheatType::DisableLittering, gameState.cheats.disableLittering, count);
CheatEntrySerialise(ds, CheatType::NeverendingMarketing, gameState.cheats.neverendingMarketing, count);
CheatEntrySerialise(ds, CheatType::FreezeWeather, gameState.cheats.freezeWeather, count);
CheatEntrySerialise(ds, CheatType::DisableTrainLengthLimit, gameState.cheats.disableTrainLengthLimit, count);
CheatEntrySerialise(ds, CheatType::DisablePlantAging, gameState.cheats.disablePlantAging, count);
CheatEntrySerialise(ds, CheatType::EnableChainLiftOnAllTrack, gameState.cheats.enableChainLiftOnAllTrack, count);
CheatEntrySerialise(
ds, CheatType::AllowArbitraryRideTypeChanges, gameState.Cheats.allowArbitraryRideTypeChanges, count);
CheatEntrySerialise(ds, CheatType::DisableRideValueAging, gameState.Cheats.disableRideValueAging, count);
CheatEntrySerialise(ds, CheatType::IgnoreResearchStatus, gameState.Cheats.ignoreResearchStatus, count);
CheatEntrySerialise(ds, CheatType::EnableAllDrawableTrackPieces, gameState.Cheats.enableAllDrawableTrackPieces, count);
ds, CheatType::AllowArbitraryRideTypeChanges, gameState.cheats.allowArbitraryRideTypeChanges, count);
CheatEntrySerialise(ds, CheatType::DisableRideValueAging, gameState.cheats.disableRideValueAging, count);
CheatEntrySerialise(ds, CheatType::IgnoreResearchStatus, gameState.cheats.ignoreResearchStatus, count);
CheatEntrySerialise(ds, CheatType::EnableAllDrawableTrackPieces, gameState.cheats.enableAllDrawableTrackPieces, count);
CheatEntrySerialise(
ds, CheatType::AllowTrackPlaceInvalidHeights, gameState.Cheats.allowTrackPlaceInvalidHeights, count);
CheatEntrySerialise(ds, CheatType::AllowRegularPathAsQueue, gameState.Cheats.allowRegularPathAsQueue, count);
CheatEntrySerialise(ds, CheatType::AllowSpecialColourSchemes, gameState.Cheats.allowSpecialColourSchemes, count);
CheatEntrySerialise(ds, CheatType::MakeDestructible, gameState.Cheats.makeAllDestructible, count);
CheatEntrySerialise(ds, CheatType::SetStaffSpeed, gameState.Cheats.selectedStaffSpeed, count);
CheatEntrySerialise(ds, CheatType::IgnorePrice, gameState.Cheats.ignorePrice, count);
CheatEntrySerialise(ds, CheatType::SetForcedParkRating, gameState.Cheats.forcedParkRating, count);
ds, CheatType::AllowTrackPlaceInvalidHeights, gameState.cheats.allowTrackPlaceInvalidHeights, count);
CheatEntrySerialise(ds, CheatType::AllowRegularPathAsQueue, gameState.cheats.allowRegularPathAsQueue, count);
CheatEntrySerialise(ds, CheatType::AllowSpecialColourSchemes, gameState.cheats.allowSpecialColourSchemes, count);
CheatEntrySerialise(ds, CheatType::MakeDestructible, gameState.cheats.makeAllDestructible, count);
CheatEntrySerialise(ds, CheatType::SetStaffSpeed, gameState.cheats.selectedStaffSpeed, count);
CheatEntrySerialise(ds, CheatType::IgnorePrice, gameState.cheats.ignorePrice, count);
CheatEntrySerialise(ds, CheatType::SetForcedParkRating, gameState.cheats.forcedParkRating, count);
// Remember current position and update count.
uint64_t endOffset = stream.GetPosition();
@@ -140,91 +140,91 @@ void CheatsSerialise(DataSerialiser& ds)
switch (static_cast<CheatType>(type))
{
case CheatType::SandboxMode:
ds << gameState.Cheats.sandboxMode;
ds << gameState.cheats.sandboxMode;
break;
case CheatType::DisableClearanceChecks:
ds << gameState.Cheats.disableClearanceChecks;
ds << gameState.cheats.disableClearanceChecks;
break;
case CheatType::DisableSupportLimits:
ds << gameState.Cheats.disableSupportLimits;
ds << gameState.cheats.disableSupportLimits;
break;
case CheatType::ShowAllOperatingModes:
ds << gameState.Cheats.showAllOperatingModes;
ds << gameState.cheats.showAllOperatingModes;
break;
case CheatType::ShowVehiclesFromOtherTrackTypes:
ds << gameState.Cheats.showVehiclesFromOtherTrackTypes;
ds << gameState.cheats.showVehiclesFromOtherTrackTypes;
break;
case CheatType::FastLiftHill:
ds << gameState.Cheats.unlockOperatingLimits;
ds << gameState.cheats.unlockOperatingLimits;
break;
case CheatType::DisableBrakesFailure:
ds << gameState.Cheats.disableBrakesFailure;
ds << gameState.cheats.disableBrakesFailure;
break;
case CheatType::DisableAllBreakdowns:
ds << gameState.Cheats.disableAllBreakdowns;
ds << gameState.cheats.disableAllBreakdowns;
break;
case CheatType::BuildInPauseMode:
ds << gameState.Cheats.buildInPauseMode;
ds << gameState.cheats.buildInPauseMode;
break;
case CheatType::IgnoreRideIntensity:
ds << gameState.Cheats.ignoreRideIntensity;
ds << gameState.cheats.ignoreRideIntensity;
break;
case CheatType::IgnorePrice:
ds << gameState.Cheats.ignorePrice;
ds << gameState.cheats.ignorePrice;
break;
case CheatType::DisableVandalism:
ds << gameState.Cheats.disableVandalism;
ds << gameState.cheats.disableVandalism;
break;
case CheatType::DisableLittering:
ds << gameState.Cheats.disableLittering;
ds << gameState.cheats.disableLittering;
break;
case CheatType::NeverendingMarketing:
ds << gameState.Cheats.neverendingMarketing;
ds << gameState.cheats.neverendingMarketing;
break;
case CheatType::FreezeWeather:
ds << gameState.Cheats.freezeWeather;
ds << gameState.cheats.freezeWeather;
break;
case CheatType::DisableTrainLengthLimit:
ds << gameState.Cheats.disableTrainLengthLimit;
ds << gameState.cheats.disableTrainLengthLimit;
break;
case CheatType::DisablePlantAging:
ds << gameState.Cheats.disablePlantAging;
ds << gameState.cheats.disablePlantAging;
break;
case CheatType::EnableChainLiftOnAllTrack:
ds << gameState.Cheats.enableChainLiftOnAllTrack;
ds << gameState.cheats.enableChainLiftOnAllTrack;
break;
case CheatType::AllowArbitraryRideTypeChanges:
ds << gameState.Cheats.allowArbitraryRideTypeChanges;
ds << gameState.cheats.allowArbitraryRideTypeChanges;
break;
case CheatType::DisableRideValueAging:
ds << gameState.Cheats.disableRideValueAging;
ds << gameState.cheats.disableRideValueAging;
break;
case CheatType::IgnoreResearchStatus:
ds << gameState.Cheats.ignoreResearchStatus;
ds << gameState.cheats.ignoreResearchStatus;
break;
case CheatType::EnableAllDrawableTrackPieces:
ds << gameState.Cheats.enableAllDrawableTrackPieces;
ds << gameState.cheats.enableAllDrawableTrackPieces;
break;
case CheatType::AllowTrackPlaceInvalidHeights:
ds << gameState.Cheats.allowTrackPlaceInvalidHeights;
ds << gameState.cheats.allowTrackPlaceInvalidHeights;
break;
case CheatType::NoCapOnQueueLengthDummy:
ds << dummyBool;
break;
case CheatType::AllowRegularPathAsQueue:
ds << gameState.Cheats.allowRegularPathAsQueue;
ds << gameState.cheats.allowRegularPathAsQueue;
break;
case CheatType::AllowSpecialColourSchemes:
ds << gameState.Cheats.allowSpecialColourSchemes;
ds << gameState.cheats.allowSpecialColourSchemes;
break;
case CheatType::MakeDestructible:
ds << gameState.Cheats.makeAllDestructible;
ds << gameState.cheats.makeAllDestructible;
break;
case CheatType::SetStaffSpeed:
ds << gameState.Cheats.selectedStaffSpeed;
ds << gameState.cheats.selectedStaffSpeed;
break;
case CheatType::SetForcedParkRating:
ds << gameState.Cheats.forcedParkRating;
ds << gameState.cheats.forcedParkRating;
default:
break;
}
+1 -1
View File
@@ -809,7 +809,7 @@ namespace OpenRCT2
SetProgress(90, 100, STR_STRING_M_PERCENT);
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = ::GetGameState();
auto& gameState = ::getGameState();
parkImporter->Import(gameState);
SetProgress(100, 100, STR_STRING_M_PERCENT);
+7 -7
View File
@@ -108,15 +108,15 @@ int32_t Date::GetDaysInMonth(int32_t month)
void OpenRCT2::DateUpdate(GameState_t& gameState)
{
int32_t monthTicks = gameState.Date.monthTicks + kMonthTicksIncrement;
int32_t monthTicks = gameState.date.monthTicks + kMonthTicksIncrement;
if (monthTicks > kMaskMonthTicks)
{
gameState.Date.monthTicks = 0;
gameState.Date.monthsElapsed++;
gameState.date.monthTicks = 0;
gameState.date.monthsElapsed++;
}
else
{
gameState.Date.monthTicks = static_cast<uint16_t>(monthTicks);
gameState.date.monthTicks = static_cast<uint16_t>(monthTicks);
}
}
@@ -147,7 +147,7 @@ void DateUpdateRealTimeOfDay()
Date& GetDate()
{
return GetGameState().Date;
return getGameState().date;
}
/**
@@ -156,7 +156,7 @@ Date& GetDate()
*/
void ResetDate()
{
auto& gameState = GetGameState();
gameState.Date = {};
auto& gameState = getGameState();
gameState.date = {};
gCurrentRealTimeTicks = 0;
}
+38 -38
View File
@@ -102,20 +102,20 @@ namespace OpenRCT2::Editor
auto* context = GetContext();
context->SetActiveScene(context->GetGameScene());
auto& gameState = GetGameState();
auto& gameState = getGameState();
Audio::StopAll();
ObjectListLoad();
gameStateInitAll(gameState, kDefaultMapSize);
gLegacyScene = LegacyScene::scenarioEditor;
gameState.EditorStep = EditorStep::ObjectSelection;
gameState.Park.Flags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
gameState.ScenarioCategory = SCENARIO_CATEGORY_OTHER;
gameState.editorStep = EditorStep::ObjectSelection;
gameState.park.Flags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
gameState.scenarioCategory = SCENARIO_CATEGORY_OTHER;
ViewportInitAll();
WindowBase* mainWindow = OpenEditorWindows();
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
LoadPalette();
gScreenAge = 0;
gameState.ScenarioName = LanguageGetString(STR_MY_NEW_SCENARIO);
gameState.scenarioName = LanguageGetString(STR_MY_NEW_SCENARIO);
}
/**
@@ -144,12 +144,12 @@ namespace OpenRCT2::Editor
return;
}
auto& gameState = GetGameState();
auto& gameState = getGameState();
ScenarioReset(gameState);
gLegacyScene = LegacyScene::scenarioEditor;
gameState.EditorStep = EditorStep::ObjectiveSelection;
gameState.ScenarioCategory = SCENARIO_CATEGORY_OTHER;
gameState.editorStep = EditorStep::ObjectiveSelection;
gameState.scenarioCategory = SCENARIO_CATEGORY_OTHER;
ViewportInitAll();
OpenEditorWindows();
FinaliseMainView();
@@ -172,9 +172,9 @@ namespace OpenRCT2::Editor
ObjectManagerUnloadAllObjects();
ObjectListLoad();
gameStateInitAll(GetGameState(), kDefaultMapSize);
gameStateInitAll(getGameState(), kDefaultMapSize);
SetAllLandOwned();
GetGameState().EditorStep = EditorStep::ObjectSelection;
getGameState().editorStep = EditorStep::ObjectSelection;
ViewportInitAll();
WindowBase* mainWindow = OpenEditorWindows();
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
@@ -197,9 +197,9 @@ namespace OpenRCT2::Editor
ObjectManagerUnloadAllObjects();
ObjectListLoad();
gameStateInitAll(GetGameState(), kDefaultMapSize);
gameStateInitAll(getGameState(), kDefaultMapSize);
SetAllLandOwned();
GetGameState().EditorStep = EditorStep::ObjectSelection;
getGameState().editorStep = EditorStep::ObjectSelection;
ViewportInitAll();
WindowBase* mainWindow = OpenEditorWindows();
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
@@ -212,9 +212,9 @@ namespace OpenRCT2::Editor
*/
static void SetAllLandOwned()
{
auto& gameState = GetGameState();
MapRange range = { 2 * kCoordsXYStep, 2 * kCoordsXYStep, (gameState.MapSize.x - 3) * kCoordsXYStep,
(gameState.MapSize.y - 3) * kCoordsXYStep };
auto& gameState = getGameState();
MapRange range = { 2 * kCoordsXYStep, 2 * kCoordsXYStep, (gameState.mapSize.x - 3) * kCoordsXYStep,
(gameState.mapSize.y - 3) * kCoordsXYStep };
auto landSetRightsAction = LandSetRightsAction(range, LandSetRightSetting::SetForSale);
landSetRightsAction.SetFlags(GAME_COMMAND_FLAG_NO_SPEND);
GameActions::Execute(&landSetRightsAction);
@@ -232,7 +232,7 @@ namespace OpenRCT2::Editor
auto* context = GetContext();
context->SetActiveScene(context->GetGameScene());
GetGameState().EditorStep = EditorStep::LandscapeEditor;
getGameState().editorStep = EditorStep::LandscapeEditor;
gScreenAge = 0;
gLegacyScene = LegacyScene::scenarioEditor;
ViewportInitAll();
@@ -274,39 +274,39 @@ namespace OpenRCT2::Editor
staff->SetName({});
}
auto& gameState = GetGameState();
auto& gameState = getGameState();
ResetAllEntities();
UpdateConsolidatedPatrolAreas();
gameState.NumGuestsInPark = 0;
gameState.NumGuestsHeadingForPark = 0;
gameState.NumGuestsInParkLastWeek = 0;
gameState.GuestChangeModifier = 0;
gameState.numGuestsInPark = 0;
gameState.numGuestsHeadingForPark = 0;
gameState.numGuestsInParkLastWeek = 0;
gameState.guestChangeModifier = 0;
if (fromSave)
{
gameState.Park.Flags |= PARK_FLAGS_NO_MONEY;
gameState.park.Flags |= PARK_FLAGS_NO_MONEY;
if (gameState.Park.EntranceFee == 0)
if (gameState.park.EntranceFee == 0)
{
gameState.Park.Flags |= PARK_FLAGS_PARK_FREE_ENTRY;
gameState.park.Flags |= PARK_FLAGS_PARK_FREE_ENTRY;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_PARK_FREE_ENTRY;
gameState.park.Flags &= ~PARK_FLAGS_PARK_FREE_ENTRY;
}
gameState.Park.Flags &= ~PARK_FLAGS_SPRITES_INITIALISED;
gameState.park.Flags &= ~PARK_FLAGS_SPRITES_INITIALISED;
gameState.GuestInitialCash = std::clamp(gameState.GuestInitialCash, 10.00_GBP, kMaxEntranceFee);
gameState.guestInitialCash = std::clamp(gameState.guestInitialCash, 10.00_GBP, kMaxEntranceFee);
gameState.InitialCash = std::min<money64>(gameState.InitialCash, 100000);
gameState.initialCash = std::min<money64>(gameState.initialCash, 100000);
FinanceResetCashToInitial();
gameState.BankLoan = std::clamp<money64>(gameState.BankLoan, 0.00_GBP, 5000000.00_GBP);
gameState.bankLoan = std::clamp<money64>(gameState.bankLoan, 0.00_GBP, 5000000.00_GBP);
gameState.MaxBankLoan = std::clamp<money64>(gameState.MaxBankLoan, 0.00_GBP, 5000000.00_GBP);
gameState.maxBankLoan = std::clamp<money64>(gameState.maxBankLoan, 0.00_GBP, 5000000.00_GBP);
gameState.BankLoanInterestRate = std::clamp<uint8_t>(gameState.BankLoanInterestRate, 5, MaxBankLoanInterestRate);
gameState.bankLoanInterestRate = std::clamp<uint8_t>(gameState.bankLoanInterestRate, 5, MaxBankLoanInterestRate);
}
ClimateReset();
@@ -327,7 +327,7 @@ namespace OpenRCT2::Editor
auto* windowMgr = Ui::GetWindowManager();
switch (GetGameState().EditorStep)
switch (getGameState().editorStep)
{
case EditorStep::ObjectSelection:
if (windowMgr->FindByClass(WindowClass::EditorObjectSelection) != nullptr)
@@ -383,8 +383,8 @@ namespace OpenRCT2::Editor
static void FinaliseMainView()
{
auto windowManager = Ui::GetWindowManager();
auto& gameState = GetGameState();
windowManager->SetMainView(gameState.SavedView, gameState.SavedViewZoom, gameState.SavedViewRotation);
auto& gameState = getGameState();
windowManager->SetMainView(gameState.savedView, gameState.savedViewZoom, gameState.savedViewRotation);
ResetAllSpriteQuadrantPlacements();
@@ -474,19 +474,19 @@ namespace OpenRCT2::Editor
*/
ResultWithMessage CheckPark()
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
int32_t parkSize = Park::UpdateSize(gameState);
if (parkSize == 0)
{
return { false, STR_PARK_MUST_OWN_SOME_LAND };
}
if (gameState.Park.Entrances.empty())
if (gameState.park.Entrances.empty())
{
return { false, STR_NO_PARK_ENTRANCES };
}
for (const auto& parkEntrance : gameState.Park.Entrances)
for (const auto& parkEntrance : gameState.park.Entrances)
{
int32_t direction = DirectionReverse(parkEntrance.direction);
@@ -504,7 +504,7 @@ namespace OpenRCT2::Editor
}
}
if (gameState.PeepSpawns.empty())
if (gameState.peepSpawns.empty())
{
return { false, STR_PEEP_SPAWNS_NOT_SET };
}
@@ -510,20 +510,20 @@ void ResetSelectedObjectCountAndSize()
void FinishObjectSelection()
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
if (gLegacyScene == LegacyScene::trackDesigner)
{
SetEveryRideTypeInvented();
SetEveryRideEntryInvented();
auto& objManager = OpenRCT2::GetContext()->GetObjectManager();
gameState.LastEntranceStyle = objManager.GetLoadedObjectEntryIndex("rct2.station.plain");
if (gameState.LastEntranceStyle == kObjectEntryIndexNull)
gameState.lastEntranceStyle = objManager.GetLoadedObjectEntryIndex("rct2.station.plain");
if (gameState.lastEntranceStyle == kObjectEntryIndexNull)
{
gameState.LastEntranceStyle = 0;
gameState.lastEntranceStyle = 0;
}
gameState.EditorStep = EditorStep::RollercoasterDesigner;
gameState.editorStep = EditorStep::RollercoasterDesigner;
GfxInvalidateScreen();
}
else
@@ -533,7 +533,7 @@ void FinishObjectSelection()
auto intent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG);
ContextBroadcastIntent(&intent);
gameState.EditorStep = EditorStep::LandscapeEditor;
gameState.editorStep = EditorStep::LandscapeEditor;
GfxInvalidateScreen();
}
}
+14 -14
View File
@@ -183,7 +183,7 @@ void RCT2StringToUTF8Self(char* buffer, size_t length)
static void FixGuestsHeadingToParkCount()
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
uint32_t guestsHeadingToPark = 0;
@@ -195,13 +195,13 @@ static void FixGuestsHeadingToParkCount()
}
}
if (gameState.NumGuestsHeadingForPark != guestsHeadingToPark)
if (gameState.numGuestsHeadingForPark != guestsHeadingToPark)
{
LOG_WARNING(
"Corrected bad amount of guests heading to park: %u -> %u", gameState.NumGuestsHeadingForPark, guestsHeadingToPark);
"Corrected bad amount of guests heading to park: %u -> %u", gameState.numGuestsHeadingForPark, guestsHeadingToPark);
}
gameState.NumGuestsHeadingForPark = guestsHeadingToPark;
gameState.numGuestsHeadingForPark = guestsHeadingToPark;
}
static void FixGuestCount()
@@ -217,13 +217,13 @@ static void FixGuestCount()
}
}
auto& gameState = GetGameState();
if (gameState.NumGuestsInPark != guestCount)
auto& gameState = getGameState();
if (gameState.numGuestsInPark != guestCount)
{
LOG_WARNING("Corrected bad amount of guests in park: %u -> %u", gameState.NumGuestsInPark, guestCount);
LOG_WARNING("Corrected bad amount of guests in park: %u -> %u", gameState.numGuestsInPark, guestCount);
}
gameState.NumGuestsInPark = guestCount;
gameState.numGuestsInPark = guestCount;
}
static void FixPeepsWithInvalidRideReference()
@@ -303,8 +303,8 @@ static void FixInvalidSurfaces()
// Fix the invisible border tiles.
// At this point, we can be sure that surfaceElement is not NULL.
auto& gameState = GetGameState();
if (x == 0 || x == gameState.MapSize.x - 1 || y == 0 || y == gameState.MapSize.y - 1)
auto& gameState = getGameState();
if (x == 0 || x == gameState.mapSize.x - 1 || y == 0 || y == gameState.mapSize.y - 1)
{
surfaceElement->SetBaseZ(kMinimumLandZ);
surfaceElement->SetClearanceZ(kMinimumLandZ);
@@ -367,8 +367,8 @@ void GameLoadInit()
}
auto windowManager = context->GetUiContext()->GetWindowManager();
auto& gameState = GetGameState();
windowManager->SetMainView(gameState.SavedView, gameState.SavedViewZoom, gameState.SavedViewRotation);
auto& gameState = getGameState();
windowManager->SetMainView(gameState.savedView, gameState.savedViewZoom, gameState.savedViewRotation);
if (NetworkGetMode() != NETWORK_MODE_CLIENT)
{
@@ -484,7 +484,7 @@ void SaveGameWithName(u8string_view name)
{
LOG_VERBOSE("Saving to %s", u8string(name).c_str());
auto& gameState = GetGameState();
auto& gameState = getGameState();
if (ScenarioSave(gameState, name, Config::Get().general.SavePluginData ? 1 : 0))
{
LOG_VERBOSE("Saved to %s", u8string(name).c_str());
@@ -608,7 +608,7 @@ void GameAutosave()
File::Copy(path, backupPath, true);
}
auto& gameState = GetGameState();
auto& gameState = getGameState();
if (!ScenarioSave(gameState, path, saveFlags))
Console::Error::WriteLine("Could not autosave the scenario. Is the save folder writeable?");
+12 -12
View File
@@ -36,12 +36,12 @@ namespace OpenRCT2
{
static auto _gameState = std::make_unique<GameState_t>();
GameState_t& GetGameState()
GameState_t& getGameState()
{
return *_gameState;
}
void SwapGameState(std::unique_ptr<GameState_t>& otherState)
void swapGameState(std::unique_ptr<GameState_t>& otherState)
{
_gameState.swap(otherState);
}
@@ -54,7 +54,7 @@ namespace OpenRCT2
PROFILED_FUNCTION();
gInMapInitCode = true;
gameState.CurrentTicks = 0;
gameState.currentTicks = 0;
MapInit(mapSize);
Park::Initialise(gameState);
@@ -69,7 +69,7 @@ namespace OpenRCT2
gInMapInitCode = false;
gameState.NextGuestNumber = 1;
gameState.nextGuestNumber = 1;
ContextInit();
@@ -123,7 +123,7 @@ namespace OpenRCT2
if (NetworkGetMode() == NETWORK_MODE_CLIENT && NetworkGetStatus() == NETWORK_STATUS_CONNECTED
&& NetworkGetAuthstatus() == NetworkAuth::Ok)
{
numUpdates = std::clamp<uint32_t>(NetworkGetServerTick() - GetGameState().CurrentTicks, 0, 10);
numUpdates = std::clamp<uint32_t>(NetworkGetServerTick() - getGameState().currentTicks, 0, 10);
}
else
{
@@ -237,7 +237,7 @@ namespace OpenRCT2
auto& snapshot = snapshots->CreateSnapshot();
snapshots->Capture(snapshot);
snapshots->LinkSnapshot(snapshot, GetGameState().CurrentTicks, ScenarioRandState().s0);
snapshots->LinkSnapshot(snapshot, getGameState().currentTicks, ScenarioRandState().s0);
}
void gameStateUpdateLogic()
@@ -254,7 +254,7 @@ namespace OpenRCT2
NetworkUpdate();
auto& gameState = GetGameState();
auto& gameState = getGameState();
if (NetworkGetMode() == NETWORK_MODE_SERVER)
{
@@ -269,7 +269,7 @@ namespace OpenRCT2
else if (NetworkGetMode() == NETWORK_MODE_CLIENT)
{
// Don't run past the server, this condition can happen during map changes.
if (NetworkGetServerTick() == gameState.CurrentTicks)
if (NetworkGetServerTick() == gameState.currentTicks)
{
gInUpdateCode = false;
return;
@@ -294,7 +294,7 @@ namespace OpenRCT2
#ifdef ENABLE_SCRIPTING
// Stash the current day number before updating the date so that we
// know if the day number changes on this tick.
auto day = gameState.Date.GetDay();
auto day = gameState.date.GetDay();
#endif
DateUpdate(gameState);
@@ -317,7 +317,7 @@ namespace OpenRCT2
if (!isInEditorMode())
{
Park::Update(gameState, gameState.Date);
Park::Update(gameState, gameState.date);
}
ResearchUpdate();
@@ -347,13 +347,13 @@ namespace OpenRCT2
NetworkProcessPending();
NetworkFlush();
gameState.CurrentTicks++;
gameState.currentTicks++;
#ifdef ENABLE_SCRIPTING
auto& hookEngine = GetContext()->GetScriptEngine().GetHookEngine();
hookEngine.Call(HOOK_TYPE::INTERVAL_TICK, true);
if (day != gameState.Date.GetDay())
if (day != gameState.date.GetDay())
{
hookEngine.Call(HOOK_TYPE::INTERVAL_DAY, true);
}
+86 -86
View File
@@ -37,103 +37,103 @@ namespace OpenRCT2
{
struct GameState_t
{
::OpenRCT2::Park::ParkData Park{};
std::string PluginStorage;
uint32_t CurrentTicks{};
::OpenRCT2::Date Date;
money64 CompanyValue;
Park::ParkData park{};
std::string pluginStorage;
uint32_t currentTicks{};
Date date;
money64 companyValue;
// The total profit for the entire scenario that precedes the current financial table.
money64 HistoricalProfit;
money64 ConstructionRightsPrice;
money64 CurrentExpenditure;
money64 CurrentProfit;
uint32_t GuestsInParkHistory[kGuestsInParkHistorySize];
WeatherState WeatherCurrent;
WeatherState WeatherNext;
uint16_t WeatherUpdateTimer;
money64 Cash;
money64 CashHistory[kFinanceHistorySize];
money64 InitialCash;
money64 GuestInitialCash;
uint8_t GuestInitialHappiness;
uint8_t GuestInitialHunger;
uint8_t GuestInitialThirst;
uint8_t GuestChangeModifier;
uint32_t NextGuestNumber;
uint32_t NumGuestsInPark;
uint32_t NumGuestsHeadingForPark;
uint32_t NumGuestsInParkLastWeek;
money64 WeeklyProfitAverageDividend;
uint64_t TotalAdmissions;
money64 TotalIncomeFromAdmissions;
money64 TotalRideValueForMoney;
uint16_t WeeklyProfitAverageDivisor;
money64 WeeklyProfitHistory[kFinanceHistorySize];
Objective ScenarioObjective;
uint16_t ScenarioParkRatingWarningDays;
money64 ScenarioCompletedCompanyValue;
money64 ScenarioCompanyValueRecord;
money64 BankLoan;
uint8_t BankLoanInterestRate;
money64 MaxBankLoan;
money64 ExpenditureTable[kExpenditureTableMonthCount][EnumValue(ExpenditureType::Count)];
random_engine_t ScenarioRand;
TileCoordsXY MapSize;
money64 LandPrice;
money64 historicalProfit;
money64 constructionRightsPrice;
money64 currentExpenditure;
money64 currentProfit;
uint32_t guestsInParkHistory[kGuestsInParkHistorySize];
WeatherState weatherCurrent;
WeatherState weatherNext;
uint16_t weatherUpdateTimer;
money64 cash;
money64 cashHistory[kFinanceHistorySize];
money64 initialCash;
money64 guestInitialCash;
uint8_t guestInitialHappiness;
uint8_t guestInitialHunger;
uint8_t guestInitialThirst;
uint8_t guestChangeModifier;
uint32_t nextGuestNumber;
uint32_t numGuestsInPark;
uint32_t numGuestsHeadingForPark;
uint32_t numGuestsInParkLastWeek;
money64 weeklyProfitAverageDividend;
uint64_t totalAdmissions;
money64 totalIncomeFromAdmissions;
money64 totalRideValueForMoney;
uint16_t weeklyProfitAverageDivisor;
money64 weeklyProfitHistory[kFinanceHistorySize];
Objective scenarioObjective;
uint16_t scenarioParkRatingWarningDays;
money64 scenarioCompletedCompanyValue;
money64 scenarioCompanyValueRecord;
money64 bankLoan;
uint8_t bankLoanInterestRate;
money64 maxBankLoan;
money64 expenditureTable[kExpenditureTableMonthCount][EnumValue(ExpenditureType::Count)];
random_engine_t scenarioRand;
TileCoordsXY mapSize;
money64 landPrice;
::EditorStep EditorStep;
EditorStep editorStep;
SCENARIO_CATEGORY ScenarioCategory;
std::string ScenarioName;
std::string ScenarioDetails;
std::string ScenarioCompletedBy;
std::string ScenarioFileName;
SCENARIO_CATEGORY scenarioCategory;
std::string scenarioName;
std::string scenarioDetails;
std::string scenarioCompletedBy;
std::string scenarioFileName;
std::vector<Banner> Banners;
Entity_t Entities[kMaxEntities]{};
std::vector<Banner> banners;
Entity_t entities[kMaxEntities]{};
// Ride storage for all the rides in the park, rides with RideId::Null are considered free.
std::array<Ride, OpenRCT2::Limits::kMaxRidesInPark> Rides{};
size_t RidesEndOfUsedRange{};
::RideRatingUpdateStates RideRatingUpdateStates;
std::vector<TileElement> TileElements;
std::array<Ride, OpenRCT2::Limits::kMaxRidesInPark> rides{};
size_t ridesEndOfUsedRange{};
RideRatingUpdateStates rideRatingUpdateStates;
std::vector<TileElement> tileElements;
std::vector<ScenerySelection> RestrictedScenery;
std::vector<ScenerySelection> restrictedScenery;
std::vector<PeepSpawn> PeepSpawns;
uint8_t PeepWarningThrottle[16];
std::vector<PeepSpawn> peepSpawns;
uint8_t peepWarningThrottle[16];
News::ItemQueues NewsItems;
News::ItemQueues newsItems;
uint16_t GrassSceneryTileLoopPosition;
CoordsXY WidePathTileLoopPosition;
uint16_t grassSceneryTileLoopPosition;
CoordsXY widePathTileLoopPosition;
colour_t StaffHandymanColour;
colour_t StaffMechanicColour;
colour_t StaffSecurityColour;
uint64_t SamePriceThroughoutPark{};
colour_t staffHandymanColour;
colour_t staffMechanicColour;
colour_t staffSecurityColour;
uint64_t samePriceThroughoutPark{};
uint8_t ResearchFundingLevel;
uint8_t ResearchPriorities;
uint16_t ResearchProgress;
uint8_t ResearchProgressStage;
uint8_t ResearchExpectedMonth;
uint8_t ResearchExpectedDay;
std::optional<ResearchItem> ResearchLastItem;
std::optional<ResearchItem> ResearchNextItem;
uint8_t researchFundingLevel;
uint8_t researchPriorities;
uint16_t researchProgress;
uint8_t researchProgressStage;
uint8_t researchExpectedMonth;
uint8_t researchExpectedDay;
std::optional<ResearchItem> researchLastItem;
std::optional<ResearchItem> researchNextItem;
std::vector<ResearchItem> ResearchItemsUninvented;
std::vector<ResearchItem> ResearchItemsInvented;
uint8_t ResearchUncompletedCategories;
std::vector<ResearchItem> researchItemsUninvented;
std::vector<ResearchItem> researchItemsInvented;
uint8_t researchUncompletedCategories;
ScreenCoordsXY SavedView;
uint8_t SavedViewRotation;
ZoomLevel SavedViewZoom;
ScreenCoordsXY savedView;
uint8_t savedViewRotation;
ZoomLevel savedViewZoom;
ObjectEntryIndex LastEntranceStyle;
ObjectEntryIndex lastEntranceStyle;
std::vector<Award> CurrentAwards;
std::vector<Award> currentAwards;
std::vector<MarketingCampaign> MarketingCampaigns;
std::vector<MarketingCampaign> marketingCampaigns;
/**
* Probability out of 65535, of gaining a new guest per game tick.
@@ -141,17 +141,17 @@ namespace OpenRCT2
* With a full park rating, non-overpriced entrance fee, less guests than the suggested maximum and four positive
* awards, approximately 1 guest per second can be generated (+60 guests in one minute).
*/
int32_t GuestGenerationProbability;
int32_t guestGenerationProbability;
/**
* In a difficult guest generation scenario, no guests will be generated if over this value.
*/
uint32_t SuggestedGuestMaximum;
uint32_t suggestedGuestMaximum;
CheatsState Cheats;
CheatsState cheats;
};
GameState_t& GetGameState();
void SwapGameState(std::unique_ptr<GameState_t>& otherState);
GameState_t& getGameState();
void swapGameState(std::unique_ptr<GameState_t>& otherState);
void gameStateInitAll(GameState_t& gameState, const TileCoordsXY& mapSize);
void gameStateTick();
+15 -15
View File
@@ -161,7 +161,7 @@ namespace OpenRCT2
if (_mode == ReplayMode::NONE)
return;
const auto currentTicks = GetGameState().CurrentTicks;
const auto currentTicks = getGameState().currentTicks;
if ((_mode == ReplayMode::RECORDING || _mode == ReplayMode::NORMALISATION) && currentTicks == _nextChecksumTick)
{
@@ -221,7 +221,7 @@ namespace OpenRCT2
auto& snapshot = snapshots->CreateSnapshot();
snapshots->Capture(snapshot);
snapshots->LinkSnapshot(snapshot, GetGameState().CurrentTicks, ScenarioRandState().s0);
snapshots->LinkSnapshot(snapshot, getGameState().currentTicks, ScenarioRandState().s0);
DataSerialiser snapShotDs(true, snapshotStream);
snapshots->SerialiseSnapshot(snapshot, snapShotDs);
}
@@ -237,8 +237,8 @@ namespace OpenRCT2
if (_mode != ReplayMode::NONE && _mode != ReplayMode::NORMALISATION)
return false;
auto& gameState = GetGameState();
const auto currentTicks = gameState.CurrentTicks;
auto& gameState = getGameState();
const auto currentTicks = gameState.currentTicks;
auto replayData = std::make_unique<ReplayRecordData>();
replayData->magic = kReplayMagic;
@@ -293,7 +293,7 @@ namespace OpenRCT2
return true;
}
const auto currentTicks = GetGameState().CurrentTicks;
const auto currentTicks = getGameState().currentTicks;
_currentRecording->tickEnd = currentTicks;
@@ -378,7 +378,7 @@ namespace OpenRCT2
info.Version = data->version;
info.TimeRecorded = data->timeRecorded;
if (_mode == ReplayMode::RECORDING)
info.Ticks = GetGameState().CurrentTicks - data->tickStart;
info.Ticks = getGameState().currentTicks - data->tickStart;
else if (_mode == ReplayMode::PLAYING)
info.Ticks = data->tickEnd - data->tickStart;
info.NumCommands = static_cast<uint32_t>(data->commands.size());
@@ -396,7 +396,7 @@ namespace OpenRCT2
GameStateSnapshot_t& replaySnapshot = snapshots->CreateSnapshot();
snapshots->SerialiseSnapshot(replaySnapshot, ds);
const auto currentTicks = GetGameState().CurrentTicks;
const auto currentTicks = getGameState().currentTicks;
auto& localSnapshot = snapshots->CreateSnapshot();
snapshots->Capture(localSnapshot);
@@ -447,7 +447,7 @@ namespace OpenRCT2
return false;
}
GetGameState().CurrentTicks = replayData->tickStart;
getGameState().currentTicks = replayData->tickStart;
LoadAndCompareSnapshot(replayData->gameStateSnapshots);
@@ -509,7 +509,7 @@ namespace OpenRCT2
return false;
}
_nextReplayTick = GetGameState().CurrentTicks + 1;
_nextReplayTick = getGameState().currentTicks + 1;
return true;
}
@@ -541,7 +541,7 @@ namespace OpenRCT2
objManager.LoadObjects(loadResult.RequiredObjects);
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = GetGameState();
auto& gameState = getGameState();
importer->Import(gameState);
EntityTweener::Get().Reset();
@@ -669,10 +669,10 @@ namespace OpenRCT2
bool SerialiseParkParameters(DataSerialiser& serialiser)
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
serialiser << gameState.GuestGenerationProbability;
serialiser << gameState.SuggestedGuestMaximum;
serialiser << gameState.guestGenerationProbability;
serialiser << gameState.suggestedGuestMaximum;
serialiser << Config::Get().general.ShowRealNamesOfGuests;
// To make this a little bit less volatile against updates
@@ -806,7 +806,7 @@ namespace OpenRCT2
if (checksumIndex >= _currentReplay->checksums.size())
return;
const auto currentTicks = GetGameState().CurrentTicks;
const auto currentTicks = getGameState().currentTicks;
const auto& savedChecksum = _currentReplay->checksums[checksumIndex];
if (_currentReplay->checksums[checksumIndex].first == currentTicks)
@@ -840,7 +840,7 @@ namespace OpenRCT2
{
auto& replayQueue = _currentReplay->commands;
const auto currentTicks = GetGameState().CurrentTicks;
const auto currentTicks = getGameState().currentTicks;
while (replayQueue.begin() != replayQueue.end())
{
+40 -40
View File
@@ -105,59 +105,59 @@ GameActions::Result CheatSetAction::Query() const
GameActions::Result CheatSetAction::Execute() const
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
auto* windowMgr = Ui::GetWindowManager();
switch (static_cast<CheatType>(_cheatType.id))
{
case CheatType::SandboxMode:
gameState.Cheats.sandboxMode = _param1 != 0;
gameState.cheats.sandboxMode = _param1 != 0;
windowMgr->InvalidateByClass(WindowClass::Map);
windowMgr->InvalidateByClass(WindowClass::Footpath);
break;
case CheatType::DisableClearanceChecks:
gameState.Cheats.disableClearanceChecks = _param1 != 0;
gameState.cheats.disableClearanceChecks = _param1 != 0;
// Required to update the clearance checks overlay on the Cheats button.
windowMgr->InvalidateByClass(WindowClass::TopToolbar);
break;
case CheatType::DisableSupportLimits:
gameState.Cheats.disableSupportLimits = _param1 != 0;
gameState.cheats.disableSupportLimits = _param1 != 0;
break;
case CheatType::ShowAllOperatingModes:
gameState.Cheats.showAllOperatingModes = _param1 != 0;
gameState.cheats.showAllOperatingModes = _param1 != 0;
break;
case CheatType::ShowVehiclesFromOtherTrackTypes:
gameState.Cheats.showVehiclesFromOtherTrackTypes = _param1 != 0;
gameState.cheats.showVehiclesFromOtherTrackTypes = _param1 != 0;
break;
case CheatType::FastLiftHill:
gameState.Cheats.unlockOperatingLimits = _param1 != 0;
gameState.cheats.unlockOperatingLimits = _param1 != 0;
break;
case CheatType::DisableBrakesFailure:
gameState.Cheats.disableBrakesFailure = _param1 != 0;
gameState.cheats.disableBrakesFailure = _param1 != 0;
break;
case CheatType::DisableAllBreakdowns:
gameState.Cheats.disableAllBreakdowns = _param1 != 0;
gameState.cheats.disableAllBreakdowns = _param1 != 0;
break;
case CheatType::DisableTrainLengthLimit:
gameState.Cheats.disableTrainLengthLimit = _param1 != 0;
gameState.cheats.disableTrainLengthLimit = _param1 != 0;
break;
case CheatType::EnableChainLiftOnAllTrack:
gameState.Cheats.enableChainLiftOnAllTrack = _param1 != 0;
gameState.cheats.enableChainLiftOnAllTrack = _param1 != 0;
break;
case CheatType::BuildInPauseMode:
gameState.Cheats.buildInPauseMode = _param1 != 0;
gameState.cheats.buildInPauseMode = _param1 != 0;
break;
case CheatType::IgnoreRideIntensity:
gameState.Cheats.ignoreRideIntensity = _param1 != 0;
gameState.cheats.ignoreRideIntensity = _param1 != 0;
break;
case CheatType::IgnorePrice:
gameState.Cheats.ignorePrice = _param1 != 0;
gameState.cheats.ignorePrice = _param1 != 0;
break;
case CheatType::DisableVandalism:
gameState.Cheats.disableVandalism = _param1 != 0;
gameState.cheats.disableVandalism = _param1 != 0;
break;
case CheatType::DisableLittering:
gameState.Cheats.disableLittering = _param1 != 0;
gameState.cheats.disableLittering = _param1 != 0;
break;
case CheatType::NoMoney:
SetScenarioNoMoney(_param1 != 0);
@@ -196,7 +196,7 @@ GameActions::Result CheatSetAction::Execute() const
RemoveLitter();
break;
case CheatType::DisablePlantAging:
gameState.Cheats.disablePlantAging = _param1 != 0;
gameState.cheats.disablePlantAging = _param1 != 0;
break;
case CheatType::SetStaffSpeed:
SetStaffSpeed(_param1);
@@ -205,7 +205,7 @@ GameActions::Result CheatSetAction::Execute() const
RenewRides();
break;
case CheatType::MakeDestructible:
gameState.Cheats.makeAllDestructible = _param1 != 0;
gameState.cheats.makeAllDestructible = _param1 != 0;
windowMgr->InvalidateByClass(WindowClass::Ride);
break;
case CheatType::FixRides:
@@ -225,35 +225,35 @@ GameActions::Result CheatSetAction::Execute() const
ClimateForceWeather(WeatherType{ static_cast<uint8_t>(_param1) });
break;
case CheatType::FreezeWeather:
gameState.Cheats.freezeWeather = _param1 != 0;
gameState.cheats.freezeWeather = _param1 != 0;
break;
case CheatType::NeverendingMarketing:
gameState.Cheats.neverendingMarketing = _param1 != 0;
gameState.cheats.neverendingMarketing = _param1 != 0;
break;
case CheatType::OpenClosePark:
ParkSetOpen(!gameState.Park.IsOpen());
ParkSetOpen(!gameState.park.IsOpen());
break;
case CheatType::HaveFun:
gameState.ScenarioObjective.Type = OBJECTIVE_HAVE_FUN;
gameState.scenarioObjective.Type = OBJECTIVE_HAVE_FUN;
break;
case CheatType::SetForcedParkRating:
Park::SetForcedRating(_param1);
break;
case CheatType::AllowArbitraryRideTypeChanges:
gameState.Cheats.allowArbitraryRideTypeChanges = _param1 != 0;
gameState.cheats.allowArbitraryRideTypeChanges = _param1 != 0;
windowMgr->InvalidateByClass(WindowClass::Ride);
break;
case CheatType::OwnAllLand:
OwnAllLand();
break;
case CheatType::DisableRideValueAging:
gameState.Cheats.disableRideValueAging = _param1 != 0;
gameState.cheats.disableRideValueAging = _param1 != 0;
break;
case CheatType::IgnoreResearchStatus:
gameState.Cheats.ignoreResearchStatus = _param1 != 0;
gameState.cheats.ignoreResearchStatus = _param1 != 0;
break;
case CheatType::EnableAllDrawableTrackPieces:
gameState.Cheats.enableAllDrawableTrackPieces = _param1 != 0;
gameState.cheats.enableAllDrawableTrackPieces = _param1 != 0;
break;
case CheatType::CreateDucks:
CreateDucks(_param1);
@@ -262,13 +262,13 @@ GameActions::Result CheatSetAction::Execute() const
Duck::RemoveAll();
break;
case CheatType::AllowTrackPlaceInvalidHeights:
gameState.Cheats.allowTrackPlaceInvalidHeights = _param1 != 0;
gameState.cheats.allowTrackPlaceInvalidHeights = _param1 != 0;
break;
case CheatType::AllowRegularPathAsQueue:
gameState.Cheats.allowRegularPathAsQueue = _param1 != 0;
gameState.cheats.allowRegularPathAsQueue = _param1 != 0;
break;
case CheatType::AllowSpecialColourSchemes:
gameState.Cheats.allowSpecialColourSchemes = static_cast<bool>(_param1);
gameState.cheats.allowSpecialColourSchemes = static_cast<bool>(_param1);
break;
case CheatType::RemoveParkFences:
RemoveParkFences();
@@ -437,10 +437,10 @@ ParametersRange CheatSetAction::GetParameterRange(CheatType cheatType) const
void CheatSetAction::SetGrassLength(int32_t length) const
{
auto& gameState = GetGameState();
for (int32_t y = 0; y < gameState.MapSize.y; y++)
auto& gameState = getGameState();
for (int32_t y = 0; y < gameState.mapSize.y; y++)
{
for (int32_t x = 0; x < gameState.MapSize.x; x++)
for (int32_t x = 0; x < gameState.mapSize.x; x++)
{
auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y });
if (surfaceElement == nullptr)
@@ -581,14 +581,14 @@ void CheatSetAction::Set10MinuteInspection() const
void CheatSetAction::SetScenarioNoMoney(bool enabled) const
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
if (enabled)
{
gameState.Park.Flags |= PARK_FLAGS_NO_MONEY;
gameState.park.Flags |= PARK_FLAGS_NO_MONEY;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_NO_MONEY;
gameState.park.Flags &= ~PARK_FLAGS_NO_MONEY;
}
// Invalidate all windows that have anything to do with finance
@@ -604,7 +604,7 @@ void CheatSetAction::SetScenarioNoMoney(bool enabled) const
void CheatSetAction::SetMoney(money64 amount) const
{
GetGameState().Cash = amount;
getGameState().cash = amount;
auto* windowMgr = Ui::GetWindowManager();
windowMgr->InvalidateByClass(WindowClass::Finances);
@@ -613,8 +613,8 @@ void CheatSetAction::SetMoney(money64 amount) const
void CheatSetAction::AddMoney(money64 amount) const
{
auto& gameState = GetGameState();
gameState.Cash = AddClamp<money64>(gameState.Cash, amount);
auto& gameState = getGameState();
gameState.cash = AddClamp<money64>(gameState.cash, amount);
auto* windowMgr = Ui::GetWindowManager();
windowMgr->InvalidateByClass(WindowClass::Finances);
@@ -624,7 +624,7 @@ void CheatSetAction::AddMoney(money64 amount) const
void CheatSetAction::ClearLoan() const
{
// First give money
AddMoney(GetGameState().BankLoan);
AddMoney(getGameState().bankLoan);
// Then pay the loan
auto gameAction = ParkSetLoanAction(0.00_GBP);
@@ -809,7 +809,7 @@ void CheatSetAction::OwnAllLand() const
}
// Completely unown peep spawn points
for (const auto& spawn : GetGameState().PeepSpawns)
for (const auto& spawn : getGameState().peepSpawns)
{
auto* surfaceElement = MapGetSurfaceElementAt(spawn);
if (surfaceElement != nullptr)
+4 -4
View File
@@ -220,11 +220,11 @@ money64 ClearAction::ClearSceneryFromTile(const CoordsXY& tilePos, bool executin
void ClearAction::ResetClearLargeSceneryFlag()
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
// TODO: Improve efficiency of this
for (int32_t y = 0; y < gameState.MapSize.y; y++)
for (int32_t y = 0; y < gameState.mapSize.y; y++)
{
for (int32_t x = 0; x < gameState.MapSize.x; x++)
for (int32_t x = 0; x < gameState.mapSize.x; x++)
{
auto tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y });
do
@@ -242,6 +242,6 @@ void ClearAction::ResetClearLargeSceneryFlag()
bool ClearAction::MapCanClearAt(const CoordsXY& location)
{
return gLegacyScene == LegacyScene::scenarioEditor || GetGameState().Cheats.sandboxMode
return gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode
|| MapIsLocationOwnedOrHasRights(location);
}
@@ -60,7 +60,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
}
if (!(gLegacyScene == LegacyScene::scenarioEditor || GetGameState().Cheats.sandboxMode) && !MapIsLocationOwned(_loc))
if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc))
{
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
@@ -52,7 +52,7 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
}
if (!(gLegacyScene == LegacyScene::scenarioEditor || GetGameState().Cheats.sandboxMode) && !MapIsLocationOwned(_loc))
if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc))
{
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}
@@ -78,7 +78,7 @@ GameActions::Result FootpathLayoutPlaceAction::Query() const
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP);
}
if (!(gLegacyScene == LegacyScene::scenarioEditor || GetGameState().Cheats.sandboxMode) && !MapIsLocationOwned(_loc))
if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc))
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
@@ -168,7 +168,7 @@ GameActions::Result FootpathLayoutPlaceAction::ElementInsertQuery(GameActions::R
const auto clearanceData = canBuild.GetData<ConstructClearResult>();
gFootpathGroundFlags = clearanceData.GroundFlags;
if (!GetGameState().Cheats.disableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER))
if (!getGameState().cheats.disableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER))
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
+7 -7
View File
@@ -86,7 +86,7 @@ GameActions::Result FootpathPlaceAction::Query() const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_OFF_EDGE_OF_MAP);
}
if (!(gLegacyScene == LegacyScene::scenarioEditor || GetGameState().Cheats.sandboxMode) && !MapIsLocationOwned(_loc))
if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc))
{
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
@@ -143,7 +143,7 @@ GameActions::Result FootpathPlaceAction::Execute() const
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{
if (_direction != INVALID_DIRECTION && !GetGameState().Cheats.disableClearanceChecks)
if (_direction != INVALID_DIRECTION && !getGameState().cheats.disableClearanceChecks)
{
// It is possible, let's remove walls between the old and new piece of path
auto zLow = _loc.z;
@@ -323,7 +323,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result
const auto clearanceData = canBuild.GetData<ConstructClearResult>();
gFootpathGroundFlags = clearanceData.GroundFlags;
if (!GetGameState().Cheats.disableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER))
if (!getGameState().cheats.disableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER))
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
@@ -484,12 +484,12 @@ void FootpathPlaceAction::AutomaticallySetPeepSpawn() const
}
}
auto& gameState = GetGameState();
if (gameState.PeepSpawns.empty())
auto& gameState = getGameState();
if (gameState.peepSpawns.empty())
{
gameState.PeepSpawns.emplace_back();
gameState.peepSpawns.emplace_back();
}
PeepSpawn* peepSpawn = &gameState.PeepSpawns[0];
PeepSpawn* peepSpawn = &gameState.peepSpawns[0];
peepSpawn->x = _loc.x + (DirectionOffsets[direction].x * 15) + 16;
peepSpawn->y = _loc.y + (DirectionOffsets[direction].y * 15) + 16;
peepSpawn->direction = direction;
@@ -59,7 +59,7 @@ GameActions::Result FootpathRemoveAction::Query() const
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_OFF_EDGE_OF_MAP);
}
if (!(gLegacyScene == LegacyScene::scenarioEditor || GetGameState().Cheats.sandboxMode) && !MapIsLocationOwned(_loc))
if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc))
{
return GameActions::Result(
GameActions::Status::NotOwned, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_LAND_NOT_OWNED_BY_PARK);
@@ -104,17 +104,17 @@ GameActions::Result FootpathRemoveAction::Execute() const
TileElementRemove(footpathElement);
FootpathUpdateQueueChains();
auto& gameState = GetGameState();
auto& gameState = getGameState();
// Remove the spawn point (if there is one in the current tile)
gameState.PeepSpawns.erase(
gameState.peepSpawns.erase(
std::remove_if(
gameState.PeepSpawns.begin(), gameState.PeepSpawns.end(),
gameState.peepSpawns.begin(), gameState.peepSpawns.end(),
[this](const CoordsXYZ& spawn) {
{
return spawn.ToTileStart() == _loc.ToTileStart();
}
}),
gameState.PeepSpawns.end());
gameState.peepSpawns.end());
}
else
{
+5 -5
View File
@@ -99,7 +99,7 @@ namespace OpenRCT2::GameActions
return;
}
const uint32_t currentTick = GetGameState().CurrentTicks;
const uint32_t currentTick = getGameState().currentTicks;
while (_actionQueue.begin() != _actionQueue.end())
{
@@ -181,7 +181,7 @@ namespace OpenRCT2::GameActions
{
if (gGamePaused == 0)
return true;
if (GetGameState().Cheats.buildInPauseMode)
if (getGameState().cheats.buildInPauseMode)
return true;
if (actionFlags & GameActions::Flags::AllowWhilePaused)
return true;
@@ -249,7 +249,7 @@ namespace OpenRCT2::GameActions
char temp[128] = {};
snprintf(
temp, sizeof(temp), "[%s] Tick: %u, GA: %s (%08X) (", GetRealm(), GetGameState().CurrentTicks, action->GetName(),
temp, sizeof(temp), "[%s] Tick: %u, GA: %s (%08X) (", GetRealm(), getGameState().currentTicks, action->GetName(),
EnumValue(action->GetType()));
output.Write(temp, strlen(temp));
@@ -343,7 +343,7 @@ namespace OpenRCT2::GameActions
if (!(actionFlags & GameActions::Flags::ClientOnly) && !(flags & GAME_COMMAND_FLAG_NETWORKED))
{
LOG_VERBOSE("[%s] GameAction::Execute %s (Queue)", GetRealm(), action->GetName());
Enqueue(action, GetGameState().CurrentTicks);
Enqueue(action, getGameState().currentTicks);
return result;
}
@@ -413,7 +413,7 @@ namespace OpenRCT2::GameActions
}
if (recordAction)
{
replayManager->AddGameAction(GetGameState().CurrentTicks, action);
replayManager->AddGameAction(getGameState().currentTicks, action);
}
}
}
+2 -2
View File
@@ -143,7 +143,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY&
surfaceElement->SetOwnership(OWNERSHIP_OWNED);
Park::UpdateFencesAroundTile(loc);
}
res.Cost = GetGameState().LandPrice;
res.Cost = getGameState().landPrice;
return res;
case LandBuyRightSetting::BuyConstructionRights: // 2
@@ -165,7 +165,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY&
uint16_t baseZ = surfaceElement->GetBaseZ();
MapInvalidateTile({ loc, baseZ, baseZ + 16 });
}
res.Cost = GetGameState().ConstructionRightsPrice;
res.Cost = getGameState().constructionRightsPrice;
return res;
default:
+1 -1
View File
@@ -95,7 +95,7 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const
if (surfaceElement == nullptr)
continue;
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
+1 -1
View File
@@ -96,7 +96,7 @@ GameActions::Result LandRaiseAction::QueryExecute(bool isExecuting) const
if (surfaceElement == nullptr)
continue;
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
+8 -8
View File
@@ -59,8 +59,8 @@ void LandSetHeightAction::Serialise(DataSerialiser& stream)
GameActions::Result LandSetHeightAction::Query() const
{
auto& gameState = GetGameState();
if (gameState.Park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES)
auto& gameState = getGameState();
if (gameState.park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES)
{
return GameActions::Result(GameActions::Status::Disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY, kStringIdNone);
}
@@ -71,7 +71,7 @@ GameActions::Result LandSetHeightAction::Query() const
return GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, errorMessage);
}
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode)
{
if (!MapIsLocationInPark(_coords))
{
@@ -80,9 +80,9 @@ GameActions::Result LandSetHeightAction::Query() const
}
money64 sceneryRemovalCost = 0;
if (!gameState.Cheats.disableClearanceChecks)
if (!gameState.cheats.disableClearanceChecks)
{
if (gameState.Park.Flags & PARK_FLAGS_FORBID_TREE_REMOVAL)
if (gameState.park.Flags & PARK_FLAGS_FORBID_TREE_REMOVAL)
{
// Check for obstructing large trees
TileElement* tileElement = CheckTreeObstructions();
@@ -97,7 +97,7 @@ GameActions::Result LandSetHeightAction::Query() const
}
// Check for ride support limits
if (!gameState.Cheats.disableSupportLimits)
if (!gameState.cheats.disableSupportLimits)
{
errorMessage = CheckRideSupports();
if (errorMessage != kStringIdNone)
@@ -128,7 +128,7 @@ GameActions::Result LandSetHeightAction::Query() const
return res;
}
if (!gameState.Cheats.disableClearanceChecks)
if (!gameState.cheats.disableClearanceChecks)
{
uint8_t zCorner = _height;
if (_style & kTileSlopeRaisedCornersMask)
@@ -161,7 +161,7 @@ GameActions::Result LandSetHeightAction::Execute() const
auto surfaceHeight = TileElementHeight(_coords);
FootpathRemoveLitter({ _coords, surfaceHeight });
if (!GetGameState().Cheats.disableClearanceChecks)
if (!getGameState().cheats.disableClearanceChecks)
{
WallRemoveAt({ _coords, _height * 8 - 16, _height * 8 + 32 });
cost += GetSmallSceneryRemovalCost();
+9 -9
View File
@@ -84,7 +84,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const
res.Position = centre;
res.Expenditure = ExpenditureType::LandPurchase;
if (!isInEditorMode() && !GetGameState().Cheats.sandboxMode)
if (!isInEditorMode() && !getGameState().cheats.sandboxMode)
{
return GameActions::Result(GameActions::Status::NotInEditorMode, kStringIdNone, STR_LAND_NOT_FOR_SALE);
}
@@ -185,7 +185,7 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY&
}
}
auto& gameState = GetGameState();
auto& gameState = getGameState();
const uint8_t currentOwnership = surfaceElement->GetOwnership();
// Are land rights or construction rights currently owned?
@@ -193,36 +193,36 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY&
{
// Buying land
if (!(currentOwnership & OWNERSHIP_OWNED) && (_ownership & OWNERSHIP_OWNED))
res.Cost = gameState.LandPrice;
res.Cost = gameState.landPrice;
// Buying construction rights
if (!(currentOwnership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED)
&& (_ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED))
res.Cost = gameState.ConstructionRightsPrice;
res.Cost = gameState.constructionRightsPrice;
}
else
{
// Selling land
if ((currentOwnership & OWNERSHIP_OWNED) && !(_ownership & OWNERSHIP_OWNED))
res.Cost = -gameState.LandPrice;
res.Cost = -gameState.landPrice;
// Selling construction rights
if ((currentOwnership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED)
&& !(_ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED))
res.Cost = -gameState.ConstructionRightsPrice;
res.Cost = -gameState.constructionRightsPrice;
}
if (isExecuting)
{
if (_ownership != OWNERSHIP_UNOWNED)
{
gameState.PeepSpawns.erase(
gameState.peepSpawns.erase(
std::remove_if(
gameState.PeepSpawns.begin(), gameState.PeepSpawns.end(),
gameState.peepSpawns.begin(), gameState.peepSpawns.end(),
[x = loc.x, y = loc.y](const auto& spawn) {
return floor2(spawn.x, 32) == x && floor2(spawn.y, 32) == y;
}),
gameState.PeepSpawns.end());
gameState.peepSpawns.end());
}
surfaceElement->SetOwnership(_ownership);
Park::UpdateFencesAroundTile(loc);
@@ -74,7 +74,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const
auto resultData = LargeSceneryPlaceActionResult{};
auto& gameState = GetGameState();
auto& gameState = getGameState();
money64 supportsCost = 0;
@@ -152,7 +152,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const
const auto clearanceData = canBuild.GetData<ConstructClearResult>();
int32_t tempSceneryGroundFlags = clearanceData.GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND);
if (!gameState.Cheats.disableClearanceChecks)
if (!gameState.cheats.disableClearanceChecks)
{
if ((clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) || (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND))
{
@@ -175,7 +175,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const
}
if (gLegacyScene != LegacyScene::scenarioEditor && !MapIsLocationOwned({ curTile, zLow })
&& !gameState.Cheats.sandboxMode)
&& !gameState.cheats.sandboxMode)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
@@ -297,7 +297,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{
FootpathRemoveLitter({ curTile, zLow });
if (!GetGameState().Cheats.disableClearanceChecks)
if (!getGameState().cheats.disableClearanceChecks)
{
WallRemoveAt({ curTile, zLow, zHigh });
}
@@ -88,9 +88,9 @@ GameActions::Result LargeSceneryRemoveAction::Query() const
auto currentTile = CoordsXYZ{ firstTile.x, firstTile.y, firstTile.z } + currentTileRotatedOffset;
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (GetGameState().Park.Flags & PARK_FLAGS_FORBID_TREE_REMOVAL)
if (getGameState().park.Flags & PARK_FLAGS_FORBID_TREE_REMOVAL)
{
if (sceneryEntry->HasFlag(LARGE_SCENERY_FLAG_IS_TREE))
{
@@ -168,7 +168,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const
auto currentTile = CoordsXYZ{ firstTile.x, firstTile.y, firstTile.z } + rotatedCurrentTile;
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (!MapIsLocationOwned({ currentTile.x, currentTile.y, currentTile.z }))
{
@@ -127,7 +127,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting)
auto rotatedTileCoords = CoordsXYZ{ CoordsXY{ tile.offset }.Rotate(_loc.direction), tile.offset.z };
auto currentTile = CoordsXYZ{ baseTile.x, baseTile.y, baseTile.z } + rotatedTileCoords;
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (!MapIsLocationOwned(currentTile))
{
+7 -7
View File
@@ -59,16 +59,16 @@ GameActions::Result MapChangeSizeAction::Query() const
GameActions::Result MapChangeSizeAction::Execute() const
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
// Expand map
while (_targetSize.x > gameState.MapSize.x)
while (_targetSize.x > gameState.mapSize.x)
{
gameState.MapSize.x++;
gameState.mapSize.x++;
MapExtendBoundarySurfaceX();
}
while (_targetSize.y > gameState.MapSize.y)
while (_targetSize.y > gameState.mapSize.y)
{
gameState.MapSize.y++;
gameState.mapSize.y++;
MapExtendBoundarySurfaceY();
}
@@ -76,9 +76,9 @@ GameActions::Result MapChangeSizeAction::Execute() const
ShiftMap(_shift);
// Shrink map
if (_targetSize.x < gameState.MapSize.x || _targetSize.y < gameState.MapSize.y)
if (_targetSize.x < gameState.mapSize.x || _targetSize.y < gameState.mapSize.y)
{
gameState.MapSize = _targetSize;
gameState.mapSize = _targetSize;
MapRemoveOutOfRangeElements();
}
@@ -64,8 +64,8 @@ GameActions::Result MazePlaceTrackAction::Query() const
res.ErrorMessage = STR_OFF_EDGE_OF_MAP;
return res;
}
auto& gameState = GetGameState();
if (!MapIsLocationOwned(_loc) && !gameState.Cheats.sandboxMode)
auto& gameState = getGameState();
if (!MapIsLocationOwned(_loc) && !gameState.cheats.sandboxMode)
{
res.Error = GameActions::Status::NotOwned;
res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK;
@@ -90,7 +90,7 @@ GameActions::Result MazePlaceTrackAction::Query() const
auto clearanceHeight = _loc.z + kMazeClearanceHeight;
auto heightDifference = baseHeight - surfaceElement->GetBaseZ();
if (heightDifference >= 0 && !gameState.Cheats.disableSupportLimits)
if (heightDifference >= 0 && !gameState.cheats.disableSupportLimits)
{
heightDifference /= kCoordsZPerTinyZ;
+3 -3
View File
@@ -99,8 +99,8 @@ GameActions::Result MazeSetTrackAction::Query() const
res.ErrorMessage = STR_OFF_EDGE_OF_MAP;
return res;
}
auto& gameState = GetGameState();
if (!MapIsLocationOwned(_loc) && !gameState.Cheats.sandboxMode)
auto& gameState = getGameState();
if (!MapIsLocationOwned(_loc) && !gameState.cheats.sandboxMode)
{
res.Error = GameActions::Status::NotOwned;
res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK;
@@ -125,7 +125,7 @@ GameActions::Result MazeSetTrackAction::Query() const
auto clearanceHeight = _loc.z + 32;
auto heightDifference = baseHeight - surfaceElement->GetBaseZ();
if (heightDifference >= 0 && !gameState.Cheats.disableSupportLimits)
if (heightDifference >= 0 && !gameState.cheats.disableSupportLimits)
{
heightDifference /= kCoordsZPerTinyZ;
@@ -56,7 +56,7 @@ void ParkEntrancePlaceAction::Serialise(DataSerialiser& stream)
GameActions::Result ParkEntrancePlaceAction::Query() const
{
if (!isInEditorMode() && !GetGameState().Cheats.sandboxMode)
if (!isInEditorMode() && !getGameState().cheats.sandboxMode)
{
return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
}
@@ -79,8 +79,8 @@ GameActions::Result ParkEntrancePlaceAction::Query() const
GameActions::Status::NoFreeElements, STR_CANT_BUILD_THIS_HERE, STR_ERR_LANDSCAPE_DATA_AREA_FULL);
}
const auto& gameState = GetGameState();
if (gameState.Park.Entrances.size() >= OpenRCT2::Limits::kMaxParkEntrances)
const auto& gameState = getGameState();
if (gameState.park.Entrances.size() >= OpenRCT2::Limits::kMaxParkEntrances)
{
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_TOO_MANY_PARK_ENTRANCES);
@@ -126,7 +126,7 @@ GameActions::Result ParkEntrancePlaceAction::Execute() const
uint32_t flags = GetFlags();
GetGameState().Park.Entrances.push_back(_loc);
getGameState().park.Entrances.push_back(_loc);
auto zLow = _loc.z;
auto zHigh = zLow + ParkEntranceHeight;
@@ -43,7 +43,7 @@ void ParkEntranceRemoveAction::Serialise(DataSerialiser& stream)
GameActions::Result ParkEntranceRemoveAction::Query() const
{
if (!isInEditorMode() && !GetGameState().Cheats.sandboxMode)
if (!isInEditorMode() && !getGameState().cheats.sandboxMode)
{
return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_REMOVE_THIS, kStringIdNone);
}
@@ -79,8 +79,8 @@ GameActions::Result ParkEntranceRemoveAction::Execute() const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
}
auto& gameState = GetGameState();
auto direction = (gameState.Park.Entrances[entranceIndex].direction - 1) & 3;
auto& gameState = getGameState();
auto direction = (gameState.park.Entrances[entranceIndex].direction - 1) & 3;
// Centre (sign)
ParkEntranceRemoveSegment(_loc);
@@ -93,7 +93,7 @@ GameActions::Result ParkEntranceRemoveAction::Execute() const
ParkEntranceRemoveSegment(
{ _loc.x - CoordsDirectionDelta[direction].x, _loc.y - CoordsDirectionDelta[direction].y, _loc.z });
gameState.Park.Entrances.erase(gameState.Park.Entrances.begin() + entranceIndex);
gameState.park.Entrances.erase(gameState.park.Entrances.begin() + entranceIndex);
return res;
}
+1 -1
View File
@@ -55,7 +55,7 @@ GameActions::Result ParkMarketingAction::Query() const
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_START_MARKETING_CAMPAIGN, STR_ERR_VALUE_OUT_OF_RANGE);
}
if (GetGameState().Park.Flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN)
if (getGameState().park.Flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_START_MARKETING_CAMPAIGN,
+2 -2
View File
@@ -71,7 +71,7 @@ GameActions::Result ParkSetDateAction::Query() const
GameActions::Result ParkSetDateAction::Execute() const
{
auto& gameState = GetGameState();
gameState.Date = OpenRCT2::Date::FromYMD(_year, _month, _day);
auto& gameState = getGameState();
gameState.date = OpenRCT2::Date::FromYMD(_year, _month, _day);
return GameActions::Result();
}
@@ -43,7 +43,7 @@ void ParkSetEntranceFeeAction::Serialise(DataSerialiser& stream)
GameActions::Result ParkSetEntranceFeeAction::Query() const
{
if ((GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) != 0)
if ((getGameState().park.Flags & PARK_FLAGS_NO_MONEY) != 0)
{
LOG_ERROR("Can't set park entrance fee because the park has no money");
return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone);
@@ -65,7 +65,7 @@ GameActions::Result ParkSetEntranceFeeAction::Query() const
GameActions::Result ParkSetEntranceFeeAction::Execute() const
{
GetGameState().Park.EntranceFee = _fee;
getGameState().park.EntranceFee = _fee;
auto* windowMgr = Ui::GetWindowManager();
windowMgr->InvalidateByClass(WindowClass::ParkInformation);
+9 -9
View File
@@ -42,20 +42,20 @@ void ParkSetLoanAction::Serialise(DataSerialiser& stream)
GameActions::Result ParkSetLoanAction::Query() const
{
auto& gameState = GetGameState();
if (_value > gameState.BankLoan && _value > gameState.MaxBankLoan)
auto& gameState = getGameState();
if (_value > gameState.bankLoan && _value > gameState.maxBankLoan)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_BORROW_ANY_MORE_MONEY, STR_BANK_REFUSES_TO_INCREASE_LOAN);
}
if (_value < gameState.BankLoan && _value < 0.00_GBP)
if (_value < gameState.bankLoan && _value < 0.00_GBP)
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_PAY_BACK_LOAN, STR_LOAN_CANT_BE_NEGATIVE);
}
// The “isPayingBack” check is needed to allow increasing the loan when the player is in debt.
const auto isPayingBack = gameState.BankLoan > _value;
const auto amountToPayBack = gameState.BankLoan - _value;
if (isPayingBack && amountToPayBack > gameState.Cash)
const auto isPayingBack = gameState.bankLoan > _value;
const auto amountToPayBack = gameState.bankLoan - _value;
if (isPayingBack && amountToPayBack > gameState.cash)
{
return GameActions::Result(
GameActions::Status::InsufficientFunds, STR_CANT_PAY_BACK_LOAN, STR_NOT_ENOUGH_CASH_AVAILABLE);
@@ -65,10 +65,10 @@ GameActions::Result ParkSetLoanAction::Query() const
GameActions::Result ParkSetLoanAction::Execute() const
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
gameState.Cash -= (gameState.BankLoan - _value);
gameState.BankLoan = _value;
gameState.cash -= (gameState.bankLoan - _value);
gameState.bankLoan = _value;
auto windowManager = OpenRCT2::Ui::GetWindowManager();
windowManager->BroadcastIntent(Intent(INTENT_ACTION_UPDATE_CASH));
+1 -1
View File
@@ -56,7 +56,7 @@ GameActions::Result ParkSetNameAction::Query() const
GameActions::Result ParkSetNameAction::Execute() const
{
// Do a no-op if new name is the same as the current name is the same
auto& park = GetGameState().Park;
auto& park = getGameState().park;
if (_name != park.Name)
{
park.Name = _name;
@@ -57,27 +57,27 @@ GameActions::Result ParkSetParameterAction::Query() const
GameActions::Result ParkSetParameterAction::Execute() const
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
auto* windowMgr = Ui::GetWindowManager();
switch (_parameter)
{
case ParkParameter::Close:
if (gameState.Park.Flags & PARK_FLAGS_PARK_OPEN)
if (gameState.park.Flags & PARK_FLAGS_PARK_OPEN)
{
gameState.Park.Flags &= ~PARK_FLAGS_PARK_OPEN;
gameState.park.Flags &= ~PARK_FLAGS_PARK_OPEN;
windowMgr->InvalidateByClass(WindowClass::ParkInformation);
}
break;
case ParkParameter::Open:
if (!(gameState.Park.Flags & PARK_FLAGS_PARK_OPEN))
if (!(gameState.park.Flags & PARK_FLAGS_PARK_OPEN))
{
gameState.Park.Flags |= PARK_FLAGS_PARK_OPEN;
gameState.park.Flags |= PARK_FLAGS_PARK_OPEN;
windowMgr->InvalidateByClass(WindowClass::ParkInformation);
}
break;
case ParkParameter::SamePriceInPark:
gameState.SamePriceThroughoutPark = _value;
gameState.samePriceThroughoutPark = _value;
windowMgr->InvalidateByClass(WindowClass::Ride);
break;
default:
@@ -56,9 +56,9 @@ GameActions::Result ParkSetResearchFundingAction::Query() const
GameActions::Result ParkSetResearchFundingAction::Execute() const
{
auto& gameState = GetGameState();
gameState.ResearchPriorities = _priorities;
gameState.ResearchFundingLevel = _fundingAmount;
auto& gameState = getGameState();
gameState.researchPriorities = _priorities;
gameState.researchFundingLevel = _fundingAmount;
auto windowManager = OpenRCT2::Ui::GetWindowManager();
windowManager->BroadcastIntent(Intent(INTENT_ACTION_UPDATE_RESEARCH));
+10 -10
View File
@@ -45,7 +45,7 @@ void PeepSpawnPlaceAction::Serialise(DataSerialiser& stream)
GameActions::Result PeepSpawnPlaceAction::Query() const
{
if (!isInEditorMode() && !GetGameState().Cheats.sandboxMode)
if (!isInEditorMode() && !getGameState().cheats.sandboxMode)
{
return GameActions::Result(GameActions::Status::NotInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, kStringIdNone);
}
@@ -103,37 +103,37 @@ GameActions::Result PeepSpawnPlaceAction::Execute() const
spawn.z = _location.z;
spawn.direction = _location.direction;
auto& gameState = GetGameState();
auto& gameState = getGameState();
// When attempting to place a peep spawn on a tile that already contains it,
// remove that peep spawn instead.
if (!gameState.PeepSpawns.empty())
if (!gameState.peepSpawns.empty())
{
// When searching for existing spawns, ignore the direction.
auto foundSpawn = std::find_if(
gameState.PeepSpawns.begin(), gameState.PeepSpawns.end(), [spawn](const CoordsXYZ& existingSpawn) {
gameState.peepSpawns.begin(), gameState.peepSpawns.end(), [spawn](const CoordsXYZ& existingSpawn) {
{
return existingSpawn.ToTileStart() == spawn.ToTileStart();
}
});
if (foundSpawn != std::end(gameState.PeepSpawns))
if (foundSpawn != std::end(gameState.peepSpawns))
{
gameState.PeepSpawns.erase(foundSpawn);
gameState.peepSpawns.erase(foundSpawn);
MapInvalidateTileFull(spawn);
return res;
}
}
// If we have reached our max peep spawns, remove the oldest spawns
while (gameState.PeepSpawns.size() >= Limits::kMaxPeepSpawns)
while (gameState.peepSpawns.size() >= Limits::kMaxPeepSpawns)
{
PeepSpawn oldestSpawn = *gameState.PeepSpawns.begin();
gameState.PeepSpawns.erase(gameState.PeepSpawns.begin());
PeepSpawn oldestSpawn = *gameState.peepSpawns.begin();
gameState.peepSpawns.erase(gameState.peepSpawns.begin());
MapInvalidateTileFull(oldestSpawn);
}
// Set peep spawn
gameState.PeepSpawns.push_back(spawn);
gameState.peepSpawns.push_back(spawn);
// Invalidate tile
MapInvalidateTileFull(_location);
+5 -5
View File
@@ -158,8 +158,8 @@ GameActions::Result RideCreateAction::Execute() const
ride->status = RideStatus::closed;
ride->numTrains = 1;
auto& gameState = GetGameState();
if (gameState.Cheats.disableTrainLengthLimit)
auto& gameState = getGameState();
if (gameState.cheats.disableTrainLengthLimit)
{
// Reduce amount of proposed trains to prevent 32 trains from always spawning when limits are disabled
if (rideEntry->cars_per_flat_ride == kNoFlatRideCars)
@@ -203,7 +203,7 @@ GameActions::Result RideCreateAction::Execute() const
ride->ratings.setNull();
if (!(gameState.Park.Flags & PARK_FLAGS_NO_MONEY))
if (!(gameState.park.Flags & PARK_FLAGS_NO_MONEY))
{
for (auto i = 0; i < RCT2::ObjectLimits::kMaxShopItemsPerRideEntry; i++)
{
@@ -212,7 +212,7 @@ GameActions::Result RideCreateAction::Execute() const
if (rideEntry->shop_item[0] == ShopItem::None)
{
if (!Park::RidePricesUnlocked() || gameState.Park.EntranceFee > 0)
if (!Park::RidePricesUnlocked() || gameState.park.EntranceFee > 0)
{
ride->price[0] = 0;
}
@@ -226,7 +226,7 @@ GameActions::Result RideCreateAction::Execute() const
ride->price[1] = GetShopItemDescriptor(rideEntry->shop_item[1]).DefaultPrice;
}
if (gameState.ScenarioObjective.Type == OBJECTIVE_BUILD_THE_BEST)
if (gameState.scenarioObjective.Type == OBJECTIVE_BUILD_THE_BEST)
{
ride->price[0] = 0;
}
+5 -5
View File
@@ -65,7 +65,7 @@ GameActions::Result RideDemolishAction::Query() const
if ((ride->lifecycleFlags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)
&& _modifyType == RideModifyType::demolish)
&& !GetGameState().Cheats.makeAllDestructible)
&& !getGameState().cheats.makeAllDestructible)
{
return GameActions::Result(
GameActions::Status::NoClearance, STR_CANT_DEMOLISH_RIDE,
@@ -154,7 +154,7 @@ GameActions::Result RideDemolishAction::DemolishRide(Ride& ride) const
}
ride.remove();
GetGameState().Park.Value = Park::CalculateParkValue();
getGameState().park.Value = Park::CalculateParkValue();
// Close windows related to the demolished ride
auto* windowMgr = Ui::GetWindowManager();
@@ -195,11 +195,11 @@ money64 RideDemolishAction::DemolishTracks() const
uint8_t oldpaused = gGamePaused;
gGamePaused = 0;
auto& gameState = GetGameState();
auto& gameState = getGameState();
for (TileCoordsXY tilePos = {}; tilePos.x < gameState.MapSize.x; ++tilePos.x)
for (TileCoordsXY tilePos = {}; tilePos.x < gameState.mapSize.x; ++tilePos.x)
{
for (tilePos.y = 0; tilePos.y < gameState.MapSize.y; ++tilePos.y)
for (tilePos.y = 0; tilePos.y < gameState.mapSize.y; ++tilePos.y)
{
const auto tileCoords = tilePos.ToCoordsXY();
// Loop over all elements of the tile until there are no more items to remove
@@ -102,7 +102,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const
{
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP);
}
if (!GetGameState().Cheats.sandboxMode && !MapIsLocationOwned({ _loc, z }))
if (!getGameState().cheats.sandboxMode && !MapIsLocationOwned({ _loc, z }))
{
return GameActions::Result(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
}
@@ -173,7 +173,7 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const
auto z = station.GetBaseZ();
if (!(GetFlags() & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !(GetFlags() & GAME_COMMAND_FLAG_GHOST)
&& !GetGameState().Cheats.disableClearanceChecks)
&& !getGameState().cheats.disableClearanceChecks)
{
FootpathRemoveLitter({ _loc, z });
WallRemoveAtZ({ _loc, z });
@@ -236,7 +236,7 @@ GameActions::Result RideEntranceExitPlaceAction::TrackPlaceQuery(const CoordsXYZ
const auto errorTitle = isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION
: STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION;
if (!GetGameState().Cheats.sandboxMode && !MapIsLocationOwned(loc))
if (!getGameState().cheats.sandboxMode && !MapIsLocationOwned(loc))
{
return GameActions::Result(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
}
@@ -70,7 +70,7 @@ GameActions::Result RideSetSettingAction::Query() const
GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_MUST_BE_CLOSED_FIRST);
}
if (!RideIsModeValid(*ride) && !GetGameState().Cheats.showAllOperatingModes)
if (!RideIsModeValid(*ride) && !getGameState().cheats.showAllOperatingModes)
{
LOG_ERROR("Invalid ride mode: %u", _value);
return GameActions::Result(
@@ -149,7 +149,7 @@ GameActions::Result RideSetSettingAction::Query() const
}
break;
case RideSetSetting::RideType:
if (!GetGameState().Cheats.allowArbitraryRideTypeChanges)
if (!getGameState().cheats.allowArbitraryRideTypeChanges)
{
LOG_ERROR("Arbitrary ride type changes not allowed.");
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, kStringIdNone);
@@ -263,16 +263,16 @@ bool RideSetSettingAction::RideIsModeValid(const Ride& ride) const
bool RideSetSettingAction::RideIsValidLiftHillSpeed(const Ride& ride) const
{
auto& gameState = GetGameState();
int32_t minSpeed = gameState.Cheats.unlockOperatingLimits ? 0 : ride.getRideTypeDescriptor().LiftData.minimum_speed;
int32_t maxSpeed = gameState.Cheats.unlockOperatingLimits ? 255 : ride.getRideTypeDescriptor().LiftData.maximum_speed;
auto& gameState = getGameState();
int32_t minSpeed = gameState.cheats.unlockOperatingLimits ? 0 : ride.getRideTypeDescriptor().LiftData.minimum_speed;
int32_t maxSpeed = gameState.cheats.unlockOperatingLimits ? 255 : ride.getRideTypeDescriptor().LiftData.maximum_speed;
return _value >= minSpeed && _value <= maxSpeed;
}
bool RideSetSettingAction::RideIsValidNumCircuits() const
{
int32_t minNumCircuits = 1;
int32_t maxNumCircuits = GetGameState().Cheats.unlockOperatingLimits ? 255 : Limits::kMaxCircuitsPerRide;
int32_t maxNumCircuits = getGameState().cheats.unlockOperatingLimits ? 255 : Limits::kMaxCircuitsPerRide;
return _value >= minNumCircuits && _value <= maxNumCircuits;
}
@@ -281,7 +281,7 @@ bool RideSetSettingAction::RideIsValidOperationOption(const Ride& ride) const
const auto& operatingSettings = ride.getRideTypeDescriptor().OperatingSettings;
uint8_t minValue = operatingSettings.MinValue;
uint8_t maxValue = operatingSettings.MaxValue;
if (GetGameState().Cheats.unlockOperatingLimits)
if (getGameState().cheats.unlockOperatingLimits)
{
minValue = 0;
maxValue = 255;
@@ -157,7 +157,7 @@ GameActions::Result RideSetVehicleAction::Execute() const
}
uint8_t clampValue = _value;
static_assert(sizeof(clampValue) == sizeof(ride->proposedNumCarsPerTrain));
if (!GetGameState().Cheats.disableTrainLengthLimit)
if (!getGameState().cheats.disableTrainLengthLimit)
{
clampValue = std::clamp(clampValue, rideEntry->min_cars_in_train, rideEntry->max_cars_in_train);
}
@@ -180,7 +180,7 @@ GameActions::Result RideSetVehicleAction::Execute() const
}
RideSetVehicleColoursToRandomPreset(*ride, _colour);
if (!GetGameState().Cheats.disableTrainLengthLimit)
if (!getGameState().cheats.disableTrainLengthLimit)
{
ride->proposedNumCarsPerTrain = std::clamp(
ride->proposedNumCarsPerTrain, rideEntry->min_cars_in_train, rideEntry->max_cars_in_train);
@@ -224,11 +224,11 @@ bool RideSetVehicleAction::RideIsVehicleTypeValid(const Ride& ride) const
{
bool selectionShouldBeExpanded;
ride_type_t rideTypeIterator, rideTypeIteratorMax;
auto& gameState = GetGameState();
auto& gameState = getGameState();
{
const auto& rtd = ride.getRideTypeDescriptor();
if (gameState.Cheats.showVehiclesFromOtherTrackTypes
if (gameState.cheats.showVehiclesFromOtherTrackTypes
&& !(
ride.getRideTypeDescriptor().HasFlag(RtdFlag::isFlatRide) || rtd.specialType == RtdSpecialType::maze
|| rtd.specialType == RtdSpecialType::miniGolf))
@@ -263,7 +263,7 @@ bool RideSetVehicleAction::RideIsVehicleTypeValid(const Ride& ride) const
{
if (rideEntryIndex == _value)
{
if (!RideEntryIsInvented(rideEntryIndex) && !gameState.Cheats.ignoreResearchStatus)
if (!RideEntryIsInvented(rideEntryIndex) && !gameState.cheats.ignoreResearchStatus)
{
return false;
}
@@ -46,7 +46,7 @@ GameActions::Result ScenarioSetSettingAction::Query() const
GameActions::Result ScenarioSetSettingAction::Execute() const
{
auto& gameState = GetGameState();
auto& gameState = getGameState();
auto* windowMgr = Ui::GetWindowManager();
switch (_setting)
@@ -56,22 +56,22 @@ GameActions::Result ScenarioSetSettingAction::Execute() const
{
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_NO_MONEY;
gameState.park.Flags |= PARK_FLAGS_NO_MONEY;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_NO_MONEY;
gameState.park.Flags &= ~PARK_FLAGS_NO_MONEY;
}
}
else
{
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_NO_MONEY;
gameState.park.Flags |= PARK_FLAGS_NO_MONEY;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_NO_MONEY;
gameState.park.Flags &= ~PARK_FLAGS_NO_MONEY;
}
// Invalidate all windows that have anything to do with finance
windowMgr->InvalidateByClass(WindowClass::Ride);
@@ -83,168 +83,168 @@ GameActions::Result ScenarioSetSettingAction::Execute() const
}
break;
case ScenarioSetSetting::InitialCash:
gameState.InitialCash = std::clamp<money64>(_value, 0.00_GBP, 1000000.00_GBP);
gameState.Cash = gameState.InitialCash;
gameState.initialCash = std::clamp<money64>(_value, 0.00_GBP, 1000000.00_GBP);
gameState.cash = gameState.initialCash;
windowMgr->InvalidateByClass(WindowClass::Finances);
windowMgr->InvalidateByClass(WindowClass::BottomToolbar);
break;
case ScenarioSetSetting::InitialLoan:
gameState.BankLoan = std::clamp<money64>(_value, 0.00_GBP, 5000000.00_GBP);
gameState.MaxBankLoan = std::max(gameState.BankLoan, gameState.MaxBankLoan);
gameState.bankLoan = std::clamp<money64>(_value, 0.00_GBP, 5000000.00_GBP);
gameState.maxBankLoan = std::max(gameState.bankLoan, gameState.maxBankLoan);
windowMgr->InvalidateByClass(WindowClass::Finances);
break;
case ScenarioSetSetting::MaximumLoanSize:
gameState.MaxBankLoan = std::clamp<money64>(_value, 0.00_GBP, 5000000.00_GBP);
gameState.BankLoan = std::min(gameState.BankLoan, gameState.MaxBankLoan);
gameState.maxBankLoan = std::clamp<money64>(_value, 0.00_GBP, 5000000.00_GBP);
gameState.bankLoan = std::min(gameState.bankLoan, gameState.maxBankLoan);
windowMgr->InvalidateByClass(WindowClass::Finances);
break;
case ScenarioSetSetting::AnnualInterestRate:
gameState.BankLoanInterestRate = std::clamp<uint8_t>(_value, 0, MaxBankLoanInterestRate);
gameState.bankLoanInterestRate = std::clamp<uint8_t>(_value, 0, MaxBankLoanInterestRate);
windowMgr->InvalidateByClass(WindowClass::Finances);
break;
case ScenarioSetSetting::ForbidMarketingCampaigns:
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_FORBID_MARKETING_CAMPAIGN;
gameState.park.Flags |= PARK_FLAGS_FORBID_MARKETING_CAMPAIGN;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_FORBID_MARKETING_CAMPAIGN;
gameState.park.Flags &= ~PARK_FLAGS_FORBID_MARKETING_CAMPAIGN;
}
break;
case ScenarioSetSetting::AverageCashPerGuest:
gameState.GuestInitialCash = std::clamp<money64>(_value, 0.00_GBP, 1000.00_GBP);
gameState.guestInitialCash = std::clamp<money64>(_value, 0.00_GBP, 1000.00_GBP);
break;
case ScenarioSetSetting::GuestInitialHappiness:
gameState.GuestInitialHappiness = std::clamp<uint8_t>(_value, 40, 250);
gameState.guestInitialHappiness = std::clamp<uint8_t>(_value, 40, 250);
break;
case ScenarioSetSetting::GuestInitialHunger:
gameState.GuestInitialHunger = std::clamp<uint8_t>(_value, 40, 250);
gameState.guestInitialHunger = std::clamp<uint8_t>(_value, 40, 250);
break;
case ScenarioSetSetting::GuestInitialThirst:
gameState.GuestInitialThirst = std::clamp<uint8_t>(_value, 40, 250);
gameState.guestInitialThirst = std::clamp<uint8_t>(_value, 40, 250);
break;
case ScenarioSetSetting::GuestsPreferLessIntenseRides:
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_PREF_LESS_INTENSE_RIDES;
gameState.park.Flags |= PARK_FLAGS_PREF_LESS_INTENSE_RIDES;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_PREF_LESS_INTENSE_RIDES;
gameState.park.Flags &= ~PARK_FLAGS_PREF_LESS_INTENSE_RIDES;
}
break;
case ScenarioSetSetting::GuestsPreferMoreIntenseRides:
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_PREF_MORE_INTENSE_RIDES;
gameState.park.Flags |= PARK_FLAGS_PREF_MORE_INTENSE_RIDES;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_PREF_MORE_INTENSE_RIDES;
gameState.park.Flags &= ~PARK_FLAGS_PREF_MORE_INTENSE_RIDES;
}
break;
case ScenarioSetSetting::CostToBuyLand:
gameState.LandPrice = std::clamp<money64>(_value, 5.00_GBP, 200.00_GBP);
gameState.landPrice = std::clamp<money64>(_value, 5.00_GBP, 200.00_GBP);
break;
case ScenarioSetSetting::CostToBuyConstructionRights:
gameState.ConstructionRightsPrice = std::clamp<money64>(_value, 5.00_GBP, 200.00_GBP);
gameState.constructionRightsPrice = std::clamp<money64>(_value, 5.00_GBP, 200.00_GBP);
break;
case ScenarioSetSetting::ParkChargeMethod:
if (gLegacyScene == LegacyScene::scenarioEditor)
{
if (_value == 0)
{
gameState.Park.Flags |= PARK_FLAGS_PARK_FREE_ENTRY;
gameState.Park.Flags &= ~PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.Park.EntranceFee = 0.00_GBP;
gameState.park.Flags |= PARK_FLAGS_PARK_FREE_ENTRY;
gameState.park.Flags &= ~PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.park.EntranceFee = 0.00_GBP;
}
else if (_value == 1)
{
gameState.Park.Flags &= ~PARK_FLAGS_PARK_FREE_ENTRY;
gameState.Park.Flags &= ~PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.Park.EntranceFee = 10.00_GBP;
gameState.park.Flags &= ~PARK_FLAGS_PARK_FREE_ENTRY;
gameState.park.Flags &= ~PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.park.EntranceFee = 10.00_GBP;
}
else
{
gameState.Park.Flags |= PARK_FLAGS_PARK_FREE_ENTRY;
gameState.Park.Flags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.Park.EntranceFee = 10.00_GBP;
gameState.park.Flags |= PARK_FLAGS_PARK_FREE_ENTRY;
gameState.park.Flags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.park.EntranceFee = 10.00_GBP;
}
}
else
{
if (_value == 0)
{
gameState.Park.Flags |= PARK_FLAGS_PARK_FREE_ENTRY;
gameState.Park.Flags &= ~PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.park.Flags |= PARK_FLAGS_PARK_FREE_ENTRY;
gameState.park.Flags &= ~PARK_FLAGS_UNLOCK_ALL_PRICES;
}
else if (_value == 1)
{
gameState.Park.Flags &= ~PARK_FLAGS_PARK_FREE_ENTRY;
gameState.Park.Flags &= ~PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.park.Flags &= ~PARK_FLAGS_PARK_FREE_ENTRY;
gameState.park.Flags &= ~PARK_FLAGS_UNLOCK_ALL_PRICES;
}
else
{
gameState.Park.Flags |= PARK_FLAGS_PARK_FREE_ENTRY;
gameState.Park.Flags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.park.Flags |= PARK_FLAGS_PARK_FREE_ENTRY;
gameState.park.Flags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
}
windowMgr->InvalidateByClass(WindowClass::ParkInformation);
windowMgr->InvalidateByClass(WindowClass::Ride);
}
break;
case ScenarioSetSetting::ParkChargeEntryFee:
gameState.Park.EntranceFee = std::clamp<money64>(_value, 0.00_GBP, kMaxEntranceFee);
gameState.park.EntranceFee = std::clamp<money64>(_value, 0.00_GBP, kMaxEntranceFee);
windowMgr->InvalidateByClass(WindowClass::ParkInformation);
break;
case ScenarioSetSetting::ForbidTreeRemoval:
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_FORBID_TREE_REMOVAL;
gameState.park.Flags |= PARK_FLAGS_FORBID_TREE_REMOVAL;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_FORBID_TREE_REMOVAL;
gameState.park.Flags &= ~PARK_FLAGS_FORBID_TREE_REMOVAL;
}
break;
case ScenarioSetSetting::ForbidLandscapeChanges:
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_FORBID_LANDSCAPE_CHANGES;
gameState.park.Flags |= PARK_FLAGS_FORBID_LANDSCAPE_CHANGES;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_FORBID_LANDSCAPE_CHANGES;
gameState.park.Flags &= ~PARK_FLAGS_FORBID_LANDSCAPE_CHANGES;
}
break;
case ScenarioSetSetting::ForbidHighConstruction:
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_FORBID_HIGH_CONSTRUCTION;
gameState.park.Flags |= PARK_FLAGS_FORBID_HIGH_CONSTRUCTION;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_FORBID_HIGH_CONSTRUCTION;
gameState.park.Flags &= ~PARK_FLAGS_FORBID_HIGH_CONSTRUCTION;
}
break;
case ScenarioSetSetting::ParkRatingHigherDifficultyLevel:
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_DIFFICULT_PARK_RATING;
gameState.park.Flags |= PARK_FLAGS_DIFFICULT_PARK_RATING;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_DIFFICULT_PARK_RATING;
gameState.park.Flags &= ~PARK_FLAGS_DIFFICULT_PARK_RATING;
}
break;
case ScenarioSetSetting::GuestGenerationHigherDifficultyLevel:
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_DIFFICULT_GUEST_GENERATION;
gameState.park.Flags |= PARK_FLAGS_DIFFICULT_GUEST_GENERATION;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_DIFFICULT_GUEST_GENERATION;
gameState.park.Flags &= ~PARK_FLAGS_DIFFICULT_GUEST_GENERATION;
}
break;
case ScenarioSetSetting::AllowEarlyCompletion:
@@ -254,11 +254,11 @@ GameActions::Result ScenarioSetSettingAction::Execute() const
{
if (_value != 0)
{
gameState.Park.Flags |= PARK_FLAGS_RCT1_INTEREST;
gameState.park.Flags |= PARK_FLAGS_RCT1_INTEREST;
}
else
{
gameState.Park.Flags &= ~PARK_FLAGS_RCT1_INTEREST;
gameState.park.Flags &= ~PARK_FLAGS_RCT1_INTEREST;
}
break;
}
@@ -171,8 +171,8 @@ GameActions::Result SmallSceneryPlaceAction::Query() const
targetHeight = surfaceHeight;
}
auto& gameState = GetGameState();
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.Cheats.sandboxMode
auto& gameState = getGameState();
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode
&& !MapIsLocationOwned({ _loc.x, _loc.y, targetHeight }))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
@@ -180,7 +180,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const
auto* surfaceElement = MapGetSurfaceElementAt(_loc);
if (surfaceElement != nullptr && !gameState.Cheats.disableClearanceChecks && surfaceElement->GetWaterHeight() > 0)
if (surfaceElement != nullptr && !gameState.cheats.disableClearanceChecks && surfaceElement->GetWaterHeight() > 0)
{
int32_t water_height = surfaceElement->GetWaterHeight() - 1;
if (water_height > targetHeight)
@@ -190,7 +190,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const
}
}
if (!gameState.Cheats.disableClearanceChecks && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)))
if (!gameState.cheats.disableClearanceChecks && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)))
{
if (isOnWater)
{
@@ -208,13 +208,13 @@ GameActions::Result SmallSceneryPlaceAction::Query() const
}
}
if (!gameState.Cheats.disableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_REQUIRE_FLAT_SURFACE))
if (!gameState.cheats.disableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_REQUIRE_FLAT_SURFACE))
&& !supportsRequired && !isOnWater && surfaceElement != nullptr && (surfaceElement->GetSlope() != kTileSlopeFlat))
{
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED);
}
if (!gameState.Cheats.disableSupportLimits && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)) && supportsRequired)
if (!gameState.cheats.disableSupportLimits && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)) && supportsRequired)
{
if (!isOnWater)
{
@@ -367,7 +367,7 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{
FootpathRemoveLitter({ _loc, targetHeight });
if (!GetGameState().Cheats.disableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS)))
if (!getGameState().cheats.disableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS)))
{
WallRemoveAt({ _loc, targetHeight, targetHeight + sceneryEntry->height });
}
@@ -75,10 +75,10 @@ GameActions::Result SmallSceneryRemoveAction::Query() const
res.Position = _loc;
if (gLegacyScene != LegacyScene::scenarioEditor && !(GetFlags() & GAME_COMMAND_FLAG_GHOST)
&& !GetGameState().Cheats.sandboxMode)
&& !getGameState().cheats.sandboxMode)
{
// Check if allowed to remove item
if (GetGameState().Park.Flags & PARK_FLAGS_FORBID_TREE_REMOVAL)
if (getGameState().park.Flags & PARK_FLAGS_FORBID_TREE_REMOVAL)
{
if (entry->HasFlag(SMALL_SCENERY_FLAG_IS_TREE))
{
@@ -83,7 +83,7 @@ GameActions::Result SmallScenerySetColourAction::QueryExecute(bool isExecuting)
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP);
}
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (!MapIsLocationOwned(_loc))
{
+5 -5
View File
@@ -193,7 +193,7 @@ GameActions::Result StaffHireNewAction::QueryExecute(bool execute) const
newPeep->TrousersColour = colour;
// Staff energy determines their walking speed
switch (GetGameState().Cheats.selectedStaffSpeed)
switch (getGameState().cheats.selectedStaffSpeed)
{
case StaffSpeedCheat::None:
newPeep->Energy = kCheatsStaffNormalSpeed;
@@ -280,11 +280,11 @@ void StaffHireNewAction::AutoPositionNewStaff(Peep* newPeep) const
else
{
// No walking guests; pick random park entrance
const auto& gameState = GetGameState();
if (!gameState.Park.Entrances.empty())
const auto& gameState = getGameState();
if (!gameState.park.Entrances.empty())
{
auto rand = ScenarioRandMax(static_cast<uint32_t>(gameState.Park.Entrances.size()));
const auto& entrance = gameState.Park.Entrances[rand];
auto rand = ScenarioRandMax(static_cast<uint32_t>(gameState.park.Entrances.size()));
const auto& entrance = gameState.park.Entrances[rand];
auto dir = entrance.direction;
newLocation = entrance;
// TODO: Replace with CoordsDirectionDelta
@@ -85,11 +85,11 @@ GameActions::Result SurfaceSetStyleAction::Query() const
res.Position.y = yMid;
res.Position.z = heightMid;
auto& gameState = GetGameState();
auto& gameState = getGameState();
// Do nothing if not in editor, sandbox mode or landscaping is forbidden
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.Cheats.sandboxMode
&& (gameState.Park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES))
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode
&& (gameState.park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES))
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_CHANGE_LAND_TYPE, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY);
@@ -105,7 +105,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const
if (!LocationValid(coords))
continue;
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode)
{
if (!MapIsLocationInPark(coords))
continue;
@@ -173,7 +173,7 @@ GameActions::Result SurfaceSetStyleAction::Execute() const
if (!LocationValid(coords))
continue;
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (!MapIsLocationInPark(coords))
continue;
+7 -7
View File
@@ -65,21 +65,21 @@ GameActions::Result TrackDesignAction::Query() const
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP);
}
auto& gameState = GetGameState();
auto& gameState = getGameState();
auto& objManager = GetContext()->GetObjectManager();
auto entryIndex = objManager.GetLoadedObjectEntryIndex(_td.trackAndVehicle.vehicleObject);
if (entryIndex == kObjectEntryIndexNull)
{
// Force a fallback if the entry is not invented yet a track design of it is selected,
// which can happen in select-by-track-type mode
if (!RideEntryIsInvented(entryIndex) && !gameState.Cheats.ignoreResearchStatus)
if (!RideEntryIsInvented(entryIndex) && !gameState.cheats.ignoreResearchStatus)
{
entryIndex = kObjectEntryIndexNull;
}
}
// Colours do not matter as will be overwritten
auto rideCreateAction = RideCreateAction(_td.trackAndVehicle.rtdIndex, entryIndex, 0, 0, gameState.LastEntranceStyle);
auto rideCreateAction = RideCreateAction(_td.trackAndVehicle.rtdIndex, entryIndex, 0, 0, gameState.lastEntranceStyle);
rideCreateAction.SetFlags(GetFlags());
auto r = GameActions::ExecuteNested(&rideCreateAction);
if (r.Error != GameActions::Status::Ok)
@@ -139,21 +139,21 @@ GameActions::Result TrackDesignAction::Execute() const
res.Position.z = _loc.z;
res.Expenditure = ExpenditureType::RideConstruction;
auto& gameState = GetGameState();
auto& gameState = getGameState();
auto& objManager = GetContext()->GetObjectManager();
auto entryIndex = objManager.GetLoadedObjectEntryIndex(_td.trackAndVehicle.vehicleObject);
if (entryIndex != kObjectEntryIndexNull)
{
// Force a fallback if the entry is not invented yet a track design using it is selected.
// This can happen on rides with multiple vehicles where some have been invented and some haven’t.
if (!RideEntryIsInvented(entryIndex) && !gameState.Cheats.ignoreResearchStatus)
if (!RideEntryIsInvented(entryIndex) && !gameState.cheats.ignoreResearchStatus)
{
entryIndex = kObjectEntryIndexNull;
}
}
// Colours do not matter as will be overwritten
auto rideCreateAction = RideCreateAction(_td.trackAndVehicle.rtdIndex, entryIndex, 0, 0, gameState.LastEntranceStyle);
auto rideCreateAction = RideCreateAction(_td.trackAndVehicle.rtdIndex, entryIndex, 0, 0, gameState.lastEntranceStyle);
rideCreateAction.SetFlags(GetFlags());
auto r = GameActions::ExecuteNested(&rideCreateAction);
if (r.Error != GameActions::Status::Ok)
@@ -245,7 +245,7 @@ GameActions::Result TrackDesignAction::Execute() const
ride->entranceStyle = objManager.GetLoadedObjectEntryIndex(_td.appearance.stationObjectIdentifier);
if (ride->entranceStyle == kObjectEntryIndexNull)
{
ride->entranceStyle = gameState.LastEntranceStyle;
ride->entranceStyle = gameState.lastEntranceStyle;
}
for (size_t i = 0; i < std::min(std::size(ride->trackColours), std::size(_td.appearance.trackColours)); i++)
+13 -13
View File
@@ -99,8 +99,8 @@ GameActions::Result TrackPlaceAction::Query() const
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
}
auto& gameState = GetGameState();
if (_rideType != ride->type && !gameState.Cheats.allowArbitraryRideTypeChanges)
auto& gameState = getGameState();
if (_rideType != ride->type && !gameState.cheats.allowArbitraryRideTypeChanges)
{
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, kStringIdNone);
@@ -138,7 +138,7 @@ GameActions::Result TrackPlaceAction::Query() const
if (!(GetActionFlags() & GameActions::Flags::AllowWhilePaused))
{
if (GameIsPaused() && !gameState.Cheats.buildInPauseMode)
if (GameIsPaused() && !gameState.cheats.buildInPauseMode)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
@@ -168,7 +168,7 @@ GameActions::Result TrackPlaceAction::Query() const
}
// Backwards steep lift hills are allowed, even on roller coasters that do not support forwards steep lift hills.
if (_trackPlaceFlags.has(LiftHillAndInverted::liftHill) && !rtd.SupportsTrackGroup(TrackGroup::liftHillSteep)
&& !gameState.Cheats.enableChainLiftOnAllTrack)
&& !gameState.cheats.enableChainLiftOnAllTrack)
{
const auto& ted = GetTrackElementDescriptor(_trackType);
if (ted.flags & TRACK_ELEM_FLAG_IS_STEEP_UP)
@@ -194,7 +194,7 @@ GameActions::Result TrackPlaceAction::Query() const
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP);
}
if (!MapIsLocationOwned(tileCoords) && !gameState.Cheats.sandboxMode)
if (!MapIsLocationOwned(tileCoords) && !gameState.cheats.sandboxMode)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
@@ -210,7 +210,7 @@ GameActions::Result TrackPlaceAction::Query() const
STR_TILE_ELEMENT_LIMIT_REACHED);
}
if (!gameState.Cheats.allowTrackPlaceInvalidHeights)
if (!gameState.cheats.allowTrackPlaceInvalidHeights)
{
if (ted.flags & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT)
{
@@ -313,7 +313,7 @@ GameActions::Result TrackPlaceAction::Query() const
}
}
if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER && !gameState.Cheats.disableClearanceChecks)
if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER && !gameState.cheats.disableClearanceChecks)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
@@ -379,7 +379,7 @@ GameActions::Result TrackPlaceAction::Query() const
STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
if (!gameState.Cheats.disableSupportLimits)
if (!gameState.cheats.disableSupportLimits)
{
int32_t ride_height = clearanceZ - surfaceElement->GetBaseZ();
if (ride_height >= 0)
@@ -504,8 +504,8 @@ GameActions::Result TrackPlaceAction::Execute() const
}
}
auto& gameState = GetGameState();
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !gameState.Cheats.disableClearanceChecks)
auto& gameState = getGameState();
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !gameState.cheats.disableClearanceChecks)
{
FootpathRemoveLitter(mapLoc);
if (rtd.HasFlag(RtdFlag::noWallsAroundTrack))
@@ -639,7 +639,7 @@ GameActions::Result TrackPlaceAction::Execute() const
uint32_t availableDirections = entranceDirections & 0x0F;
if (availableDirections != 0)
{
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !gameState.Cheats.disableClearanceChecks)
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !gameState.cheats.disableClearanceChecks)
{
for (int32_t chosenDirection = Numerics::bitScanForward(availableDirections); chosenDirection != -1;
chosenDirection = Numerics::bitScanForward(availableDirections))
@@ -681,7 +681,7 @@ GameActions::Result TrackPlaceAction::Execute() const
}
}
if (!gameState.Cheats.disableClearanceChecks || !(GetFlags() & GAME_COMMAND_FLAG_GHOST))
if (!gameState.cheats.disableClearanceChecks || !(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{
FootpathConnectEdges(mapLoc, tileElement, GetFlags());
}
@@ -712,7 +712,7 @@ GameActions::Result TrackPlaceAction::Execute() const
if (ride->mode == RideMode::poweredLaunch)
{
if (rtd.SupportsRideMode(RideMode::poweredLaunchBlockSectioned)
|| GetGameState().Cheats.showAllOperatingModes)
|| getGameState().cheats.showAllOperatingModes)
newMode = RideMode::poweredLaunchBlockSectioned;
else
newMode = RideMode::poweredLaunch;
+1 -1
View File
@@ -440,7 +440,7 @@ GameActions::Result TrackRemoveAction::Execute() const
InvalidateTestResults(*ride);
FootpathQueueChainReset();
if (!GetGameState().Cheats.disableClearanceChecks || !(tileElement->IsGhost()))
if (!getGameState().cheats.disableClearanceChecks || !(tileElement->IsGhost()))
{
FootpathRemoveEdgesAt(mapLoc, tileElement);
}
+11 -11
View File
@@ -89,10 +89,10 @@ GameActions::Result WallPlaceAction::Query() const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP);
}
auto& gameState = GetGameState();
auto& gameState = getGameState();
auto mapSizeMax = GetMapSizeMaxXY();
if (gLegacyScene != LegacyScene::scenarioEditor && !(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN)
&& !gameState.Cheats.sandboxMode)
&& !gameState.cheats.sandboxMode)
{
if (_loc.z == 0)
{
@@ -151,14 +151,14 @@ GameActions::Result WallPlaceAction::Query() const
{
uint16_t waterHeight = surfaceElement->GetWaterHeight();
if (targetHeight < waterHeight && !gameState.Cheats.disableClearanceChecks)
if (targetHeight < waterHeight && !gameState.cheats.disableClearanceChecks)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
}
}
if (targetHeight < surfaceElement->GetBaseZ() && !gameState.Cheats.disableClearanceChecks)
if (targetHeight < surfaceElement->GetBaseZ() && !gameState.cheats.disableClearanceChecks)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
@@ -171,7 +171,7 @@ GameActions::Result WallPlaceAction::Query() const
newBaseHeight += 2;
if (surfaceElement->GetSlope() & (1 << newEdge))
{
if (targetHeight / 8 < newBaseHeight && !gameState.Cheats.disableClearanceChecks)
if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
@@ -187,7 +187,7 @@ GameActions::Result WallPlaceAction::Query() const
if (surfaceElement->GetSlope() & (1 << newEdge))
{
newBaseHeight += 2;
if (targetHeight / 8 < newBaseHeight && !gameState.Cheats.disableClearanceChecks)
if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE,
@@ -202,7 +202,7 @@ GameActions::Result WallPlaceAction::Query() const
newEdge = (_edge + 3) & 3;
if (surfaceElement->GetSlope() & (1 << newEdge))
{
if (targetHeight / 8 < newBaseHeight && !gameState.Cheats.disableClearanceChecks)
if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
@@ -218,7 +218,7 @@ GameActions::Result WallPlaceAction::Query() const
if (surfaceElement->GetSlope() & (1 << newEdge))
{
newBaseHeight += 2;
if (targetHeight / 8 < newBaseHeight && !gameState.Cheats.disableClearanceChecks)
if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks)
{
return GameActions::Result(
GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE,
@@ -261,7 +261,7 @@ GameActions::Result WallPlaceAction::Query() const
clearanceHeight += wallEntry->height;
bool wallAcrossTrack = false;
if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !gameState.Cheats.disableClearanceChecks)
if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !gameState.cheats.disableClearanceChecks)
{
auto result = WallCheckObstruction(wallEntry, targetHeight / 8, clearanceHeight, &wallAcrossTrack);
if (result.Error != GameActions::Status::Ok)
@@ -286,7 +286,7 @@ GameActions::Result WallPlaceAction::Query() const
GameActions::Result WallPlaceAction::Execute() const
{
auto res = GameActions::Result();
auto& gameState = GetGameState();
auto& gameState = getGameState();
res.ErrorTitle = STR_CANT_BUILD_THIS_HERE;
res.Position = _loc;
@@ -339,7 +339,7 @@ GameActions::Result WallPlaceAction::Execute() const
clearanceHeight += wallEntry->height;
bool wallAcrossTrack = false;
if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !gameState.Cheats.disableClearanceChecks)
if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !gameState.cheats.disableClearanceChecks)
{
auto result = WallCheckObstruction(wallEntry, targetHeight / kCoordsZStep, clearanceHeight, &wallAcrossTrack);
if (result.Error != GameActions::Status::Ok)
+1 -1
View File
@@ -50,7 +50,7 @@ GameActions::Result WallRemoveAction::Query() const
}
const bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST;
if (!isGhost && gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode
if (!isGhost && gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode
&& !MapIsLocationOwned(_loc))
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
+1 -1
View File
@@ -67,7 +67,7 @@ GameActions::Result WallSetColourAction::Query() const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP);
}
if (gLegacyScene != LegacyScene::scenarioEditor && !MapIsLocationInPark(_loc) && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !MapIsLocationInPark(_loc) && !getGameState().cheats.sandboxMode)
{
return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
}
+2 -2
View File
@@ -80,7 +80,7 @@ GameActions::Result WaterLowerAction::QueryExecute(bool isExecuting) const
if (surfaceElement == nullptr)
continue;
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
@@ -139,7 +139,7 @@ uint8_t WaterLowerAction::GetLowestHeight(const MapRange& validRange) const
{
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
{
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
+2 -2
View File
@@ -80,7 +80,7 @@ GameActions::Result WaterRaiseAction::QueryExecute(bool isExecuting) const
if (surfaceElement == nullptr)
continue;
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
@@ -152,7 +152,7 @@ uint16_t WaterRaiseAction::GetHighestHeight(const MapRange& validRange) const
{
for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += kCoordsXYStep)
{
if (gLegacyScene != LegacyScene::scenarioEditor && !GetGameState().Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
{
if (!MapIsLocationInPark(CoordsXY{ x, y }))
{
@@ -51,9 +51,9 @@ GameActions::Result WaterSetHeightAction::Query() const
res.Expenditure = ExpenditureType::Landscaping;
res.Position = { _coords, _height * kCoordsZStep };
auto& gameState = GetGameState();
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.Cheats.sandboxMode
&& gameState.Park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES)
auto& gameState = getGameState();
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode
&& gameState.park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES)
{
return GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY);
}
@@ -69,7 +69,7 @@ GameActions::Result WaterSetHeightAction::Query() const
return GameActions::Result(GameActions::Status::NotOwned, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK);
}
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.Cheats.sandboxMode)
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode)
{
if (!MapIsLocationInPark(_coords))
{
@@ -121,7 +121,7 @@ GameActions::Result WaterSetHeightAction::Execute() const
int32_t surfaceHeight = TileElementHeight(_coords);
FootpathRemoveLitter({ _coords, surfaceHeight });
if (!GetGameState().Cheats.disableClearanceChecks)
if (!getGameState().cheats.disableClearanceChecks)
WallRemoveAtZ({ _coords, surfaceHeight });
SurfaceElement* surfaceElement = MapGetSurfaceElementAt(_coords);
Loaded 100 of 179 files, more files were not shown because too many files have changed in this diff. Show more