diff --git a/src/openrct2-ui/ride/Construction.cpp b/src/openrct2-ui/ride/Construction.cpp index 3a7c89a464..cdb8b2b5d9 100644 --- a/src/openrct2-ui/ride/Construction.cpp +++ b/src/openrct2-ui/ride/Construction.cpp @@ -234,7 +234,7 @@ namespace OpenRCT2 listItem.Type, listItem.EntryIndex, colour1, colour2, getGameState().lastEntranceStyle); gameAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) return; const auto rideIndex = result->GetData(); auto ride = GetRide(rideIndex); diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index f0d221372c..be6b7e6f45 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -288,7 +288,7 @@ namespace OpenRCT2::Ui::Windows auto action = GetClearAction(); auto result = GameActions::Query(&action, getGameState()); - auto cost = (result.Error == GameActions::Status::Ok ? result.Cost : kMoney64Undefined); + auto cost = (result.Error == GameActions::Status::ok ? result.Cost : kMoney64Undefined); if (_clearSceneryCost != cost) { _clearSceneryCost = cost; diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 884d982e79..12f8c740e0 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -209,7 +209,7 @@ namespace OpenRCT2::Ui::Windows gameAction.SetFlags({ CommandFlag::ghost }); auto result = GameActions::Execute(&gameAction, getGameState()); - if (result.Error == GameActions::Status::Ok) + if (result.Error == GameActions::Status::ok) { gParkEntranceGhostPosition = parkEntrancePosition; gParkEntranceGhostExists = true; @@ -232,7 +232,7 @@ namespace OpenRCT2::Ui::Windows gameAction.SetCallback( [&](const GameActions::GameAction*, const GameActions::Result* result) { _placingEntrance = false; }); auto result = GameActions::Execute(&gameAction, getGameState()); - if (result.Error == GameActions::Status::Ok) + if (result.Error == GameActions::Status::ok) { Audio::Play3D(Audio::SoundId::placeItem, result.Position); } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index de0a038085..98e711b08e 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1276,7 +1276,7 @@ namespace OpenRCT2::Ui::Windows auto footpathPlaceAction = GameActions::FootpathPlaceAction( tile.position, tile.slope, selectedType, gFootpathSelection.Railings, kInvalidDirection, constructFlags); auto result = GameActions::Execute(&footpathPlaceAction, getGameState()); - if (result.Error == GameActions::Status::Ok) + if (result.Error == GameActions::Status::ok) { anySuccess = true; cost += result.Cost; @@ -1326,7 +1326,7 @@ namespace OpenRCT2::Ui::Windows { *mapPos, placement.baseZ }, placement.slope, selectedType, gFootpathSelection.Railings, kInvalidDirection, constructFlags); footpathPlaceAction.SetCallback([this](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + if (result->Error == GameActions::Status::ok) { // Don't play sound if it is no cost to prevent multiple sounds. TODO: make this work in no money scenarios if (result->Cost != 0) @@ -1420,7 +1420,7 @@ namespace OpenRCT2::Ui::Windows footpathPlaceAction.SetCallback( [footpathLoc](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + if (result->Error == GameActions::Status::ok) { Audio::Play3D(OpenRCT2::Audio::SoundId::placeItem, result->Position); } @@ -1432,7 +1432,7 @@ namespace OpenRCT2::Ui::Windows return; } - if (result->Error == GameActions::Status::Ok) + if (result->Error == GameActions::Status::ok) { if (_footpathConstructSlope == SlopePitch::flat) { @@ -1942,7 +1942,7 @@ namespace OpenRCT2::Ui::Windows res = GameActions::Execute(&footpathPlaceAction, getGameState()); // The latter status will be returned if there is already path at the tile in question, to prevent a ghost // from glitching through the existing path. - if (res.Error == GameActions::Status::Ok || res.Error == GameActions::Status::ItemAlreadyPlaced) + if (res.Error == GameActions::Status::ok || res.Error == GameActions::Status::itemAlreadyPlaced) { succesfulTiles.emplace_back(tile); cost += res.Cost; diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 7b211c5971..de04ad4060 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -661,7 +661,7 @@ namespace OpenRCT2::Ui::Windows Network::GetCurrentPlayerId() }; pickupAction.SetCallback( [peepnum = number](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) return; auto* windowMgr = GetWindowManager(); WindowBase* wind = windowMgr->FindByNumber(WindowClass::peep, peepnum); @@ -1027,7 +1027,7 @@ namespace OpenRCT2::Ui::Windows { destCoords, tileElement->GetBaseZ() }, Network::GetCurrentPlayerId() }; pickupAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) return; ToolCancel(); gPickupPeepImage = ImageId(); diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 04a3c915e8..d68b0b45aa 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -356,7 +356,7 @@ namespace OpenRCT2::Ui::Windows gMapSelectType, false); auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landSmoothAction, gameState) : GameActions::Query(&landSmoothAction, gameState); - return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + return res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; } auto landRaiseAction = GameActions::LandRaiseAction( @@ -365,7 +365,7 @@ namespace OpenRCT2::Ui::Windows auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landRaiseAction, gameState) : GameActions::Query(&landRaiseAction, gameState); - return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + return res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; } /** @@ -389,7 +389,7 @@ namespace OpenRCT2::Ui::Windows gMapSelectType, true); auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landSmoothAction, gameState) : GameActions::Query(&landSmoothAction, gameState); - return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + return res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; } auto landLowerAction = GameActions::LandLowerAction( @@ -398,7 +398,7 @@ namespace OpenRCT2::Ui::Windows auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landLowerAction, gameState) : GameActions::Query(&landLowerAction, gameState); - return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + return res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; } /** diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index e10b49ac0e..a2bcb58009 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -536,13 +536,13 @@ namespace OpenRCT2::Ui::Windows { auto landSetRightsAction = GetLandSetAction(); auto res = GameActions::Query(&landSetRightsAction, gameState); - _landRightsCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + _landRightsCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; } else { auto landBuyRightsAction = GetLandBuyAction(); auto res = GameActions::Query(&landBuyRightsAction, gameState); - _landRightsCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + _landRightsCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; } } diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index be4fe99028..b45bb8c47f 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -484,7 +484,7 @@ namespace OpenRCT2::Ui::Windows auto gameAction = GameActions::PeepSpawnPlaceAction({ mapCoords, mapZ, static_cast(direction) }); auto result = GameActions::Execute(&gameAction, getGameState()); - if (result.Error == GameActions::Status::Ok) + if (result.Error == GameActions::Status::ok) { Audio::Play3D(Audio::SoundId::placeItem, result.Position); } diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 129fcd27d8..22acbb77c7 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -364,7 +364,7 @@ namespace OpenRCT2::Ui::Windows rideEntranceExitPlaceAction.SetCallback([=, this]( const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) return; OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::placeItem, result->Position); @@ -429,7 +429,7 @@ namespace OpenRCT2::Ui::Windows auto action = GameActions::MazeSetTrackAction(loc, false, _currentRideIndex, mode); action.SetFlags(actionFlags); const auto res = GameActions::Execute(&action, getGameState()); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { return; } diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 8d2c640487..02b7357e2f 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -269,7 +269,7 @@ namespace OpenRCT2::Ui::Windows auto gameAction = GameActions::ParkMarketingAction( Campaign.campaign_type, Campaign.RideId.ToUnderlying(), Campaign.no_weeks); gameAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + if (result->Error == GameActions::Status::ok) { auto* windowMgr = Ui::GetWindowManager(); windowMgr->CloseByClass(WindowClass::newCampaign); diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index f450d6e0da..1a1599c25a 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -533,7 +533,7 @@ namespace OpenRCT2::Ui::Windows auto playerSetGroupAction = GameActions::PlayerSetGroupAction(playerId, groupId); playerSetGroupAction.SetCallback( [windowHandle](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + if (result->Error == GameActions::Status::ok) { auto* windowMgr = Ui::GetWindowManager(); windowMgr->InvalidateByNumber(windowHandle.first, windowHandle.second); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 71cab9eaf1..f45b5d7d1d 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -4483,7 +4483,7 @@ namespace OpenRCT2::Ui::Windows rideId, GameActions::RideSetAppearanceType::EntranceStyle, objIndex, 0); rideSetAppearanceAction.SetCallback( [objIndex](const GameActions::GameAction*, const GameActions::Result* res) { - if (res->Error != GameActions::Status::Ok) + if (res->Error != GameActions::Status::ok) return; getGameState().lastEntranceStyle = objIndex; }); @@ -4496,7 +4496,7 @@ namespace OpenRCT2::Ui::Windows rideId, GameActions::RideSetAppearanceType::VehicleColourScheme, dropdownIndex, 0); rideSetAppearanceAction.SetCallback( [this](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + if (result->Error == GameActions::Status::ok) { resetVehicleIndex(); } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index ed30e23859..d37d392400 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2337,7 +2337,7 @@ namespace OpenRCT2::Ui::Windows } auto res = GameActions::Execute(&trackPlaceAction, getGameState()); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { _trackPlaceCost = kMoney64Undefined; _trackPlaceErrorMessage = std::get(res.ErrorMessage); @@ -2348,7 +2348,7 @@ namespace OpenRCT2::Ui::Windows _trackPlaceErrorMessage = kStringIdNone; } - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { return; } @@ -2460,7 +2460,7 @@ namespace OpenRCT2::Ui::Windows { _currentTrackBegin.x, _currentTrackBegin.y, _currentTrackBegin.z, currentDirection }); trackRemoveAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) { WindowRideConstructionUpdateActiveElements(); } @@ -2665,7 +2665,7 @@ namespace OpenRCT2::Ui::Windows rideEntranceExitPlaceAction.SetCallback( [=, this](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) return; OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::placeItem, result->Position); @@ -2951,7 +2951,7 @@ namespace OpenRCT2::Ui::Windows static void RideConstructPlacedForwardGameActionCallback( const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) { WindowRideConstructionUpdateActiveElements(); return; @@ -2998,7 +2998,7 @@ namespace OpenRCT2::Ui::Windows static void RideConstructPlacedBackwardGameActionCallback( const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) { WindowRideConstructionUpdateActiveElements(); return; @@ -3700,7 +3700,7 @@ namespace OpenRCT2::Ui::Windows auto gameAction = GameActions::MazeSetTrackAction( CoordsXYZD{ _currentTrackBegin, 0 }, true, _currentRideIndex, GC_SET_MAZE_TRACK_BUILD); auto mazeSetTrackResult = GameActions::Execute(&gameAction, getGameState()); - if (mazeSetTrackResult.Error == GameActions::Status::Ok) + if (mazeSetTrackResult.Error == GameActions::Status::ok) { _trackPlaceCost = mazeSetTrackResult.Cost; _trackPlaceErrorMessage = kStringIdNone; @@ -3713,7 +3713,7 @@ namespace OpenRCT2::Ui::Windows gDisableErrorWindowSound = false; - if (mazeSetTrackResult.Error != GameActions::Status::Ok) + if (mazeSetTrackResult.Error != GameActions::Status::ok) { _rideConstructionState = RideConstructionState::Place; StringId errorText = std::get(mazeSetTrackResult.ErrorMessage); @@ -4762,7 +4762,7 @@ namespace OpenRCT2::Ui::Windows gameAction.SetFlags(flags); auto result = GameActions::Execute(&gameAction, getGameState()); - if (result.Error != GameActions::Status::Ok) + if (result.Error != GameActions::Status::ok) return kMoney64Undefined; _unkF440C5 = { trackPos, static_cast(trackDirection) }; @@ -4780,7 +4780,7 @@ namespace OpenRCT2::Ui::Windows trackPlaceAction.SetFlags({ CommandFlag::allowDuringPaused, CommandFlag::noSpend, CommandFlag::ghost }); // This command must not be sent over the network auto res = GameActions::Execute(&trackPlaceAction, getGameState()); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) return kMoney64Undefined; int16_t zBegin{}, zEnd{}; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index c2deb740f8..49e8522775 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -2054,7 +2054,7 @@ namespace OpenRCT2::Ui::Windows loc, quadrant, entryIndex, primaryColour, secondaryColour, tertiaryColour); smallSceneryPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused }); auto res = GameActions::Execute(&smallSceneryPlaceAction, getGameState()); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) return kMoney64Undefined; const auto placementData = res.GetData(); @@ -2088,7 +2088,7 @@ namespace OpenRCT2::Ui::Windows auto footpathAdditionPlaceAction = GameActions::FootpathAdditionPlaceAction(loc, entryIndex); footpathAdditionPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused }); footpathAdditionPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) { return; } @@ -2096,7 +2096,7 @@ namespace OpenRCT2::Ui::Windows gSceneryGhostType |= SCENERY_GHOST_FLAG_1; }); auto res = GameActions::Execute(&footpathAdditionPlaceAction, getGameState()); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) return kMoney64Undefined; return res.Cost; @@ -2113,7 +2113,7 @@ namespace OpenRCT2::Ui::Windows entryIndex, loc, edge, primaryColour, secondaryColour, tertiaryColour); wallPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused, CommandFlag::noSpend }); wallPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) return; const auto placementData = result->GetData(); @@ -2124,7 +2124,7 @@ namespace OpenRCT2::Ui::Windows }); auto res = GameActions::Execute(&wallPlaceAction, getGameState()); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) return kMoney64Undefined; return res.Cost; @@ -2141,7 +2141,7 @@ namespace OpenRCT2::Ui::Windows loc, entryIndex, primaryColour, secondaryColour, tertiaryColour); sceneryPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused, CommandFlag::noSpend }); auto res = GameActions::Execute(&sceneryPlaceAction, getGameState()); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) return kMoney64Undefined; const auto placementData = res.GetData(); @@ -2173,7 +2173,7 @@ namespace OpenRCT2::Ui::Windows auto bannerPlaceAction = GameActions::BannerPlaceAction(loc, entryIndex, primaryColour); bannerPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused, CommandFlag::noSpend }); auto res = GameActions::Execute(&bannerPlaceAction, getGameState()); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) return kMoney64Undefined; gSceneryGhostPosition = loc; @@ -2965,7 +2965,7 @@ namespace OpenRCT2::Ui::Windows zAttemptRange = 20; } - auto success = GameActions::Status::Unknown; + auto success = GameActions::Status::unknown; // Try find a valid z coordinate for (; zAttemptRange != 0; zAttemptRange--) { @@ -2976,12 +2976,12 @@ namespace OpenRCT2::Ui::Windows auto& gameState = getGameState(); auto res = GameActions::Query(&smallSceneryPlaceAction, gameState); success = res.Error; - if (res.Error == GameActions::Status::Ok) + if (res.Error == GameActions::Status::ok) { break; } - if (res.Error == GameActions::Status::InsufficientFunds) + if (res.Error == GameActions::Status::insufficientFunds) { break; } @@ -2992,7 +2992,7 @@ namespace OpenRCT2::Ui::Windows } // Actually place - if (success == GameActions::Status::Ok || ((q + 1 == quantity) && forceError)) + if (success == GameActions::Status::ok || ((q + 1 == quantity) && forceError)) { auto smallSceneryPlaceAction = GameActions::SmallSceneryPlaceAction( { cur_grid_x, cur_grid_y, gSceneryPlaceZ, gSceneryPlaceRotation }, quadrant, selectedScenery, @@ -3000,7 +3000,7 @@ namespace OpenRCT2::Ui::Windows smallSceneryPlaceAction.SetCallback( [=](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + if (result->Error == GameActions::Status::ok) { Audio::Play3D(Audio::SoundId::placeItem, result->Position); } @@ -3008,12 +3008,12 @@ namespace OpenRCT2::Ui::Windows auto& gameState = getGameState(); auto res = GameActions::Execute(&smallSceneryPlaceAction, gameState); - if (res.Error == GameActions::Status::Ok) + if (res.Error == GameActions::Status::ok) { forceError = false; } - if (res.Error == GameActions::Status::InsufficientFunds) + if (res.Error == GameActions::Status::insufficientFunds) { break; } @@ -3034,7 +3034,7 @@ namespace OpenRCT2::Ui::Windows auto footpathAdditionPlaceAction = GameActions::FootpathAdditionPlaceAction({ gridPos, z }, selectedScenery); footpathAdditionPlaceAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) { return; } @@ -3092,7 +3092,7 @@ namespace OpenRCT2::Ui::Windows auto& gameState = getGameState(); auto res = GameActions::Query(&wallPlaceAction, gameState); - if (res.Error == GameActions::Status::Ok) + if (res.Error == GameActions::Status::ok) { break; } @@ -3184,7 +3184,7 @@ namespace OpenRCT2::Ui::Windows wallPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused }); auto result = GameActions::Execute(&wallPlaceAction, gameState); - if (result.Error == GameActions::Status::Ok) + if (result.Error == GameActions::Status::ok) { const auto placementData = result.GetData(); _provisionalTiles.push_back({ CoordsXYZD(x, y, gSceneryPlaceZ, _startEdge), placementData.BaseHeight }); @@ -3233,7 +3233,7 @@ namespace OpenRCT2::Ui::Windows auto z = gSceneryPlaceZ > 0 ? gSceneryPlaceZ : TileElementHeight(_dragStartPos); Audio::Play3D(Audio::SoundId::error, { _dragStartPos, z }); - if (_lastProvisionalError.Error != GameActions::Status::Ok) + if (_lastProvisionalError.Error != GameActions::Status::ok) { auto windowManager = Ui::GetWindowManager(); windowManager->ShowError( @@ -3255,7 +3255,7 @@ namespace OpenRCT2::Ui::Windows auto& gameState = getGameState(); auto result = GameActions::Execute(&wallPlaceAction, gameState); - if (result.Error == GameActions::Status::Ok) + if (result.Error == GameActions::Status::ok) { anySuccessful = true; lastLocation = result.Position; @@ -3294,7 +3294,7 @@ namespace OpenRCT2::Ui::Windows auto& gameState = getGameState(); auto res = GameActions::Query(&sceneryPlaceAction, gameState); - if (res.Error == GameActions::Status::Ok) + if (res.Error == GameActions::Status::ok) { break; } @@ -3318,7 +3318,7 @@ namespace OpenRCT2::Ui::Windows auto sceneryPlaceAction = GameActions::LargeSceneryPlaceAction( loc, selectedScenery, _sceneryPrimaryColour, _scenerySecondaryColour, _sceneryTertiaryColour); sceneryPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + if (result->Error == GameActions::Status::ok) { Audio::Play3D(Audio::SoundId::placeItem, result->Position); } @@ -3345,7 +3345,7 @@ namespace OpenRCT2::Ui::Windows auto primaryColour = _sceneryPrimaryColour; auto bannerPlaceAction = GameActions::BannerPlaceAction(loc, selectedScenery, primaryColour); bannerPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + if (result->Error == GameActions::Status::ok) { auto data = result->GetData(); Audio::Play3D(Audio::SoundId::placeItem, result->Position); diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 450ca15550..310336f241 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -388,7 +388,7 @@ namespace OpenRCT2::Ui::Windows Network::GetCurrentPlayerId() }; pickupAction.SetCallback( [peepnum = number](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) return; auto* windowMgr = GetWindowManager(); @@ -719,7 +719,7 @@ namespace OpenRCT2::Ui::Windows { destCoords, tileElement->GetBaseZ() }, Network::GetCurrentPlayerId() }; pickupAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) return; ToolCancel(); gPickupPeepImage = ImageId(); diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index ae05ddd7c2..bafd32089a 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -546,7 +546,7 @@ namespace OpenRCT2::Ui::Windows auto hireStaffAction = GameActions::StaffHireNewAction(autoPosition, staffType, costume, staffOrders); hireStaffAction.SetCallback([=](const GameActions::GameAction*, const GameActions::Result* res) -> void { - if (res->Error != GameActions::Status::Ok) + if (res->Error != GameActions::Status::ok) return; auto actionResult = res->GetData(); @@ -564,7 +564,7 @@ namespace OpenRCT2::Ui::Windows Network::GetCurrentPlayerId() }; pickupAction.SetCallback( [staffId = staff->Id](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) return; auto* staff2 = getGameState().entities.GetEntity(staffId); diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 08c4278ed9..74aa3d24b0 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -222,13 +222,13 @@ namespace OpenRCT2::Ui::Windows CoordsXYZD ghostTrackLoc = trackLoc; auto res = FindValidTrackDesignPlaceHeight(ghostTrackLoc, { CommandFlag::noSpend, CommandFlag::ghost }); - if (res.Error == GameActions::Status::Ok) + if (res.Error == GameActions::Status::ok) { // Valid location found. Place the ghost at the location. auto tdAction = GameActions::TrackDesignAction(ghostTrackLoc, *_trackDesign, !gTrackDesignSceneryToggle); tdAction.SetFlags({ CommandFlag::noSpend, CommandFlag::ghost }); tdAction.SetCallback([&](const GameActions::GameAction*, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + if (result->Error == GameActions::Status::ok) { _placementGhostRideId = result->GetData(); _placementGhostLoc = ghostTrackLoc; @@ -236,7 +236,7 @@ namespace OpenRCT2::Ui::Windows } }); res = GameActions::Execute(&tdAction, getGameState()); - cost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + cost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; VirtualFloorSetHeight(ghostTrackLoc.z); } @@ -284,7 +284,7 @@ namespace OpenRCT2::Ui::Windows // Try increasing Z until a feasible placement is found CoordsXYZ trackLoc = { mapCoords, maybeMapZ.value() }; auto res = FindValidTrackDesignPlaceHeight(trackLoc, {}); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { // Unable to build track Audio::Play3D(Audio::SoundId::error, trackLoc); @@ -299,7 +299,7 @@ namespace OpenRCT2::Ui::Windows auto tdAction = GameActions::TrackDesignAction( { trackLoc, _currentTrackPieceDirection }, *_trackDesign, !gTrackDesignSceneryToggle); tdAction.SetCallback([&, trackLoc](const GameActions::GameAction*, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (result->Error != GameActions::Status::ok) { Audio::Play3D(Audio::SoundId::error, result->Position); _placingTrackDesign = false; @@ -403,7 +403,7 @@ namespace OpenRCT2::Ui::Windows { _placementGhostLoc }, *_trackDesign, !gTrackDesignSceneryToggle); tdAction.SetFlags({ CommandFlag::noSpend, CommandFlag::ghost }); auto res = GameActions::Execute(&tdAction, getGameState()); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { _hasPlacementGhost = false; } @@ -753,7 +753,7 @@ namespace OpenRCT2::Ui::Windows // If successful don't keep trying. // If failure due to no money then increasing height only makes problem worse - if (res.Error == GameActions::Status::Ok || res.Error == GameActions::Status::InsufficientFunds) + if (res.Error == GameActions::Status::ok || res.Error == GameActions::Status::insufficientFunds) { return res; } diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index e28ee615e4..b87921134b 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -308,10 +308,10 @@ namespace OpenRCT2::Ui::Windows { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); auto res = GameActions::Query(&waterLowerAction, gameState); - money64 lowerCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + money64 lowerCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; res = GameActions::Query(&waterRaiseAction, gameState); - money64 raiseCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + money64 raiseCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; if (_waterToolRaiseCost != raiseCost || _waterToolLowerCost != lowerCost) { @@ -398,10 +398,10 @@ namespace OpenRCT2::Ui::Windows { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); auto res = GameActions::Query(&waterLowerAction, gameState); - money64 lowerCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + money64 lowerCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; res = GameActions::Query(&waterRaiseAction, gameState); - money64 raiseCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + money64 raiseCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; if (_waterToolRaiseCost != raiseCost || _waterToolLowerCost != lowerCost) { diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index 3e38a06350..b51cc2645e 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -864,7 +864,7 @@ namespace OpenRCT2 action->SetFlags(action->GetFlags().with(CommandFlag::replay)); GameActions::Result result = GameActions::Execute(action, gameState); - if (result.Error == GameActions::Status::Ok) + if (result.Error == GameActions::Status::ok) { isPositionValid = true; } diff --git a/src/openrct2/actions/BalloonPressAction.cpp b/src/openrct2/actions/BalloonPressAction.cpp index f3562fb956..7065ca4c96 100644 --- a/src/openrct2/actions/BalloonPressAction.cpp +++ b/src/openrct2/actions/BalloonPressAction.cpp @@ -44,7 +44,7 @@ namespace OpenRCT2::GameActions if (balloon == nullptr) { LOG_ERROR("Balloon not found for spriteIndex %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND); } return Result(); } @@ -55,7 +55,7 @@ namespace OpenRCT2::GameActions if (balloon == nullptr) { LOG_ERROR("Balloon not found for spriteIndex %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND); } balloon->Press(); diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index 1f345bd099..3236e41ece 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -62,45 +62,45 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); } if (!MapCheckCapacityAndReorganise(_loc)) { LOG_ERROR("No free map elements."); - return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } auto pathElement = GetValidPathElement(); if (pathElement == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_BUILT_ACROSS_PATHS); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_BUILT_ACROSS_PATHS); } if (!MapCanBuildAt(_loc)) { - return Result(Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } auto baseHeight = _loc.z + kPathHeightStep; BannerElement* existingBannerElement = MapGetBannerElementAt({ _loc.x, _loc.y, baseHeight }, _loc.direction); if (existingBannerElement != nullptr) { - return Result(Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, STR_BANNER_SIGN_IN_THE_WAY); + return Result(Status::itemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, STR_BANNER_SIGN_IN_THE_WAY); } if (HasReachedBannerLimit()) { LOG_ERROR("No free banners available"); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(_bannerType); if (bannerEntry == nullptr) { LOG_ERROR("Banner entry not found for bannerType %u", _bannerType); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } res.Cost = bannerEntry->price; res.SetData(BannerPlaceActionResult{}); @@ -120,21 +120,21 @@ namespace OpenRCT2::GameActions if (!MapCheckCapacityAndReorganise(_loc)) { LOG_ERROR("No free map elements."); - return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(_bannerType); if (bannerEntry == nullptr) { LOG_ERROR("Banner entry not found for bannerType %u", _bannerType); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } auto banner = CreateBanner(); if (banner == nullptr) { LOG_ERROR("No free banners available"); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } banner->flags = {}; banner->text = {}; diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index 6c6c7cb3be..79257169f6 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -55,11 +55,11 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } if (!MapCanBuildAt({ _loc.x, _loc.y, _loc.z - 16 })) { - return Result(Status::NotOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } BannerElement* bannerElement = GetBannerElementAt(); @@ -67,21 +67,21 @@ namespace OpenRCT2::GameActions { LOG_ERROR( "Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BannerIndex::GetNull()) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto* bannerEntry = ObjectManager::GetObjectEntry(banner->type); @@ -107,21 +107,21 @@ namespace OpenRCT2::GameActions { LOG_ERROR( "Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BannerIndex::GetNull()) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto* bannerEntry = ObjectManager::GetObjectEntry(banner->type); diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index 1b8348513d..b53a20fbba 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -66,18 +66,18 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { LOG_ERROR("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP); } if (_primaryColour > 31) { LOG_ERROR("Invalid primary colour %u", _primaryColour); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } if (!MapCanBuildAt({ _loc.x, _loc.y, _loc.z - 16 })) { - return Result(Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } auto bannerElement = MapGetBannerElementAt(_loc, _loc.direction); @@ -85,7 +85,7 @@ namespace OpenRCT2::GameActions if (bannerElement == nullptr) { LOG_ERROR("No banner at x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return Result(Status::Unknown, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::unknown, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } auto index = bannerElement->GetIndex(); @@ -93,7 +93,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("Invalid banner index %u", index); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if (isExecuting) diff --git a/src/openrct2/actions/BannerSetNameAction.cpp b/src/openrct2/actions/BannerSetNameAction.cpp index e2252acf2c..ea0f33b072 100644 --- a/src/openrct2/actions/BannerSetNameAction.cpp +++ b/src/openrct2/actions/BannerSetNameAction.cpp @@ -51,7 +51,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } TileElement* tileElement = BannerGetTileElement(_bannerIndex); @@ -59,7 +59,7 @@ namespace OpenRCT2::GameActions if (tileElement == nullptr) { LOG_ERROR("Banner tile element not found for bannerIndex %d", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } BannerElement* bannerElement = tileElement->AsBanner(); @@ -67,11 +67,11 @@ namespace OpenRCT2::GameActions if (!LocationValid(loc)) { - return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP); } if (!MapCanBuildAt({ loc.x, loc.y, loc.z - 16 })) { - return Result(Status::NotOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK); } return Result(); @@ -83,7 +83,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } banner->text = _name; diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 1101da6b14..83b10a3a5d 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return Result(Status::InvalidParameters, errorTitle, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, errorTitle, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } res.Expenditure = ExpenditureType::landscaping; @@ -73,7 +73,7 @@ namespace OpenRCT2::GameActions if (tileElement == nullptr) { LOG_ERROR("Banner tile element not found for bannerIndex %d", _bannerIndex); - return Result(Status::InvalidParameters, errorTitle, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, errorTitle, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } BannerElement* bannerElement = tileElement->AsBanner(); @@ -81,11 +81,11 @@ namespace OpenRCT2::GameActions if (!LocationValid(loc)) { - return Result(Status::InvalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP); } if (!MapCanBuildAt({ loc.x, loc.y, loc.z - 16 })) { - return Result(Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); } switch (_type) @@ -94,7 +94,7 @@ namespace OpenRCT2::GameActions if (_parameter > COLOUR_COUNT) { LOG_ERROR("Invalid primary colour %u", _parameter); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } break; @@ -102,19 +102,19 @@ namespace OpenRCT2::GameActions if (_parameter > 13) { LOG_ERROR("Invalid text colour %u", _parameter); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } break; case BannerSetStyleType::NoEntry: if (tileElement->AsBanner() == nullptr) { LOG_ERROR("Tile element was not a banner."); - return Result(Status::Unknown, STR_CANT_RENAME_BANNER, kStringIdNone); + return Result(Status::unknown, STR_CANT_RENAME_BANNER, kStringIdNone); } break; default: LOG_ERROR("Invalid banner style type %u", _type); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE); } return res; } @@ -127,7 +127,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } res.Expenditure = ExpenditureType::landscaping; @@ -139,7 +139,7 @@ namespace OpenRCT2::GameActions if (tileElement == nullptr) { LOG_ERROR("Banner tile element not found for bannerIndex &u", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } switch (_type) @@ -156,7 +156,7 @@ namespace OpenRCT2::GameActions if (bannerElement == nullptr) { LOG_ERROR("Tile element was not a banner."); - return Result(Status::Unknown, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::unknown, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } banner->flags.set(BannerFlag::noEntry, (_parameter != 0)); @@ -170,7 +170,7 @@ namespace OpenRCT2::GameActions } default: LOG_ERROR("Invalid banner style type %u", _type); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE); } auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index 5c59ce52e6..80083120e6 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -79,7 +79,7 @@ namespace OpenRCT2::GameActions if (static_cast(_cheatType) >= static_cast(CheatType::count)) { LOG_ERROR("Invalid cheat type %u", _cheatType); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } ParametersRange validRange = GetParameterRange(static_cast(_cheatType.id)); @@ -89,14 +89,14 @@ namespace OpenRCT2::GameActions LOG_ERROR( "The first cheat parameter is out of range. Value = %d, min = %d, max = %d", _param1, validRange.first.first, validRange.first.second); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } if (_param2 < validRange.second.first || _param2 > validRange.second.second) { LOG_ERROR( "The second cheat parameter is out of range. Value = %d, min = %d, max = %d", _param2, validRange.second.first, validRange.second.second); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } return Result(); @@ -274,7 +274,7 @@ namespace OpenRCT2::GameActions default: { LOG_ERROR("Invalid cheat type %d", _cheatType.id); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } } diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index f789175d4d..fce603a33d 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -80,7 +80,7 @@ namespace OpenRCT2::GameActions auto result = CreateResult(); auto noValidTiles = true; - auto error = Status::Ok; + auto error = Status::ok; StringId errorMessage = kStringIdNone; money64 totalCost = 0; @@ -100,7 +100,7 @@ namespace OpenRCT2::GameActions } else { - error = Status::NotOwned; + error = Status::notOwned; errorMessage = STR_LAND_NOT_OWNED_BY_PARK; } } @@ -149,12 +149,12 @@ namespace OpenRCT2::GameActions auto res = executing ? ExecuteNested(&footpathRemoveAction, gameState) : QueryNested(&footpathRemoveAction, gameState); - if (res.Error == Status::Ok) + if (res.Error == Status::ok) { totalCost += res.Cost; tileEdited = executing; } - else if (res.Error == Status::InsufficientFunds) + else if (res.Error == Status::insufficientFunds) { totalCost += res.Cost; } @@ -171,12 +171,12 @@ namespace OpenRCT2::GameActions auto res = executing ? ExecuteNested(&removeSceneryAction, gameState) : QueryNested(&removeSceneryAction, gameState); - if (res.Error == Status::Ok) + if (res.Error == Status::ok) { totalCost += res.Cost; tileEdited = executing; } - else if (res.Error == Status::InsufficientFunds) + else if (res.Error == Status::insufficientFunds) { totalCost += res.Cost; } @@ -192,12 +192,12 @@ namespace OpenRCT2::GameActions auto res = executing ? ExecuteNested(&wallRemoveAction, gameState) : QueryNested(&wallRemoveAction, gameState); - if (res.Error == Status::Ok) + if (res.Error == Status::ok) { totalCost += res.Cost; tileEdited = executing; } - else if (res.Error == Status::InsufficientFunds) + else if (res.Error == Status::insufficientFunds) { totalCost += res.Cost; } @@ -214,12 +214,12 @@ namespace OpenRCT2::GameActions auto res = executing ? ExecuteNested(&removeSceneryAction, gameState) : QueryNested(&removeSceneryAction, gameState); - if (res.Error == Status::Ok) + if (res.Error == Status::ok) { totalCost += res.Cost; tileEdited = executing; } - else if (res.Error == Status::InsufficientFunds) + else if (res.Error == Status::insufficientFunds) { totalCost += res.Cost; } diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 63f550c7d1..49524ebe91 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -58,36 +58,36 @@ namespace OpenRCT2::GameActions res.Position = _loc; if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); } if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc)) { - return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } if (_loc.z < kFootpathMinHeight) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_LOW); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_LOW); } if (_loc.z > kFootpathMaxHeight) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_HIGH); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_HIGH); } auto tileElement = MapGetFootpathElement(_loc); if (tileElement == nullptr) { LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND); } auto pathElement = tileElement->AsPath(); if (pathElement->IsLevelCrossing(_loc)) { return Result( - Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANNOT_BUILD_PATH_ADDITIONS_ON_LEVEL_CROSSINGS); + Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANNOT_BUILD_PATH_ADDITIONS_ON_LEVEL_CROSSINGS); } // No change @@ -101,29 +101,29 @@ namespace OpenRCT2::GameActions if (pathAdditionEntry == nullptr) { LOG_ERROR("Unknown footpath addition entry for entryIndex %d", _entryIndex); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } uint16_t sceneryFlags = pathAdditionEntry->flags; if ((sceneryFlags & PATH_ADDITION_FLAG_DONT_ALLOW_ON_SLOPE) && pathElement->IsSloped()) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_ON_SLOPED_FOOTPATH); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_ON_SLOPED_FOOTPATH); } if ((sceneryFlags & PATH_ADDITION_FLAG_DONT_ALLOW_ON_QUEUE) && pathElement->IsQueue()) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANNOT_PLACE_THESE_ON_QUEUE_LINE_AREA); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANNOT_PLACE_THESE_ON_QUEUE_LINE_AREA); } if (!(sceneryFlags & (PATH_ADDITION_FLAG_JUMPING_FOUNTAIN_WATER | PATH_ADDITION_FLAG_JUMPING_FOUNTAIN_SNOW)) && (pathElement->GetEdges()) == 0x0F) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_PLACED_ON_PATH_EDGES); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_PLACED_ON_PATH_EDGES); } if ((sceneryFlags & PATH_ADDITION_FLAG_IS_QUEUE_SCREEN) && !pathElement->IsQueue()) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_PLACE_THESE_ON_QUEUE_AREA); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_PLACE_THESE_ON_QUEUE_AREA); } res.Cost = pathAdditionEntry->price; @@ -134,7 +134,7 @@ namespace OpenRCT2::GameActions // Check if there is something on the path already if (pathElement->HasAddition()) { - return Result(Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, kStringIdNone); + return Result(Status::itemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, kStringIdNone); } } return res; @@ -152,7 +152,7 @@ namespace OpenRCT2::GameActions if (pathElement == nullptr) { LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND); } // No change @@ -166,7 +166,7 @@ namespace OpenRCT2::GameActions if (pathAdditionEntry == nullptr) { LOG_ERROR("Unknown footpath addition entry for entryIndex %d", _entryIndex); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } res.Cost = pathAdditionEntry->price; diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index 8c39423832..e063069def 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -50,42 +50,42 @@ namespace OpenRCT2::GameActions { if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc)) { - return Result(Status::Disallowed, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } if (_loc.z < kFootpathMinHeight) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_TOO_LOW); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_TOO_LOW); } if (_loc.z > kFootpathMaxHeight) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_TOO_HIGH); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_TOO_HIGH); } auto tileElement = MapGetFootpathElement(_loc); if (tileElement == nullptr) { LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND); } auto pathElement = tileElement->AsPath(); if (pathElement == nullptr) { LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND); } if (!pathElement->AdditionIsGhost() && (GetFlags().has(CommandFlag::ghost))) { LOG_WARNING("Tried to remove non ghost during ghost removal."); - return Result(Status::Disallowed, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::disallowed, STR_CANT_REMOVE_THIS, kStringIdNone); } auto res = Result(); res.Position = _loc; @@ -104,7 +104,7 @@ namespace OpenRCT2::GameActions if (pathElement == nullptr) { LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND); } pathElement->SetAddition(0); diff --git a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp index 5df4fec213..83c71d6d8f 100644 --- a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp +++ b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp @@ -76,22 +76,22 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc) || MapIsEdge(_loc)) { - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); } if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc)) { - return Result(Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } if (_loc.z < kFootpathMinHeight) { - return Result(Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_LOW); + return Result(Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_LOW); } if (_loc.z > kFootpathMaxHeight) { - return Result(Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH); + return Result(Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH); } return ElementInsertQuery(std::move(res)); @@ -124,7 +124,7 @@ namespace OpenRCT2::GameActions if (!MapCheckCapacityAndReorganise(_loc)) { return Result( - Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + Status::noFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } res.Cost = 12.00_GBP; @@ -156,7 +156,7 @@ namespace OpenRCT2::GameActions : CreateCrossingMode::pathOverTrack; auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, crossingMode); - if (!entrancePath && canBuild.Error != Status::Ok) + if (!entrancePath && canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; return canBuild; @@ -168,14 +168,14 @@ namespace OpenRCT2::GameActions if (!getGameState().cheats.disableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)) { - return Result(Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); + return Result(Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { return Result( - Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / kPathHeightStep) * 5.00_GBP; @@ -226,7 +226,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags().with(CommandFlag::apply), kTileSlopeFlat, crossingMode); - if (!entrancePath && canBuild.Error != Status::Ok) + if (!entrancePath && canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; return canBuild; @@ -240,7 +240,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { return Result( - Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / kPathHeightStep) * 5.00_GBP; diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 40826cdba1..c00545f63e 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -85,33 +85,33 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc) || MapIsEdge(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_OFF_EDGE_OF_MAP); } if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc)) { - return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_NOT_OWNED_BY_PARK); } if (_slope.type == FootpathSlopeType::irregular || _slope.type == FootpathSlopeType::raise) { - return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_SLOPE_UNSUITABLE); + return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_SLOPE_UNSUITABLE); } if (_loc.z < kFootpathMinHeight) { - return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_LOW); + return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_LOW); } if (_loc.z > kFootpathMaxHeight) { - return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_HIGH); + return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_HIGH); } if (_direction != kInvalidDirection && !DirectionValid(_direction)) { LOG_ERROR("Direction invalid. direction = %u", _direction); - return Result(Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_VALUE_OUT_OF_RANGE); } auto intent = Intent(INTENT_ACTION_REMOVE_PROVISIONAL_FOOTPATH); @@ -215,7 +215,7 @@ namespace OpenRCT2::GameActions { if (_constructFlags & PathConstructFlag::IsQueue && pathElement->IsLevelCrossing(_loc)) { - return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_QUEUE_PATHS_CANNOT_BE_USED_FOR_LEVEL_CROSSINGS); + return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_QUEUE_PATHS_CANNOT_BE_USED_FOR_LEVEL_CROSSINGS); } if (!IsSameAsPathElement(pathElement)) @@ -225,7 +225,7 @@ namespace OpenRCT2::GameActions if (GetFlags().has(CommandFlag::ghost) && !pathElement->IsGhost()) { - return Result(Status::ItemAlreadyPlaced, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone); + return Result(Status::itemAlreadyPlaced, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone); } return res; } @@ -289,7 +289,7 @@ namespace OpenRCT2::GameActions if (!MapCheckCapacityAndReorganise(_loc)) { - return Result(Status::NoFreeElements, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone); + return Result(Status::noFreeElements, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone); } res.Cost = 12.00_GBP; @@ -321,7 +321,7 @@ namespace OpenRCT2::GameActions : CreateCrossingMode::pathOverTrack; auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, crossingMode); - if (!entrancePath && canBuild.Error != Status::Ok) + if (!entrancePath && canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_CANT_BUILD_FOOTPATH_HERE; return canBuild; @@ -333,13 +333,13 @@ namespace OpenRCT2::GameActions gFootpathGroundFlags = clearanceData.GroundFlags; if (!getGameState().cheats.disableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)) { - return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_CANT_BUILD_THIS_UNDERWATER); + return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / kPathHeightStep) * 5.00_GBP; @@ -390,7 +390,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags().with(CommandFlag::apply), kTileSlopeFlat, crossingMode); - if (!entrancePath && canBuild.Error != Status::Ok) + if (!entrancePath && canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_CANT_BUILD_FOOTPATH_HERE; return canBuild; @@ -403,7 +403,7 @@ namespace OpenRCT2::GameActions auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / kPathHeightStep) * 5.00_GBP; diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index 44f5d71ac8..bee2bc9d69 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -57,18 +57,18 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_OFF_EDGE_OF_MAP); } if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc)) { - return Result(Status::NotOwned, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_LAND_NOT_OWNED_BY_PARK); } TileElement* footpathElement = GetFootpathElement(); if (footpathElement == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND); } res.Cost = GetRefundPrice(footpathElement); @@ -94,7 +94,7 @@ namespace OpenRCT2::GameActions { FootpathQueueChainReset(); auto bannerRes = RemoveBannersAtElement(gameState, _loc, footpathElement); - if (bannerRes.Error == Status::Ok) + if (bannerRes.Error == Status::ok) { res.Cost += bannerRes.Cost; } @@ -116,7 +116,7 @@ namespace OpenRCT2::GameActions } else { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, kStringIdNone); } res.Cost += GetRefundPrice(footpathElement); @@ -174,7 +174,7 @@ namespace OpenRCT2::GameActions auto res = ExecuteNested(&bannerRemoveAction, gameState); // Ghost removal is free - if (res.Error == Status::Ok && !isGhost) + if (res.Error == Status::ok && !isGhost) { result.Cost += res.Cost; } diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index 5a5efa48d7..bfa023f178 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -143,7 +143,7 @@ namespace OpenRCT2::GameActions Guard::Assert(action != nullptr); Result result = Execute(action, getGameState()); - if (result.Error == Status::Ok && Network::GetMode() == Network::Mode::server) + if (result.Error == Status::ok && Network::GetMode() == Network::Mode::server) { // Relay this action to all other clients. Network::SendGameAction(action); @@ -197,7 +197,7 @@ namespace OpenRCT2::GameActions { Result result = Result(); - result.Error = Status::GamePaused; + result.Error = Status::gamePaused; result.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; result.ErrorMessage = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED; @@ -206,11 +206,11 @@ namespace OpenRCT2::GameActions auto result = action->Query(gameState); - if (result.Error == Status::Ok) + if (result.Error == Status::ok) { if (!FinanceCheckAffordability(result.Cost, action->GetFlags())) { - result.Error = Status::InsufficientFunds; + result.Error = Status::insufficientFunds; result.ErrorTitle = STR_CANT_DO_THIS; result.ErrorMessage = STR_NOT_ENOUGH_CASH_REQUIRES; Formatter(result.ErrorMessageArgs.data()).Add(result.Cost); @@ -266,7 +266,7 @@ namespace OpenRCT2::GameActions char temp[128] = {}; - if (result.Error != Status::Ok) + if (result.Error != Status::ok) { snprintf(temp, sizeof(temp), ") Failed, %u", static_cast(result.Error)); } @@ -301,7 +301,7 @@ namespace OpenRCT2::GameActions { // TODO: Introduce proper error. auto result = Result(); - result.Error = Status::GamePaused; + result.Error = Status::gamePaused; result.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; result.ErrorMessage = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED; @@ -311,14 +311,14 @@ namespace OpenRCT2::GameActions Result result = QueryInternal(action, gameState, topLevel); #ifdef ENABLE_SCRIPTING - if (result.Error == Status::Ok && ((Network::GetMode() == Network::Mode::none) || flags.has(CommandFlag::networked))) + if (result.Error == Status::ok && ((Network::GetMode() == Network::Mode::none) || flags.has(CommandFlag::networked))) { auto& scriptEngine = GetContext()->GetScriptEngine(); scriptEngine.RunGameActionHooks(*action, result, false); // Script hooks may now have changed the game action result... } #endif - if (result.Error == Status::Ok) + if (result.Error == Status::ok) { if (topLevel) { @@ -355,7 +355,7 @@ namespace OpenRCT2::GameActions // Execute the action, changing the game state result = action->Execute(gameState); #ifdef ENABLE_SCRIPTING - if (result.Error == Status::Ok) + if (result.Error == Status::ok) { auto& scriptEngine = GetContext()->GetScriptEngine(); scriptEngine.RunGameActionHooks(*action, result, true); @@ -370,13 +370,13 @@ namespace OpenRCT2::GameActions return result; // Update money balance - if (result.Error == Status::Ok && FinanceCheckMoneyRequired(flags) && result.Cost != 0) + if (result.Error == Status::ok && FinanceCheckMoneyRequired(flags) && result.Cost != 0) { FinancePayment(result.Cost, result.Expenditure); MoneyEffect::Create(result.Cost, result.Position); } - if (!(actionFlags & Flags::ClientOnly) && result.Error == Status::Ok) + if (!(actionFlags & Flags::ClientOnly) && result.Error == Status::ok) { if (Network::GetMode() != Network::Mode::none) { @@ -446,7 +446,7 @@ namespace OpenRCT2::GameActions } } - if (result.Error != Status::Ok && shouldShowError) + if (result.Error != Status::ok && shouldShowError) { auto windowManager = Ui::GetWindowManager(); windowManager->ShowError(result.GetErrorTitle(), result.GetErrorMessage()); diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h index f40d2b311f..9273d01c84 100644 --- a/src/openrct2/actions/GameActionResult.h +++ b/src/openrct2/actions/GameActionResult.h @@ -28,25 +28,25 @@ namespace OpenRCT2::GameActions */ enum class Status : uint16_t { - Ok, - InvalidParameters, - Disallowed, - GamePaused, - InsufficientFunds, - NotInEditorMode, + ok, + invalidParameters, + disallowed, + gamePaused, + insufficientFunds, + notInEditorMode, - NotOwned, - TooLow, - TooHigh, - NoClearance, - ItemAlreadyPlaced, + notOwned, + tooLow, + tooHigh, + noClearance, + itemAlreadyPlaced, - NotClosed, - Broken, + notClosed, + broken, - NoFreeElements, + noFreeElements, - Unknown = std::numeric_limits>::max(), + unknown = std::numeric_limits>::max(), }; /** @@ -57,7 +57,7 @@ namespace OpenRCT2::GameActions public: using StringVariant = std::variant; - Status Error = Status::Ok; + Status Error = Status::ok; StringVariant ErrorTitle = kStringIdNone; StringVariant ErrorMessage = kStringIdNone; std::array ErrorMessageArgs{}; diff --git a/src/openrct2/actions/GameSetSpeedAction.cpp b/src/openrct2/actions/GameSetSpeedAction.cpp index d62a8090e0..3d385c914b 100644 --- a/src/openrct2/actions/GameSetSpeedAction.cpp +++ b/src/openrct2/actions/GameSetSpeedAction.cpp @@ -44,7 +44,7 @@ namespace OpenRCT2::GameActions if (!IsValidSpeed(_speed)) { LOG_ERROR("Invalid speed %u", _speed); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } return res; @@ -57,7 +57,7 @@ namespace OpenRCT2::GameActions if (!IsValidSpeed(_speed)) { LOG_ERROR("Invalid speed %u", _speed); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } gGameSpeed = _speed; diff --git a/src/openrct2/actions/GuestSetFlagsAction.cpp b/src/openrct2/actions/GuestSetFlagsAction.cpp index 5183f15ee8..6d33151742 100644 --- a/src/openrct2/actions/GuestSetFlagsAction.cpp +++ b/src/openrct2/actions/GuestSetFlagsAction.cpp @@ -47,7 +47,7 @@ namespace OpenRCT2::GameActions if (peep == nullptr) { LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying()); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone); } return Result(); } @@ -58,7 +58,7 @@ namespace OpenRCT2::GameActions if (peep == nullptr) { LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying()); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone); } peep->PeepFlags = _newFlags; diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index 6c0f622f5a..2e92f3f7a1 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -60,14 +60,14 @@ namespace OpenRCT2::GameActions { if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { - return Result(Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_NAME_GUEST, STR_ERR_VALUE_OUT_OF_RANGE); } auto guest = getGameState().entities.TryGetEntity(_spriteIndex); if (guest == nullptr) { LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_CANT_NAME_GUEST, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_NAME_GUEST, kStringIdNone); } return Result(); @@ -79,7 +79,7 @@ namespace OpenRCT2::GameActions if (guest == nullptr) { LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_CANT_NAME_GUEST, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_NAME_GUEST, kStringIdNone); } auto curName = guest->GetName(); @@ -90,7 +90,7 @@ namespace OpenRCT2::GameActions if (!guest->SetName(_name)) { - return Result(Status::Unknown, STR_CANT_NAME_GUEST, kStringIdNone); + return Result(Status::unknown, STR_CANT_NAME_GUEST, kStringIdNone); } // Easter egg functions are for guests only diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index c61f5bc4f9..7a58f435b8 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -96,7 +96,7 @@ namespace OpenRCT2::GameActions if (!LocationValid({ x, y })) continue; auto result = MapBuyLandRightsForTile({ x, y }, isExecuting); - if (result.Error == Status::Ok) + if (result.Error == Status::ok) { res.Cost += result.Cost; } @@ -114,14 +114,14 @@ namespace OpenRCT2::GameActions if (_setting >= LandBuyRightSetting::Count) { LOG_ERROR("Invalid land buying setting %u", _setting); - return Result(Status::InvalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); } SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y); - return Result(Status::InvalidParameters, kErrorTitles[EnumValue(_setting)], STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, kErrorTitles[EnumValue(_setting)], STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } auto res = Result(); @@ -135,7 +135,7 @@ namespace OpenRCT2::GameActions if (gLegacyScene == LegacyScene::scenarioEditor || (surfaceElement->GetOwnership() & OWNERSHIP_AVAILABLE) == 0) { - return Result(Status::NotOwned, kErrorTitles[EnumValue(_setting)], STR_LAND_NOT_FOR_SALE); + return Result(Status::notOwned, kErrorTitles[EnumValue(_setting)], STR_LAND_NOT_FOR_SALE); } if (isExecuting) { @@ -154,7 +154,7 @@ namespace OpenRCT2::GameActions if (gLegacyScene == LegacyScene::scenarioEditor || (surfaceElement->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) == 0) { - return Result(Status::NotOwned, kErrorTitles[EnumValue(_setting)], STR_CONSTRUCTION_RIGHTS_NOT_FOR_SALE); + return Result(Status::notOwned, kErrorTitles[EnumValue(_setting)], STR_CONSTRUCTION_RIGHTS_NOT_FOR_SALE); } if (isExecuting) @@ -168,7 +168,7 @@ namespace OpenRCT2::GameActions default: LOG_ERROR("Invalid land buying setting %u", _setting); - return Result(Status::InvalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); } } } // namespace OpenRCT2::GameActions diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index 6295306819..dd4f476331 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -127,7 +127,7 @@ namespace OpenRCT2::GameActions landSetHeightAction.SetFlags(GetFlags()); auto result = isExecuting ? ExecuteNested(&landSetHeightAction, gameState) : QueryNested(&landSetHeightAction, gameState); - if (result.Error == Status::Ok) + if (result.Error == Status::ok) { res.Cost += result.Cost; } @@ -141,7 +141,7 @@ namespace OpenRCT2::GameActions if (!withinOwnership) { - return Result(Status::Disallowed, STR_CANT_LOWER_LAND_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, STR_CANT_LOWER_LAND_HERE, STR_LAND_NOT_OWNED_BY_PARK); } // Force ride construction to recheck area diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index 6d2237fd13..ff0e5ab940 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -131,7 +131,7 @@ namespace OpenRCT2::GameActions landSetHeightAction.SetFlags(GetFlags()); auto result = isExecuting ? ExecuteNested(&landSetHeightAction, gameState) : QueryNested(&landSetHeightAction, gameState); - if (result.Error == Status::Ok) + if (result.Error == Status::ok) { res.Cost += result.Cost; } @@ -145,7 +145,7 @@ namespace OpenRCT2::GameActions if (!withinOwnership) { - return Result(Status::Disallowed, STR_CANT_RAISE_LAND_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, STR_CANT_RAISE_LAND_HERE, STR_LAND_NOT_OWNED_BY_PARK); } // Force ride construction to recheck area diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 238a6cca27..178c6062d7 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -62,20 +62,20 @@ namespace OpenRCT2::GameActions { if (gameState.park.flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES) { - return Result(Status::Disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY, kStringIdNone); + return Result(Status::disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY, kStringIdNone); } StringId errorMessage = CheckParameters(); if (errorMessage != kStringIdNone) { - return Result(Status::Disallowed, kStringIdNone, errorMessage); + return Result(Status::disallowed, kStringIdNone, errorMessage); } if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode) { if (!MapIsLocationInPark(_coords)) { - return Result(Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK, kStringIdNone); + return Result(Status::disallowed, STR_LAND_NOT_OWNED_BY_PARK, kStringIdNone); } } @@ -88,7 +88,7 @@ namespace OpenRCT2::GameActions TileElement* tileElement = CheckTreeObstructions(); if (tileElement != nullptr) { - auto res = Result(Status::Disallowed, kStringIdNone, kStringIdNone); + auto res = Result(Status::disallowed, kStringIdNone, kStringIdNone); MapGetObstructionErrorText(tileElement, res); return res; } @@ -102,13 +102,13 @@ namespace OpenRCT2::GameActions errorMessage = CheckRideSupports(); if (errorMessage != kStringIdNone) { - return Result(Status::Disallowed, kStringIdNone, errorMessage); + return Result(Status::disallowed, kStringIdNone, errorMessage); } } auto* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); // We need to check if there is _currently_ a level crossing on the tile. // For that, we need the old height, so we can't use the _height variable. @@ -116,13 +116,13 @@ namespace OpenRCT2::GameActions auto* pathElement = MapGetFootpathElement(oldCoords); if (pathElement != nullptr && pathElement->AsPath()->IsLevelCrossing(oldCoords)) { - return Result(Status::Disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, kStringIdNone); + return Result(Status::disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, kStringIdNone); } TileElement* tileElement = CheckFloatingStructures(reinterpret_cast(surfaceElement), _height); if (tileElement != nullptr) { - auto res = Result(Status::Disallowed, kStringIdNone, kStringIdNone); + auto res = Result(Status::disallowed, kStringIdNone, kStringIdNone); MapGetObstructionErrorText(tileElement, res); return res; } @@ -142,9 +142,9 @@ namespace OpenRCT2::GameActions auto clearResult = MapCanConstructWithClearAt( { _coords, _height * kCoordsZStep, zCorner * kCoordsZStep }, MapSetLandHeightClearFunc, { 0b1111, 0 }, {}, _style, CreateCrossingMode::none); - if (clearResult.Error != Status::Ok) + if (clearResult.Error != Status::ok) { - clearResult.Error = Status::Disallowed; + clearResult.Error = Status::disallowed; return clearResult; } } @@ -169,7 +169,7 @@ namespace OpenRCT2::GameActions auto* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); cost += GetSurfaceHeightChangeCost(surfaceElement); SetSurfaceHeight(reinterpret_cast(surfaceElement)); diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 4b47b49ad9..04794357da 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -88,7 +88,7 @@ namespace OpenRCT2::GameActions if (!isInEditorMode() && !getGameState().cheats.sandboxMode) { - return Result(Status::NotInEditorMode, kStringIdNone, STR_LAND_NOT_FOR_SALE); + return Result(Status::notInEditorMode, kStringIdNone, STR_LAND_NOT_FOR_SALE); } // Game command modified to accept selection size @@ -99,7 +99,7 @@ namespace OpenRCT2::GameActions if (!LocationValid({ x, y })) continue; auto result = MapBuyLandRightsForTile({ x, y }, isExecuting); - if (result.Error == Status::Ok) + if (result.Error == Status::ok) { res.Cost += result.Cost; } @@ -120,7 +120,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } auto res = Result(); @@ -234,7 +234,7 @@ namespace OpenRCT2::GameActions } default: LOG_ERROR("Invalid setting %u to set land rights", _setting); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } } } // namespace OpenRCT2::GameActions diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 8c65e4b5bf..faa6ff28d9 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -238,7 +238,7 @@ namespace OpenRCT2::GameActions landSetHeightAction.SetFlags(GetFlags()); auto res = isExecuting ? ExecuteNested(&landSetHeightAction, gameState) : QueryNested(&landSetHeightAction, gameState); - if (res.Error == Status::Ok) + if (res.Error == Status::ok) { totalCost += res.Cost; } @@ -326,7 +326,7 @@ namespace OpenRCT2::GameActions expectedLandHeight += landChangePerTile; // change land of current tile auto result = SmoothLandTile(gameState, direction, isExecuting, nextLoc, surfaceElement); - if (result.Error == Status::Ok) + if (result.Error == Status::ok) { totalCost += result.Cost; } @@ -642,7 +642,7 @@ namespace OpenRCT2::GameActions } default: LOG_ERROR("Invalid map selection type %u", _selectionType); - return Result(Status::InvalidParameters, std::get(res.ErrorTitle), STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, std::get(res.ErrorTitle), STR_ERR_VALUE_OUT_OF_RANGE); } // switch selectionType // Raise / lower the land tool selection area @@ -659,7 +659,7 @@ namespace OpenRCT2::GameActions lowerLandAction.SetFlags(GetFlags()); result = isExecuting ? ExecuteNested(&lowerLandAction, gameState) : QueryNested(&lowerLandAction, gameState); } - if (result.Error != Status::Ok) + if (result.Error != Status::ok) { return result; } diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index d1e03c70f6..272c34bc02 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -81,29 +81,29 @@ namespace OpenRCT2::GameActions if (_primaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid primary colour %u", _primaryColour); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); } else if (_secondaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid secondary colour %u", _secondaryColour); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); } else if (_tertiaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); } else if (_sceneryType >= kMaxLargeSceneryObjects) { LOG_ERROR("Invalid sceneryType %u", _sceneryType); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE); } auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { LOG_ERROR("Large scenery entry not found for sceneryType %u", _sceneryType); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } const auto totalNumTiles = sceneryEntry->tiles.size(); @@ -121,7 +121,7 @@ namespace OpenRCT2::GameActions if (HasReachedBannerLimit()) { LOG_ERROR("No free banners available"); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } } @@ -140,7 +140,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( { curTile, zLow, zHigh }, MapPlaceSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, CreateCrossingMode::none, isTree); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_CANT_POSITION_THIS_HERE; return canBuild; @@ -154,12 +154,12 @@ namespace OpenRCT2::GameActions { if ((clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) || (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND)) { - return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); + return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } if (resultData.GroundFlags && !(resultData.GroundFlags & tempSceneryGroundFlags)) { return Result( - Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND); + Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND); } } @@ -167,20 +167,20 @@ namespace OpenRCT2::GameActions if (!LocationValid(curTile) || MapIsEdge(curTile)) { - return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); } if (gLegacyScene != LegacyScene::scenarioEditor && !MapIsLocationOwned({ curTile, zLow }) && !gameState.cheats.sandboxMode) { - return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } } if (!CheckMapCapacity(sceneryEntry->tiles, totalNumTiles)) { LOG_ERROR("No free map elements available"); - return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } // Force ride construction to recheck area @@ -211,13 +211,13 @@ namespace OpenRCT2::GameActions if (sceneryEntry == nullptr) { LOG_ERROR("Large scenery entry not found for sceneryType = %u", _sceneryType); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } if (sceneryEntry->tiles.empty()) { LOG_ERROR("Invalid large scenery object, sceneryType = %u", _sceneryType); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, kStringIdNone); } int16_t maxHeight = GetMaxSurfaceHeight(sceneryEntry->tiles); @@ -237,7 +237,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("No free banners available"); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } banner->text = {}; @@ -272,7 +272,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( { curTile, zLow, zHigh }, MapPlaceSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, CreateCrossingMode::none, isTree); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { if (banner != nullptr) { diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index 7bbd7e085d..adeb348196 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -65,7 +65,7 @@ namespace OpenRCT2::GameActions if (tileElement == nullptr) { LOG_ERROR("No large scenery element to remove at x = %d, y = %d", _loc.x, _loc.y); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); @@ -73,7 +73,7 @@ namespace OpenRCT2::GameActions if (sceneryEntry == nullptr) { LOG_WARNING("Scenery entry at x = %d, y = %d not removed because it is an unknown object type", _loc.x, _loc.y); - return Result(Status::Unknown, STR_CANT_REMOVE_THIS, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::unknown, STR_CANT_REMOVE_THIS, STR_UNKNOWN_OBJECT_TYPE); } auto rotatedOffsets = CoordsXYZ{ CoordsXY{ sceneryEntry->tiles[_tileIndex].offset }.Rotate(_loc.direction), @@ -94,7 +94,7 @@ namespace OpenRCT2::GameActions { if (sceneryEntry->HasFlag(LARGE_SCENERY_FLAG_IS_TREE)) { - res.Error = Status::NoClearance; + res.Error = Status::noClearance; res.ErrorTitle = STR_CANT_REMOVE_THIS; res.ErrorMessage = STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY; return res; @@ -103,13 +103,13 @@ namespace OpenRCT2::GameActions if (!MapIsLocationOwned({ currentTile.x, currentTile.y, currentTile.z })) { - return Result(Status::NoClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::noClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } } if (!LocationValid(currentTile)) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } // Prevent duplicate costs when using the clear scenery tool that overlaps multiple large // scenery tile elements. @@ -143,7 +143,7 @@ namespace OpenRCT2::GameActions if (tileElement == nullptr) { LOG_ERROR("No large scenery element to remove at %d, y = %d", _loc.x, _loc.y); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); @@ -151,7 +151,7 @@ namespace OpenRCT2::GameActions if (sceneryEntry == nullptr) { LOG_WARNING("Scenery entry at x = %d, y = %d not removed because it is an unknown object type", _loc.x, _loc.y); - return Result(Status::Unknown, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::unknown, STR_CANT_REMOVE_THIS, kStringIdNone); } tileElement->RemoveBannerEntry(); @@ -171,7 +171,7 @@ namespace OpenRCT2::GameActions { if (!MapIsLocationOwned({ currentTile.x, currentTile.y, currentTile.z })) { - return Result(Status::NoClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::noClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } } diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index 104f0fb86c..b8510b2ac3 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -75,23 +75,23 @@ namespace OpenRCT2::GameActions if (_loc.x < 0 || _loc.y < 0 || _loc.x > mapSizeMax.x || _loc.y > mapSizeMax.y) { LOG_ERROR("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE); } if (_primaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid primary colour %u", _primaryColour); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } else if (_secondaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid secondary colour %u", _secondaryColour); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } else if (_tertiaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } auto largeElement = MapGetLargeScenerySegment(_loc, _tileIndex); @@ -101,7 +101,7 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Could not find large scenery at: x = %d, y = %d, z = %d, direction = %d, tileIndex = %u", _loc.x, _loc.y, _loc.z, _loc.direction, _tileIndex); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if ((GetFlags().has(CommandFlag::ghost)) && !(largeElement->IsGhost())) @@ -114,7 +114,7 @@ namespace OpenRCT2::GameActions if (sceneryEntry == nullptr) { LOG_ERROR("Scenery element doesn't have scenery entry"); - return Result(Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } // Work out the base tile coordinates (Tile with index 0) auto rotatedBaseCoordsOffset = CoordsXYZ{ CoordsXY{ sceneryEntry->tiles[_tileIndex].offset }.Rotate(_loc.direction), @@ -132,13 +132,13 @@ namespace OpenRCT2::GameActions { if (!MapIsLocationOwned(currentTile)) { - return Result(Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } } if (!LocationValid(currentTile)) { - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP); } auto tileElement = MapGetLargeScenerySegment({ currentTile.x, currentTile.y, _loc.z, _loc.direction }, tile.index); @@ -148,7 +148,7 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Large scenery element not found at: x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return Result(Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } if (isExecuting) { diff --git a/src/openrct2/actions/MapChangeSizeAction.cpp b/src/openrct2/actions/MapChangeSizeAction.cpp index 9724933444..227926b02c 100644 --- a/src/openrct2/actions/MapChangeSizeAction.cpp +++ b/src/openrct2/actions/MapChangeSizeAction.cpp @@ -47,11 +47,11 @@ namespace OpenRCT2::GameActions { if (_targetSize.x > kMaximumMapSizeTechnical || _targetSize.y > kMaximumMapSizeTechnical) { - return Result(Status::InvalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE); } if (_targetSize.x < kMinimumMapSizeTechnical || _targetSize.y < kMinimumMapSizeTechnical) { - return Result(Status::InvalidParameters, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE); } return Result(); } diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index 83d7bc22f0..6c51864608 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -55,35 +55,35 @@ namespace OpenRCT2::GameActions res.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; if ((_loc.z & 0xF) != 0) { - res.Error = Status::Unknown; + res.Error = Status::unknown; res.ErrorMessage = STR_INVALID_HEIGHT; return res; } if (!LocationValid(_loc)) { - res.Error = Status::InvalidParameters; + res.Error = Status::invalidParameters; res.ErrorMessage = STR_OFF_EDGE_OF_MAP; return res; } if (!MapIsLocationOwned(_loc) && !gameState.cheats.sandboxMode) { - res.Error = Status::NotOwned; + res.Error = Status::notOwned; res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK; return res; } if (!MapCheckCapacityAndReorganise(_loc)) { - res.Error = Status::NoFreeElements; + res.Error = Status::noFreeElements; res.ErrorMessage = STR_TILE_ELEMENT_LIMIT_REACHED; return res; } auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { - res.Error = Status::Unknown; + res.Error = Status::unknown; res.ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS; return res; } @@ -100,7 +100,7 @@ namespace OpenRCT2::GameActions const auto& rtd = ride->getRideTypeDescriptor(); if (heightDifference > rtd.Heights.MaxHeight) { - res.Error = Status::TooHigh; + res.Error = Status::tooHigh; res.ErrorMessage = STR_TOO_HIGH_FOR_SUPPORTS; return res; } @@ -109,7 +109,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( { _loc.ToTileStart(), baseHeight, clearanceHeight }, MapPlaceNonSceneryClearFunc, { 0b1111, 0 }, GetFlags(), kTileSlopeFlat); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; return canBuild; @@ -118,14 +118,14 @@ namespace OpenRCT2::GameActions const auto clearanceData = canBuild.GetData(); if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) { - res.Error = Status::NoClearance; + res.Error = Status::noClearance; res.ErrorMessage = STR_RIDE_CANT_BUILD_THIS_UNDERWATER; return res; } if (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND) { - res.Error = Status::NoClearance; + res.Error = Status::noClearance; res.ErrorMessage = STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND; return res; } @@ -134,7 +134,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr || ride->type == kRideTypeNull) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex); - res.Error = Status::InvalidParameters; + res.Error = Status::invalidParameters; res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; } @@ -156,7 +156,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex); - res.Error = Status::InvalidParameters; + res.Error = Status::invalidParameters; res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; } @@ -174,7 +174,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( { _loc.ToTileStart(), baseHeight, clearanceHeight }, MapPlaceNonSceneryClearFunc, { 0b1111, 0 }, GetFlags().with(CommandFlag::apply), kTileSlopeFlat); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; return canBuild; diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index 09115c9a04..1b2ac6fbfe 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -89,35 +89,35 @@ namespace OpenRCT2::GameActions res.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; if ((_loc.z & 0xF) != 0 && _mode == GC_SET_MAZE_TRACK_BUILD) { - res.Error = Status::Unknown; + res.Error = Status::unknown; res.ErrorMessage = STR_INVALID_HEIGHT; return res; } if (!LocationValid(_loc)) { - res.Error = Status::InvalidParameters; + res.Error = Status::invalidParameters; res.ErrorMessage = STR_OFF_EDGE_OF_MAP; return res; } if (!MapIsLocationOwned(_loc) && !gameState.cheats.sandboxMode) { - res.Error = Status::NotOwned; + res.Error = Status::notOwned; res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK; return res; } if (!MapCheckCapacityAndReorganise(_loc)) { - res.Error = Status::NoFreeElements; + res.Error = Status::noFreeElements; res.ErrorMessage = STR_TILE_ELEMENT_LIMIT_REACHED; return res; } auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { - res.Error = Status::Unknown; + res.Error = Status::unknown; res.ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS; return res; } @@ -134,7 +134,7 @@ namespace OpenRCT2::GameActions const auto& rtd = ride->getRideTypeDescriptor(); if (heightDifference > rtd.Heights.MaxHeight) { - res.Error = Status::TooHigh; + res.Error = Status::tooHigh; res.ErrorMessage = STR_TOO_HIGH_FOR_SUPPORTS; return res; } @@ -145,12 +145,12 @@ namespace OpenRCT2::GameActions { if (_mode != GC_SET_MAZE_TRACK_BUILD) { - res.Error = Status::Unknown; + res.Error = Status::unknown; res.ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS; return res; } auto constructResult = MapCanConstructAt({ _loc.ToTileStart(), baseHeight, clearanceHeight }, { 0b1111, 0 }); - if (constructResult.Error != Status::Ok) + if (constructResult.Error != Status::ok) { constructResult.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; return constructResult; @@ -159,14 +159,14 @@ namespace OpenRCT2::GameActions const auto clearanceData = constructResult.GetData(); if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) { - res.Error = Status::NoClearance; + res.Error = Status::noClearance; res.ErrorMessage = STR_RIDE_CANT_BUILD_THIS_UNDERWATER; return res; } if (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND) { - res.Error = Status::NoClearance; + res.Error = Status::noClearance; res.ErrorMessage = STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND; return res; } @@ -175,7 +175,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr || !RideTypeIsValid(ride->type)) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex); - res.Error = Status::NoClearance; + res.Error = Status::noClearance; res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; } @@ -200,7 +200,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex); - res.Error = Status::InvalidParameters; + res.Error = Status::invalidParameters; res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; } @@ -294,7 +294,7 @@ namespace OpenRCT2::GameActions if (tileElement == nullptr) { LOG_ERROR("No surface found"); - res.Error = Status::Unknown; + res.Error = Status::unknown; res.ErrorMessage = STR_ERR_SURFACE_ELEMENT_NOT_FOUND; return res; } diff --git a/src/openrct2/actions/ParkEntrancePlaceAction.cpp b/src/openrct2/actions/ParkEntrancePlaceAction.cpp index c944a04186..b937c80130 100644 --- a/src/openrct2/actions/ParkEntrancePlaceAction.cpp +++ b/src/openrct2/actions/ParkEntrancePlaceAction.cpp @@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions { if (!isInEditorMode() && !getGameState().cheats.sandboxMode) { - return Result(Status::NotInEditorMode, STR_CANT_BUILD_THIS_HERE, kStringIdNone); + return Result(Status::notInEditorMode, STR_CANT_BUILD_THIS_HERE, kStringIdNone); } auto res = Result(); @@ -72,17 +72,17 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc) || _loc.x <= kCoordsXYStep || _loc.y <= kCoordsXYStep || _loc.x >= mapSizeUnits.x || _loc.y >= mapSizeUnits.y) { - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_CLOSE_TO_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_CLOSE_TO_EDGE_OF_MAP); } if (!CheckMapCapacity(3)) { - return Result(Status::NoFreeElements, STR_CANT_BUILD_THIS_HERE, STR_ERR_LANDSCAPE_DATA_AREA_FULL); + return Result(Status::noFreeElements, STR_CANT_BUILD_THIS_HERE, STR_ERR_LANDSCAPE_DATA_AREA_FULL); } if (gameState.park.entrances.size() >= OpenRCT2::Limits::kMaxParkEntrances) { - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_TOO_MANY_PARK_ENTRANCES); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_TOO_MANY_PARK_ENTRANCES); } auto zLow = _loc.z; @@ -100,7 +100,7 @@ namespace OpenRCT2::GameActions entranceLoc.y += CoordsDirectionDelta[(_loc.direction + 1) & 0x3].y * 2; } - if (auto res2 = MapCanConstructAt({ entranceLoc, zLow, zHigh }, { 0b1111, 0 }); res2.Error != Status::Ok) + if (auto res2 = MapCanConstructAt({ entranceLoc, zLow, zHigh }, { 0b1111, 0 }); res2.Error != Status::ok) { res2.ErrorTitle = STR_CANT_BUILD_THIS_HERE; return res2; @@ -110,7 +110,7 @@ namespace OpenRCT2::GameActions EntranceElement* entranceElement = MapGetParkEntranceElementAt(entranceLoc, false); if (entranceElement != nullptr) { - return Result(Status::ItemAlreadyPlaced, STR_CANT_BUILD_THIS_HERE, kStringIdNone); + return Result(Status::itemAlreadyPlaced, STR_CANT_BUILD_THIS_HERE, kStringIdNone); } } diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.cpp b/src/openrct2/actions/ParkEntranceRemoveAction.cpp index e3b76272fd..7adf482f49 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.cpp +++ b/src/openrct2/actions/ParkEntranceRemoveAction.cpp @@ -46,7 +46,7 @@ namespace OpenRCT2::GameActions { if (!isInEditorMode() && !getGameState().cheats.sandboxMode) { - return Result(Status::NotInEditorMode, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::notInEditorMode, STR_CANT_REMOVE_THIS, kStringIdNone); } auto res = Result(); @@ -56,12 +56,12 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } if (ParkEntranceGetIndex(_loc) == -1) { LOG_ERROR("No park entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } return res; } @@ -77,7 +77,7 @@ namespace OpenRCT2::GameActions if (entranceIndex == -1) { LOG_ERROR("No park entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto& park = getGameState().park; diff --git a/src/openrct2/actions/ParkMarketingAction.cpp b/src/openrct2/actions/ParkMarketingAction.cpp index 44c60c2da6..8229d2ca52 100644 --- a/src/openrct2/actions/ParkMarketingAction.cpp +++ b/src/openrct2/actions/ParkMarketingAction.cpp @@ -52,12 +52,12 @@ namespace OpenRCT2::GameActions { if (static_cast(_type) >= std::size(AdvertisingCampaignPricePerWeek) || _numWeeks >= 256) { - return Result(Status::InvalidParameters, STR_CANT_START_MARKETING_CAMPAIGN, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_START_MARKETING_CAMPAIGN, STR_ERR_VALUE_OUT_OF_RANGE); } if (getGameState().park.flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN) { return Result( - Status::Disallowed, STR_CANT_START_MARKETING_CAMPAIGN, STR_MARKETING_CAMPAIGNS_FORBIDDEN_BY_LOCAL_AUTHORITY); + Status::disallowed, STR_CANT_START_MARKETING_CAMPAIGN, STR_MARKETING_CAMPAIGNS_FORBIDDEN_BY_LOCAL_AUTHORITY); } return CreateResult(); diff --git a/src/openrct2/actions/ParkSetDateAction.cpp b/src/openrct2/actions/ParkSetDateAction.cpp index 583ffde866..8b3c5407ae 100644 --- a/src/openrct2/actions/ParkSetDateAction.cpp +++ b/src/openrct2/actions/ParkSetDateAction.cpp @@ -50,17 +50,17 @@ namespace OpenRCT2::GameActions if (_year < 0 || _year >= kMaxYear) { LOG_ERROR("Invalid park date year %d", _year); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } else if (_month < 0 || _month >= MONTH_COUNT) { LOG_ERROR("Invalid park date month %d", _year); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } else if (_day < 0 || _day >= 31) { LOG_ERROR("Invalid park date day %d", _year); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } return Result(); diff --git a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp index 02f6bd76a5..e95949dfde 100644 --- a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp +++ b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp @@ -46,17 +46,17 @@ namespace OpenRCT2::GameActions if ((getGameState().park.flags & PARK_FLAGS_NO_MONEY) != 0) { LOG_ERROR("Can't set park entrance fee because the park has no money"); - return Result(Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone); + return Result(Status::disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone); } else if (!Park::EntranceFeeUnlocked()) { LOG_ERROR("Park entrance fee is locked"); - return Result(Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone); + return Result(Status::disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone); } else if (_fee < 0.00_GBP || _fee > kMaxEntranceFee) { LOG_ERROR("Invalid park entrance fee %d", _fee); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } return Result(); diff --git a/src/openrct2/actions/ParkSetLoanAction.cpp b/src/openrct2/actions/ParkSetLoanAction.cpp index c32654d84e..f283e6ad19 100644 --- a/src/openrct2/actions/ParkSetLoanAction.cpp +++ b/src/openrct2/actions/ParkSetLoanAction.cpp @@ -45,18 +45,18 @@ namespace OpenRCT2::GameActions auto& park = getGameState().park; if (_value > park.bankLoan && _value > park.maxBankLoan) { - return Result(Status::Disallowed, STR_CANT_BORROW_ANY_MORE_MONEY, STR_BANK_REFUSES_TO_INCREASE_LOAN); + return Result(Status::disallowed, STR_CANT_BORROW_ANY_MORE_MONEY, STR_BANK_REFUSES_TO_INCREASE_LOAN); } if (_value < park.bankLoan && _value < 0.00_GBP) { - return Result(Status::InvalidParameters, STR_CANT_PAY_BACK_LOAN, STR_LOAN_CANT_BE_NEGATIVE); + return Result(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 = park.bankLoan > _value; const auto amountToPayBack = park.bankLoan - _value; if (isPayingBack && amountToPayBack > park.cash) { - return Result(Status::InsufficientFunds, STR_CANT_PAY_BACK_LOAN, STR_NOT_ENOUGH_CASH_AVAILABLE); + return Result(Status::insufficientFunds, STR_CANT_PAY_BACK_LOAN, STR_NOT_ENOUGH_CASH_AVAILABLE); } return Result(); } diff --git a/src/openrct2/actions/ParkSetNameAction.cpp b/src/openrct2/actions/ParkSetNameAction.cpp index ea47f52c85..a6efd25cc8 100644 --- a/src/openrct2/actions/ParkSetNameAction.cpp +++ b/src/openrct2/actions/ParkSetNameAction.cpp @@ -48,7 +48,7 @@ namespace OpenRCT2::GameActions if (_name.empty()) { LOG_ERROR("Can't set park name to empty string"); - return Result(Status::InvalidParameters, STR_CANT_RENAME_PARK, STR_INVALID_NAME_FOR_PARK); + return Result(Status::invalidParameters, STR_CANT_RENAME_PARK, STR_INVALID_NAME_FOR_PARK); } return Result(); } diff --git a/src/openrct2/actions/ParkSetParameterAction.cpp b/src/openrct2/actions/ParkSetParameterAction.cpp index 8a6b5df475..cd772b7d24 100644 --- a/src/openrct2/actions/ParkSetParameterAction.cpp +++ b/src/openrct2/actions/ParkSetParameterAction.cpp @@ -46,7 +46,7 @@ namespace OpenRCT2::GameActions if (_parameter >= ParkParameter::Count) { LOG_ERROR("Invalid park parameter %d", _parameter); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } auto res = Result(); @@ -81,7 +81,7 @@ namespace OpenRCT2::GameActions break; default: LOG_ERROR("Invalid park parameter %d", _parameter); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } auto res = Result(); diff --git a/src/openrct2/actions/ParkSetResearchFundingAction.cpp b/src/openrct2/actions/ParkSetResearchFundingAction.cpp index fd2a3e0442..7de77f035f 100644 --- a/src/openrct2/actions/ParkSetResearchFundingAction.cpp +++ b/src/openrct2/actions/ParkSetResearchFundingAction.cpp @@ -48,7 +48,7 @@ namespace OpenRCT2::GameActions if (_fundingAmount >= RESEARCH_FUNDING_COUNT) { LOG_ERROR("Invalid research funding amount %d", _fundingAmount); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } return Result(); } diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index 10143d25d1..cbeb769fd3 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -51,19 +51,19 @@ namespace OpenRCT2::GameActions if (_entityId.ToUnderlying() >= kMaxEntities || _entityId.IsNull()) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); - return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); + return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } if (!_loc.IsNull() && !LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); + return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } auto* const peep = getGameState().entities.TryGetEntity(_entityId); if (peep == nullptr) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); - return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); + return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } auto res = Result(); @@ -75,7 +75,7 @@ namespace OpenRCT2::GameActions res.Position = peep->GetLocation(); if (!peep->CanBePickedUp()) { - return Result(Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); + return Result(Status::disallowed, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } Peep* existing = Network::GetPickupPeep(_owner); if (existing != nullptr) @@ -100,17 +100,17 @@ namespace OpenRCT2::GameActions res.Position = _loc; if (Network::GetPickupPeep(_owner) != peep) { - return Result(Status::Unknown, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); + return Result(Status::unknown, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } - if (auto res2 = peep->Place(TileCoordsXYZ(_loc), false); res2.Error != Status::Ok) + if (auto res2 = peep->Place(TileCoordsXYZ(_loc), false); res2.Error != Status::ok) { return res2; } break; default: LOG_ERROR("Invalid peep pickup type %u", _type); - return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); + return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } return res; } @@ -121,7 +121,7 @@ namespace OpenRCT2::GameActions if (peep == nullptr) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); - return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); + return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } auto res = Result(); @@ -171,7 +171,7 @@ namespace OpenRCT2::GameActions break; case PeepPickupType::Place: res.Position = _loc; - if (auto res2 = peep->Place(TileCoordsXYZ(_loc), true); res2.Error != Status::Ok) + if (auto res2 = peep->Place(TileCoordsXYZ(_loc), true); res2.Error != Status::ok) { return res2; } @@ -179,7 +179,7 @@ namespace OpenRCT2::GameActions break; default: LOG_ERROR("Invalid peep pickup type %u", _type); - return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); + return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } return res; } diff --git a/src/openrct2/actions/PeepSpawnPlaceAction.cpp b/src/openrct2/actions/PeepSpawnPlaceAction.cpp index 79777bf968..8b7776fb11 100644 --- a/src/openrct2/actions/PeepSpawnPlaceAction.cpp +++ b/src/openrct2/actions/PeepSpawnPlaceAction.cpp @@ -48,7 +48,7 @@ namespace OpenRCT2::GameActions { if (!isInEditorMode() && !getGameState().cheats.sandboxMode) { - return Result(Status::NotInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, kStringIdNone); + return Result(Status::notInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, kStringIdNone); } auto res = Result(); @@ -59,26 +59,26 @@ namespace OpenRCT2::GameActions if (!LocationValid(_location) || _location.x <= 16 || _location.y <= 16 || _location.x >= mapSizeUnits.x || _location.y >= mapSizeUnits.y) { - return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_OFF_EDGE_OF_MAP); } // Verify footpath exists at location, and retrieve coordinates auto pathElement = MapGetPathElementAt(TileCoordsXYZ{ _location }); if (pathElement == nullptr) { - return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_CAN_ONLY_BE_BUILT_ON_PATHS); + return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_CAN_ONLY_BE_BUILT_ON_PATHS); } // Verify location is unowned auto surfaceMapElement = MapGetSurfaceElementAt(_location); if (surfaceMapElement == nullptr) { - return Result(Status::Unknown, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::unknown, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } if (surfaceMapElement->GetOwnership() != OWNERSHIP_UNOWNED) { return Result( - Status::InvalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_ERR_MUST_BE_OUTSIDE_PARK_BOUNDARIES); + Status::invalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_ERR_MUST_BE_OUTSIDE_PARK_BOUNDARIES); } return res; diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 0d2d20fad1..df1bd1724d 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -79,40 +79,40 @@ namespace OpenRCT2::GameActions if (rideIndex.IsNull()) { // No more free slots available. - return Result(Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_TOO_MANY_RIDES); + return Result(Status::noFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_TOO_MANY_RIDES); } if (_rideType >= RIDE_TYPE_COUNT) { LOG_ERROR("Invalid ride type %d", _rideType); - return Result(Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE); + return Result(Status::invalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE); } int32_t rideEntryIndex = RideGetEntryIndex(_rideType, _subType); if (rideEntryIndex >= kMaxRideObjects) { LOG_ERROR("Ride entry not found for rideType %d, subType %d", _rideType, _subType); - return Result(Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE); + return Result(Status::invalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE); } const auto& colourPresets = GetRideTypeDescriptor(_rideType).ColourPresets; if (_trackColourPreset >= colourPresets.count) { LOG_ERROR("Can't create ride, invalid colour preset %d", _trackColourPreset); - return Result(Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_ERR_INVALID_COLOUR); } const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex); if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for rideEntryIndex %d", rideEntryIndex); - return Result(Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE); } const auto* presetList = rideEntry->vehicle_preset_list; if ((presetList->count > 0 && presetList->count != 255) && _vehicleColourPreset >= presetList->count) { - return Result(Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); } auto res = Result(); @@ -135,7 +135,7 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Ride entry not found for index rideEntryIndex %u (from rideType %u, subType %u)", rideEntryIndex, _rideType, _subType); - return Result(Status::Unknown, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::unknown, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE); } ride->type = _rideType; diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 7098123fa0..ebf25eeeab 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND); } if ((ride->lifecycleFlags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) @@ -69,7 +69,7 @@ namespace OpenRCT2::GameActions && !getGameState().cheats.makeAllDestructible) { return Result( - Status::NoClearance, STR_CANT_DEMOLISH_RIDE, + Status::noClearance, STR_CANT_DEMOLISH_RIDE, STR_LOCAL_AUTHORITY_FORBIDS_DEMOLITION_OR_MODIFICATIONS_TO_THIS_RIDE); } @@ -79,18 +79,18 @@ namespace OpenRCT2::GameActions { if (ride->status != RideStatus::closed && ride->status != RideStatus::simulating) { - return Result(Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_MUST_BE_CLOSED_FIRST); + return Result(Status::disallowed, STR_CANT_REFURBISH_RIDE, STR_MUST_BE_CLOSED_FIRST); } if (ride->numRiders > 0) { - return Result(Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_RIDE_NOT_YET_EMPTY); + return Result(Status::disallowed, STR_CANT_REFURBISH_RIDE, STR_RIDE_NOT_YET_EMPTY); } if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) || ride->getRideTypeDescriptor().AvailableBreakdowns == 0) { - return Result(Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_CANT_REFURBISH_NOT_NEEDED); + return Result(Status::disallowed, STR_CANT_REFURBISH_RIDE, STR_CANT_REFURBISH_NOT_NEEDED); } result.ErrorTitle = STR_CANT_REFURBISH_RIDE; @@ -106,7 +106,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND); } switch (_modifyType) @@ -117,7 +117,7 @@ namespace OpenRCT2::GameActions return RefurbishRide(gameState, *ride); default: LOG_ERROR("Unknown ride demolish type %d", _modifyType); - return Result(Status::InvalidParameters, STR_CANT_DO_THIS, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_DO_THIS, STR_ERR_VALUE_OUT_OF_RANGE); } } @@ -183,7 +183,7 @@ namespace OpenRCT2::GameActions setMazeTrack.SetFlags(GetFlags()); auto execRes = ExecuteNested(&setMazeTrack, gameState); - if (execRes.Error == Status::Ok) + if (execRes.Error == Status::ok) { return execRes.Cost; } @@ -230,7 +230,7 @@ namespace OpenRCT2::GameActions trackRemoveAction.SetFlags({ CommandFlag::noSpend }); auto removRes = ExecuteNested(&trackRemoveAction, gameState); - if (removRes.Error != Status::Ok) + if (removRes.Error != Status::ok) { TileElementRemove(tileElement); } diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index b1a8bee610..4c8690b076 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -64,23 +64,23 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND); } if (_stationNum.ToUnderlying() >= Limits::kMaxStationsPerRide) { LOG_ERROR("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying()); - return Result(Status::InvalidParameters, errorTitle, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, errorTitle, STR_ERR_VALUE_OUT_OF_RANGE); } if (ride->status != RideStatus::closed && ride->status != RideStatus::simulating) { - return Result(Status::NotClosed, errorTitle, STR_MUST_BE_CLOSED_FIRST); + return Result(Status::notClosed, errorTitle, STR_MUST_BE_CLOSED_FIRST); } if (ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) { - return Result(Status::Disallowed, errorTitle, STR_NOT_ALLOWED_TO_MODIFY_STATION); + return Result(Status::disallowed, errorTitle, STR_NOT_ALLOWED_TO_MODIFY_STATION); } const auto& station = ride->getStation(_stationNum); @@ -93,7 +93,7 @@ namespace OpenRCT2::GameActions rideEntranceExitRemove.SetFlags(GetFlags()); auto result = QueryNested(&rideEntranceExitRemove, gameState); - if (result.Error != Status::Ok) + if (result.Error != Status::ok) { result.ErrorTitle = errorTitle; return result; @@ -103,21 +103,21 @@ namespace OpenRCT2::GameActions auto z = ride->getStation(_stationNum).GetBaseZ(); if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP); } if (!getGameState().cheats.sandboxMode && !MapIsLocationOwned({ _loc, z })) { - return Result(Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); } if (!MapCheckCapacityAndReorganise(_loc)) { - return Result(Status::NoFreeElements, errorTitle, STR_TILE_ELEMENT_LIMIT_REACHED); + return Result(Status::noFreeElements, errorTitle, STR_TILE_ELEMENT_LIMIT_REACHED); } auto clear_z = z + (_isExit ? RideExitHeight : RideEntranceHeight); auto canBuild = MapCanConstructWithClearAt( { _loc, z, clear_z }, MapPlaceNonSceneryClearFunc, { 0b1111, 0 }, GetFlags(), kTileSlopeFlat); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { canBuild.ErrorTitle = errorTitle; return canBuild; @@ -126,12 +126,12 @@ namespace OpenRCT2::GameActions const auto clearanceData = canBuild.GetData(); if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) { - return Result(Status::Disallowed, errorTitle, STR_RIDE_CANT_BUILD_THIS_UNDERWATER); + return Result(Status::disallowed, errorTitle, STR_RIDE_CANT_BUILD_THIS_UNDERWATER); } if (z > MaxRideEntranceOrExitHeight) { - return Result(Status::Disallowed, errorTitle, STR_TOO_HIGH); + return Result(Status::disallowed, errorTitle, STR_TOO_HIGH); } auto res = Result(); @@ -151,7 +151,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND); } if (!(GetFlags().has(CommandFlag::ghost))) @@ -169,7 +169,7 @@ namespace OpenRCT2::GameActions rideEntranceExitRemove.SetFlags(GetFlags()); auto result = ExecuteNested(&rideEntranceExitRemove, gameState); - if (result.Error != Status::Ok) + if (result.Error != Status::ok) { result.ErrorTitle = errorTitle; return result; @@ -188,7 +188,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( { _loc, z, clear_z }, MapPlaceNonSceneryClearFunc, { 0b1111, 0 }, GetFlags().with(CommandFlag::apply), kTileSlopeFlat); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { canBuild.ErrorTitle = errorTitle; return canBuild; @@ -244,18 +244,18 @@ namespace OpenRCT2::GameActions if (!getGameState().cheats.sandboxMode && !MapIsLocationOwned(loc)) { - return Result(Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); } if (!MapCheckCapacityAndReorganise(loc)) { - return Result(Status::NoFreeElements, errorTitle, STR_TILE_ELEMENT_LIMIT_REACHED); + return Result(Status::noFreeElements, errorTitle, STR_TILE_ELEMENT_LIMIT_REACHED); } int16_t baseZ = loc.z; int16_t clearZ = baseZ + (isExit ? RideExitHeight : RideEntranceHeight); auto canBuild = MapCanConstructWithClearAt( { loc, baseZ, clearZ }, MapPlaceNonSceneryClearFunc, { 0b1111, 0 }, {}, kTileSlopeFlat); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { canBuild.ErrorTitle = errorTitle; return canBuild; @@ -264,12 +264,12 @@ namespace OpenRCT2::GameActions const auto clearanceData = canBuild.GetData(); if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) { - return Result(Status::Disallowed, errorTitle, STR_RIDE_CANT_BUILD_THIS_UNDERWATER); + return Result(Status::disallowed, errorTitle, STR_RIDE_CANT_BUILD_THIS_UNDERWATER); } if (baseZ > MaxRideEntranceOrExitHeight) { - return Result(Status::Disallowed, errorTitle, STR_TOO_HIGH); + return Result(Status::disallowed, errorTitle, STR_TOO_HIGH); } auto res = Result(); res.Position = { loc.ToTileCentre(), TileElementHeight(loc) }; diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index c8c3f25386..e9853ba57e 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -73,22 +73,22 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } if (ride->status != RideStatus::closed && ride->status != RideStatus::simulating) { - return Result(Status::InvalidParameters, STR_MUST_BE_CLOSED_FIRST, kStringIdNone); + return Result(Status::invalidParameters, STR_MUST_BE_CLOSED_FIRST, kStringIdNone); } if (ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) { - return Result(Status::InvalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION, kStringIdNone); + return Result(Status::invalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION, kStringIdNone); } if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } auto* entranceElement = FindEntranceElement( @@ -97,14 +97,14 @@ namespace OpenRCT2::GameActions // If we are trying to remove a ghost and the element we found is real, return an error, but don't log a warning if (entranceElement != nullptr && (GetFlags().has(CommandFlag::ghost)) && !(entranceElement->IsGhost())) { - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_GHOST_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_GHOST_ELEMENT_NOT_FOUND); } else if (entranceElement == nullptr) { LOG_ERROR( "Entrance/exit element not found. x = %d, y = %d, ride = %u, station = %u", _loc.x, _loc.y, _rideIndex.ToUnderlying(), _stationNum.ToUnderlying()); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND); } return Result(); @@ -116,7 +116,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } const bool isGhost = GetFlags().has(CommandFlag::ghost); @@ -133,14 +133,14 @@ namespace OpenRCT2::GameActions // If we are trying to remove a ghost and the element we found is real, return an error, but don't log a warning if (entranceElement != nullptr && isGhost && !(entranceElement->IsGhost())) { - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_GHOST_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_GHOST_ELEMENT_NOT_FOUND); } else if (entranceElement == nullptr) { LOG_ERROR( "Entrance/exit element not found. x = %d, y = %d, ride = %u, station = %d", _loc.x, _loc.y, _rideIndex.ToUnderlying(), _stationNum); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND); } auto res = Result(); diff --git a/src/openrct2/actions/RideFreezeRatingAction.cpp b/src/openrct2/actions/RideFreezeRatingAction.cpp index 9d4d9ed9e4..b35bbf4bc8 100644 --- a/src/openrct2/actions/RideFreezeRatingAction.cpp +++ b/src/openrct2/actions/RideFreezeRatingAction.cpp @@ -40,13 +40,13 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } if (_value <= 0) { LOG_ERROR("Rating value must be positive: %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } return Result(); diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index 370d252185..f97a674810 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -57,7 +57,7 @@ namespace OpenRCT2::GameActions { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } switch (_type) @@ -69,7 +69,7 @@ namespace OpenRCT2::GameActions { LOG_ERROR("Invalid track colour %u", _index); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR); } break; case RideSetAppearanceType::VehicleColourBody: @@ -79,7 +79,7 @@ namespace OpenRCT2::GameActions { LOG_ERROR("Invalid vehicle colour %u", _index); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR); } break; case RideSetAppearanceType::VehicleColourScheme: @@ -89,7 +89,7 @@ namespace OpenRCT2::GameActions default: LOG_ERROR("Invalid ride appearance type %u", _type); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } return GameActions::Result(); @@ -102,7 +102,7 @@ namespace OpenRCT2::GameActions { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } switch (_type) diff --git a/src/openrct2/actions/RideSetColourSchemeAction.cpp b/src/openrct2/actions/RideSetColourSchemeAction.cpp index 01b1bcd7c8..dafa5f16cb 100644 --- a/src/openrct2/actions/RideSetColourSchemeAction.cpp +++ b/src/openrct2/actions/RideSetColourSchemeAction.cpp @@ -51,7 +51,7 @@ namespace OpenRCT2::GameActions { if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_OFF_EDGE_OF_MAP); } // Find the relevant track piece, prefer sequence 0 (logic copied from GetTrackElementOriginAndApplyChanges) auto trackElement = MapGetTrackElementAtOfTypeSeq(_loc, _trackType, 0); @@ -60,12 +60,12 @@ namespace OpenRCT2::GameActions trackElement = MapGetTrackElementAtOfType(_loc, _trackType); if (trackElement == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_TRACK_PARAMETERS); + return Result(Status::invalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_TRACK_PARAMETERS); } } if (_newColourScheme >= kNumRideColourSchemes) { - return Result(Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_COLOUR_SCHEME_PARAMETER); + return Result(Status::invalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_COLOUR_SCHEME_PARAMETER); } return Result(); } diff --git a/src/openrct2/actions/RideSetNameAction.cpp b/src/openrct2/actions/RideSetNameAction.cpp index 37b728114d..e2f60196c9 100644 --- a/src/openrct2/actions/RideSetNameAction.cpp +++ b/src/openrct2/actions/RideSetNameAction.cpp @@ -52,12 +52,12 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND); } if (!_name.empty() && Ride::nameExists(_name, ride->id)) { - return Result(Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERROR_EXISTING_NAME); + return Result(Status::invalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERROR_EXISTING_NAME); } return Result(); @@ -69,7 +69,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND); } if (_name.empty()) diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index 8889a2d433..647df77a02 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -56,20 +56,20 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for ride subtype %u", ride->subtype); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND); } if (_price < kRideMinPrice || _price > kRideMaxPrice) { LOG_ERROR("Attempting to set an invalid price for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty); } return Result(); @@ -84,20 +84,20 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for ride subtype %u", ride->subtype); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND); } if (_price < kRideMinPrice || _price > kRideMaxPrice) { LOG_ERROR("Attempting to set an invalid price for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty); } if (!ride->overallView.IsNull()) diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 52b04dbe29..bf3c64b7c2 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -52,7 +52,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u.", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND); } switch (_setting) @@ -60,18 +60,18 @@ namespace OpenRCT2::GameActions case RideSetSetting::Mode: if (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { - return Result(Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING); + return Result(Status::disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING); } if (ride->status != RideStatus::closed && ride->status != RideStatus::simulating) { - return Result(Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_MUST_BE_CLOSED_FIRST); + return Result(Status::disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_MUST_BE_CLOSED_FIRST); } if (!RideIsModeValid(*ride) && !getGameState().cheats.showAllOperatingModes) { LOG_ERROR("Invalid ride mode: %u", _value); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::Departure: @@ -80,28 +80,28 @@ namespace OpenRCT2::GameActions if (_value > 250) { LOG_ERROR("Invalid minimum waiting time: %u", _value); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::MaxWaitingTime: if (_value > 250) { LOG_ERROR("Invalid maximum waiting time: %u", _value); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::Operation: if (!RideIsValidOperationOption(*ride)) { LOG_ERROR("Invalid operation option value: %u", _value); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, GetOperationErrorMessage(*ride)); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, GetOperationErrorMessage(*ride)); } break; case RideSetSetting::InspectionInterval: if (_value > RIDE_INSPECTION_NEVER) { LOG_ERROR("Invalid inspection interval: %u", _value); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::Music: @@ -113,7 +113,7 @@ namespace OpenRCT2::GameActions if (musicObj == nullptr) { LOG_ERROR("Invalid music style: %u", _value); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; } @@ -121,33 +121,33 @@ namespace OpenRCT2::GameActions if (!RideIsValidLiftHillSpeed(*ride)) { LOG_ERROR("Invalid lift hill speed: %u", _value); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::NumCircuits: if (ride->lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT && _value > 1) { return Result( - Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, + Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_MULTICIRCUIT_NOT_POSSIBLE_WITH_CABLE_LIFT_HILL); } if (!RideIsValidNumCircuits()) { LOG_ERROR("Invalid number of circuits: %u", _value); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::RideType: if (!getGameState().cheats.allowArbitraryRideTypeChanges) { LOG_ERROR("Arbitrary ride type changes not allowed."); - return Result(Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, kStringIdNone); + return Result(Status::disallowed, STR_CANT_CHANGE_OPERATING_MODE, kStringIdNone); } break; default: LOG_ERROR("Invalid ride setting %u", static_cast(_setting)); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } return Result(); @@ -159,7 +159,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND); } switch (_setting) diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 0826a1ff5d..cf9f69e2e9 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - res.Error = Status::InvalidParameters; + res.Error = Status::invalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; @@ -70,7 +70,7 @@ namespace OpenRCT2::GameActions if (_status >= RideStatus::count) { LOG_ERROR("Invalid ride status %u for ride %u", EnumValue(_status), _rideIndex.ToUnderlying()); - res.Error = Status::InvalidParameters; + res.Error = Status::invalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; res.ErrorMessage = kStringIdNone; return res; @@ -85,7 +85,7 @@ namespace OpenRCT2::GameActions if (_status == RideStatus::simulating && (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)) { // Simulating will force clear the track, so make sure player can't cheat around a break down - res.Error = Status::Disallowed; + res.Error = Status::disallowed; res.ErrorMessage = STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING; return res; } @@ -108,7 +108,7 @@ namespace OpenRCT2::GameActions if (!modeSwitchResult.Successful) { - res.Error = Status::Unknown; + res.Error = Status::unknown; res.ErrorMessage = modeSwitchResult.Message; return res; } @@ -125,7 +125,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - res.Error = Status::InvalidParameters; + res.Error = Status::invalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; @@ -172,7 +172,7 @@ namespace OpenRCT2::GameActions const auto modeSwitchResult = ride->simulate(true); if (!modeSwitchResult.Successful) { - res.Error = Status::Unknown; + res.Error = Status::unknown; res.ErrorMessage = modeSwitchResult.Message; return res; } @@ -215,7 +215,7 @@ namespace OpenRCT2::GameActions const auto modeSwitchResult = ride->test(true); if (!modeSwitchResult.Successful) { - res.Error = Status::Unknown; + res.Error = Status::unknown; res.ErrorMessage = modeSwitchResult.Message; return res; } @@ -225,7 +225,7 @@ namespace OpenRCT2::GameActions const auto modeSwitchResult = ride->open(true); if (!modeSwitchResult.Successful) { - res.Error = Status::Unknown; + res.Error = Status::unknown; res.ErrorMessage = modeSwitchResult.Message; return res; } diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index eca7b7c0cb..eddc2037fa 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -73,17 +73,17 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND); } if (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN) { - return Result(Status::Broken, errTitle, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING); + return Result(Status::broken, errTitle, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING); } if (ride->status != RideStatus::closed && ride->status != RideStatus::simulating) { - return Result(Status::NotClosed, errTitle, STR_MUST_BE_CLOSED_FIRST); + return Result(Status::notClosed, errTitle, STR_MUST_BE_CLOSED_FIRST); } switch (_type) @@ -97,13 +97,13 @@ namespace OpenRCT2::GameActions if (!RideIsVehicleTypeValid(*ride)) { LOG_ERROR("Invalid vehicle type %d", _value); - return Result(Status::InvalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE); } auto rideEntry = GetRideEntryByIndex(_value); if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for _value %d", _value); - return Result(Status::InvalidParameters, errTitle, kStringIdNone); + return Result(Status::invalidParameters, errTitle, kStringIdNone); } // Validate preset @@ -111,14 +111,14 @@ namespace OpenRCT2::GameActions if (_colour >= presetList->count && _colour != 255 && _colour != 0) { LOG_ERROR("Unknown vehicle colour preset. colour = %d", _colour); - return Result(Status::InvalidParameters, errTitle, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, errTitle, STR_ERR_INVALID_COLOUR); } break; } default: LOG_ERROR("Invalid ride vehicle setting %d", _type); - return Result(Status::InvalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE); } return Result(); @@ -131,7 +131,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND); } switch (_type) @@ -154,7 +154,7 @@ namespace OpenRCT2::GameActions if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for index %d", ride->subtype); - return Result(Status::InvalidParameters, errTitle, kStringIdNone); + return Result(Status::invalidParameters, errTitle, kStringIdNone); } uint8_t clampValue = _value; static_assert(sizeof(clampValue) == sizeof(ride->proposedNumCarsPerTrain)); @@ -177,7 +177,7 @@ namespace OpenRCT2::GameActions if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for index %d", ride->subtype); - return Result(Status::InvalidParameters, errTitle, kStringIdNone); + return Result(Status::invalidParameters, errTitle, kStringIdNone); } RideSetVehicleColoursToRandomPreset(*ride, _colour); @@ -200,7 +200,7 @@ namespace OpenRCT2::GameActions default: LOG_ERROR("Invalid ride vehicle setting %d", _type); - return Result(Status::InvalidParameters, errTitle, kStringIdNone); + return Result(Status::invalidParameters, errTitle, kStringIdNone); } ride->numCircuits = 1; diff --git a/src/openrct2/actions/ScenarioSetSettingAction.cpp b/src/openrct2/actions/ScenarioSetSettingAction.cpp index ce56096c33..da91ec5284 100644 --- a/src/openrct2/actions/ScenarioSetSettingAction.cpp +++ b/src/openrct2/actions/ScenarioSetSettingAction.cpp @@ -38,7 +38,7 @@ namespace OpenRCT2::GameActions if (_setting >= ScenarioSetSetting::Count) { LOG_ERROR("Invalid scenario setting: %u", _setting); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } return Result(); @@ -263,7 +263,7 @@ namespace OpenRCT2::GameActions } default: LOG_ERROR("Invalid scenario setting %u", _setting); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } windowMgr->InvalidateByClass(WindowClass::editorScenarioOptions); return Result(); diff --git a/src/openrct2/actions/ScenerySetRestrictedAction.cpp b/src/openrct2/actions/ScenerySetRestrictedAction.cpp index f2d2fc2d30..b47df1b221 100644 --- a/src/openrct2/actions/ScenerySetRestrictedAction.cpp +++ b/src/openrct2/actions/ScenerySetRestrictedAction.cpp @@ -38,12 +38,12 @@ namespace OpenRCT2::GameActions { if (!ObjectTypeCanBeRestricted(_objectType)) { - return Result(Status::InvalidParameters, STR_CANT_RESTRICT_OBJECT, STR_OBJECT_TYPE_CANNOT_BE_RESTRICTED); + return Result(Status::invalidParameters, STR_CANT_RESTRICT_OBJECT, STR_OBJECT_TYPE_CANNOT_BE_RESTRICTED); } const auto* loadedObject = ObjectEntryGetObject(_objectType, _objectIndex); if (loadedObject == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_RESTRICT_OBJECT, STR_OBJECT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_RESTRICT_OBJECT, STR_OBJECT_NOT_FOUND); } return Result(); diff --git a/src/openrct2/actions/SignSetNameAction.cpp b/src/openrct2/actions/SignSetNameAction.cpp index 247bcbe35a..8c0aaa68bd 100644 --- a/src/openrct2/actions/SignSetNameAction.cpp +++ b/src/openrct2/actions/SignSetNameAction.cpp @@ -50,7 +50,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone); } TileElement* tileElement = BannerGetTileElement(_bannerIndex); @@ -58,18 +58,18 @@ namespace OpenRCT2::GameActions if (tileElement == nullptr) { LOG_ERROR("Banner tile element not found for bannerIndex %d", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } CoordsXYZ loc = { banner->position.ToCoordsXY(), tileElement->GetBaseZ() }; if (!LocationValid(loc)) { - return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP); } if (!MapCanBuildAt({ loc.x, loc.y, loc.z - 16 })) { - return Result(Status::NotOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK); } return Result(); @@ -81,7 +81,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone); } if (!_name.empty()) diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 088f25b2a5..d30dd7ee02 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %u", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } CoordsXYZ loc; @@ -67,14 +67,14 @@ namespace OpenRCT2::GameActions if (tileElement == nullptr) { LOG_ERROR("Banner tile element not found for bannerIndex %u", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if (tileElement->GetType() != TileElementType::LargeScenery) { LOG_ERROR( "Tile element has type %u, expected %d (LargeScenery)", tileElement->GetType(), TileElementType::LargeScenery); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } loc = { banner->position.ToCoordsXY(), tileElement->GetBaseZ() }; } @@ -85,18 +85,18 @@ namespace OpenRCT2::GameActions if (wallElement == nullptr) { LOG_ERROR("Wall element not found for bannerIndex", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } loc = { banner->position.ToCoordsXY(), wallElement->GetBaseZ() }; } if (!LocationValid(loc)) { - return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP); } if (!MapCanBuildAt({ loc.x, loc.y, loc.z - 16 })) { - return Result(Status::NotOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK); } return Result(); @@ -108,7 +108,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("Invalid banner id %u", _bannerIndex); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } CoordsXY coords = banner->position.ToCoordsXY(); @@ -120,7 +120,7 @@ namespace OpenRCT2::GameActions { coords, tileElement->GetBaseZ(), tileElement->GetDirection() }, tileElement->AsLargeScenery()->GetSequenceIndex(), _mainColour, _textColour)) { - return Result(Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } } else diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 38c79b8803..2f6cb789ca 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -108,25 +108,25 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); } if (!MapCheckCapacityAndReorganise(_loc)) { - return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } auto maxSizeMax = GetMapSizeMaxXY(); if (!_trackDesignDrawingPreview && (_loc.x > maxSizeMax.x || _loc.y > maxSizeMax.y)) { - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE); } auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { LOG_ERROR("Small scenery object entry not found for sceneryType %u", _sceneryType); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } auto quadrant = _quadrant; @@ -173,7 +173,7 @@ namespace OpenRCT2::GameActions if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode && !MapIsLocationOwned({ _loc.x, _loc.y, targetHeight })) { - return Result(Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } auto* surfaceElement = MapGetSurfaceElementAt(_loc); @@ -183,7 +183,7 @@ namespace OpenRCT2::GameActions int32_t water_height = surfaceElement->GetWaterHeight() - 1; if (water_height > targetHeight) { - return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); + return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } } @@ -191,14 +191,14 @@ namespace OpenRCT2::GameActions { if (isOnWater) { - return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND); + return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND); } if (surfaceElement != nullptr && surfaceElement->GetWaterHeight() > 0) { if (surfaceElement->GetWaterHeight() > targetHeight) { - return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND); + return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND); } } } @@ -206,7 +206,7 @@ namespace OpenRCT2::GameActions if (!gameState.cheats.disableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_REQUIRE_FLAT_SURFACE)) && !supportsRequired && !isOnWater && surfaceElement != nullptr && (surfaceElement->GetSlope() != kTileSlopeFlat)) { - return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED); + return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED); } if (!gameState.cheats.disableSupportLimits && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)) @@ -218,13 +218,13 @@ namespace OpenRCT2::GameActions { if (surfaceElement->GetWaterHeight() > 0 || (surfaceElement->GetBaseZ()) != targetHeight) { - return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED); + return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED); } } } else { - return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND); + return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND); } } @@ -269,7 +269,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, MapPlaceSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, CreateCrossingMode::none, isTree); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_CANT_POSITION_THIS_HERE; return canBuild; @@ -316,7 +316,7 @@ namespace OpenRCT2::GameActions if (sceneryEntry == nullptr) { LOG_ERROR("Small scenery object entry not found for sceneryType %u", _sceneryType); - return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } auto quadrant = _quadrant; @@ -408,7 +408,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, MapPlaceSceneryClearFunc, quarterTile, GetFlags().with(CommandFlag::apply), kTileSlopeFlat, CreateCrossingMode::none, isTree); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_CANT_POSITION_THIS_HERE; return canBuild; @@ -421,7 +421,7 @@ namespace OpenRCT2::GameActions CoordsXYZ{ _loc, zLow }, quarterTile.GetBaseQuarterOccupied()); if (sceneryElement == nullptr) { - return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } sceneryElement->SetDirection(_loc.direction); diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.cpp b/src/openrct2/actions/SmallSceneryRemoveAction.cpp index 7b997141b9..59c64f4f0e 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.cpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.cpp @@ -61,13 +61,13 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } auto* entry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryType); if (entry == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } res.Cost = entry->removal_price; @@ -82,7 +82,7 @@ namespace OpenRCT2::GameActions { if (entry->HasFlag(SMALL_SCENERY_FLAG_IS_TREE)) { - res.Error = Status::NoClearance; + res.Error = Status::noClearance; res.ErrorTitle = STR_CANT_REMOVE_THIS; res.ErrorMessage = STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY; return res; @@ -92,7 +92,7 @@ namespace OpenRCT2::GameActions // Check if the land is owned if (!MapIsLocationOwned(_loc)) { - res.Error = Status::NoClearance; + res.Error = Status::noClearance; res.ErrorTitle = STR_CANT_REMOVE_THIS; res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK; return res; @@ -102,7 +102,7 @@ namespace OpenRCT2::GameActions TileElement* tileElement = FindSceneryElement(); if (tileElement == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } return res; @@ -116,7 +116,7 @@ namespace OpenRCT2::GameActions if (entry == nullptr) { LOG_ERROR("Invalid small scenery type %u", _sceneryType); - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } res.Cost = entry->removal_price; @@ -126,7 +126,7 @@ namespace OpenRCT2::GameActions TileElement* tileElement = FindSceneryElement(); if (tileElement == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } MapInvalidateTileFull(_loc); diff --git a/src/openrct2/actions/SmallScenerySetColourAction.cpp b/src/openrct2/actions/SmallScenerySetColourAction.cpp index fbd068bb52..0cc041df5a 100644 --- a/src/openrct2/actions/SmallScenerySetColourAction.cpp +++ b/src/openrct2/actions/SmallScenerySetColourAction.cpp @@ -80,14 +80,14 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP); } if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode) { if (!MapIsLocationOwned(_loc)) { - return Result(Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } } @@ -96,7 +96,7 @@ namespace OpenRCT2::GameActions if (sceneryElement == nullptr) { LOG_ERROR("Small scenery not found at: x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if ((GetFlags().has(CommandFlag::ghost)) && !(sceneryElement->IsGhost())) diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index 5404ead001..0a762b19d4 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -43,23 +43,23 @@ namespace OpenRCT2::GameActions if (_spriteId.ToUnderlying() >= kMaxEntities || _spriteId.IsNull()) { LOG_ERROR("Invalid spriteId %u", _spriteId); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } auto staff = getGameState().entities.TryGetEntity(_spriteId); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteId %u", _spriteId); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } if (staff->State == PeepState::fixing) { - return Result(Status::Disallowed, STR_CANT_FIRE_STAFF_FIXING, kStringIdNone); + return Result(Status::disallowed, STR_CANT_FIRE_STAFF_FIXING, kStringIdNone); } else if (staff->State == PeepState::inspecting) { - return Result(Status::Disallowed, STR_CANT_FIRE_STAFF_INSPECTING, kStringIdNone); + return Result(Status::disallowed, STR_CANT_FIRE_STAFF_INSPECTING, kStringIdNone); } return Result(); @@ -71,7 +71,7 @@ namespace OpenRCT2::GameActions if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteId %u", _spriteId); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } auto* windowMgr = Ui::GetWindowManager(); diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index e426427e00..b1441797c4 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -80,12 +80,12 @@ namespace OpenRCT2::GameActions if (_staffType >= static_cast(StaffType::count)) { LOG_ERROR("Invalid staff type %u", static_cast(_staffType)); - return Result(Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE); } if (getGameState().entities.GetNumFreeEntities() < 400) { - return Result(Status::NoFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME); + return Result(Status::noFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME); } if (_staffType == static_cast(StaffType::entertainer)) @@ -94,7 +94,7 @@ namespace OpenRCT2::GameActions if (std::find(costumes.begin(), costumes.end(), _costumeIndex) == costumes.end()) { LOG_ERROR("Unavailable entertainer costume %u", static_cast(_costumeIndex)); - return Result(Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE); } } @@ -102,7 +102,7 @@ namespace OpenRCT2::GameActions if (newPeep == nullptr) { // Too many peeps exist already. - return Result(Status::NoFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME); + return Result(Status::noFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME); } if (execute == false) diff --git a/src/openrct2/actions/StaffSetColourAction.cpp b/src/openrct2/actions/StaffSetColourAction.cpp index b8ad72c435..3b4fbe09f2 100644 --- a/src/openrct2/actions/StaffSetColourAction.cpp +++ b/src/openrct2/actions/StaffSetColourAction.cpp @@ -50,7 +50,7 @@ namespace OpenRCT2::GameActions if (staffType != StaffType::handyman && staffType != StaffType::mechanic && staffType != StaffType::security) { LOG_ERROR("Staff color can't be changed for staff type %d", _staffType); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); } return Result(); } @@ -59,7 +59,7 @@ namespace OpenRCT2::GameActions { // Update global uniform colour property auto res = StaffSetColour(static_cast(_staffType), _colour); - if (res.Error != Status::Ok) + if (res.Error != Status::ok) { return res; } diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index 8cc1cb6f48..3b95be91ff 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -50,14 +50,14 @@ namespace OpenRCT2::GameActions if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { LOG_ERROR("Invalid sprite index %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } auto* staff = getGameState().entities.TryGetEntity(_spriteIndex); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } auto& objManager = GetContext()->GetObjectManager(); @@ -67,7 +67,7 @@ namespace OpenRCT2::GameActions if (animObj->GetPeepType() != animPeepType) { LOG_ERROR("Invalid entertainer costume %u", _costume); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } return Result(); } @@ -78,7 +78,7 @@ namespace OpenRCT2::GameActions if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } staff->AnimationObjectIndex = _costume; diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index d199dc56ec..ba2d8c3114 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -52,14 +52,14 @@ namespace OpenRCT2::GameActions if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { LOG_ERROR("Invalid sprite index %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_VALUE_OUT_OF_RANGE); } auto staff = getGameState().entities.TryGetEntity(_spriteIndex); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND); + return Result(Status::invalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND); } return Result(); @@ -71,7 +71,7 @@ namespace OpenRCT2::GameActions if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND); + return Result(Status::invalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND); } auto curName = staff->GetName(); @@ -82,7 +82,7 @@ namespace OpenRCT2::GameActions if (!staff->SetName(_name)) { - return Result(Status::Unknown, STR_CANT_NAME_GUEST, kStringIdNone); + return Result(Status::unknown, STR_CANT_NAME_GUEST, kStringIdNone); } GfxInvalidateScreen(); diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index 2266e41fab..bb7dc5e4e8 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -49,7 +49,7 @@ namespace OpenRCT2::GameActions if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { LOG_ERROR("Invalid sprite index %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } auto* staff = getGameState().entities.TryGetEntity(_spriteIndex); @@ -57,7 +57,7 @@ namespace OpenRCT2::GameActions || (staff->AssignedStaffType != StaffType::handyman && staff->AssignedStaffType != StaffType::mechanic)) { LOG_ERROR("Staff orders can't be changed for staff of type %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); } return Result(); @@ -69,7 +69,7 @@ namespace OpenRCT2::GameActions if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } staff->StaffOrders = _ordersId; diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index ad0fdd7735..2512bbc355 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -66,7 +66,7 @@ namespace OpenRCT2::GameActions if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteID %u", _spriteId.ToUnderlying()); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } auto validRange = ClampRangeWithinMap(_range); @@ -76,7 +76,7 @@ namespace OpenRCT2::GameActions { if (!LocationValid({ x, y })) { - return Result(Status::InvalidParameters, STR_SET_PATROL_AREA, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_SET_PATROL_AREA, STR_OFF_EDGE_OF_MAP); } } } diff --git a/src/openrct2/actions/SurfaceSetStyleAction.cpp b/src/openrct2/actions/SurfaceSetStyleAction.cpp index f965b1f1ee..c94af33d2e 100644 --- a/src/openrct2/actions/SurfaceSetStyleAction.cpp +++ b/src/openrct2/actions/SurfaceSetStyleAction.cpp @@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions if (surfaceObj == nullptr) { LOG_ERROR("Invalid surface style %u", _surfaceStyle); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE); } } @@ -72,7 +72,7 @@ namespace OpenRCT2::GameActions if (edgeObj == nullptr) { LOG_ERROR("Invalid edge style %u", _edgeStyle); - return Result(Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE); } } @@ -88,7 +88,7 @@ namespace OpenRCT2::GameActions if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode && (gameState.park.flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES)) { - return Result(Status::Disallowed, STR_CANT_CHANGE_LAND_TYPE, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); + return Result(Status::disallowed, STR_CANT_CHANGE_LAND_TYPE, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); } money64 surfaceCost = 0; diff --git a/src/openrct2/actions/TileModifyAction.cpp b/src/openrct2/actions/TileModifyAction.cpp index fe793ca314..cb046e6109 100644 --- a/src/openrct2/actions/TileModifyAction.cpp +++ b/src/openrct2/actions/TileModifyAction.cpp @@ -63,7 +63,7 @@ namespace OpenRCT2::GameActions { if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_CHANGE_THIS, STR_OFF_EDGE_OF_MAP); } auto res = Result(); switch (_setting) @@ -240,7 +240,7 @@ namespace OpenRCT2::GameActions } default: LOG_ERROR("Invalid tile modification type %u", _setting); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } res.Position.x = _loc.x; diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index 95d467d5c5..33232349cd 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -64,7 +64,7 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); } auto& objManager = GetContext()->GetObjectManager(); @@ -83,9 +83,9 @@ namespace OpenRCT2::GameActions auto rideCreateAction = RideCreateAction(_td.trackAndVehicle.rtdIndex, entryIndex, 0, 0, gameState.lastEntranceStyle); rideCreateAction.SetFlags(GetFlags()); auto r = ExecuteNested(&rideCreateAction, gameState); - if (r.Error != Status::Ok) + if (r.Error != Status::ok) { - return Result(Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); + return Result(Status::noFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); } const auto rideIndex = r.GetData(); @@ -93,7 +93,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %d", rideIndex); - return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); } bool placeScenery = _placeScenery; @@ -114,7 +114,7 @@ namespace OpenRCT2::GameActions ExecuteNested(&gameAction, gameState); - if (queryRes.Error != Status::Ok) + if (queryRes.Error != Status::ok) { res.Error = queryRes.Error; res.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; @@ -153,9 +153,9 @@ namespace OpenRCT2::GameActions auto rideCreateAction = RideCreateAction(_td.trackAndVehicle.rtdIndex, entryIndex, 0, 0, gameState.lastEntranceStyle); rideCreateAction.SetFlags(GetFlags()); auto r = ExecuteNested(&rideCreateAction, gameState); - if (r.Error != Status::Ok) + if (r.Error != Status::ok) { - return Result(Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); + return Result(Status::noFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); } const auto rideIndex = r.GetData(); @@ -163,7 +163,7 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %d", rideIndex); - return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); } // Query first, this is required again to determine if scenery is available. @@ -178,7 +178,7 @@ namespace OpenRCT2::GameActions queryRes = TrackDesignPlace(_td, flags, placeScenery, *ride, _loc); } - if (queryRes.Error != Status::Ok) + if (queryRes.Error != Status::ok) { auto gameAction = RideDemolishAction(ride->id, RideModifyType::demolish); gameAction.SetFlags(GetFlags()); @@ -196,7 +196,7 @@ namespace OpenRCT2::GameActions flags.set(CommandFlag::apply); auto execRes = TrackDesignPlace(_td, flags, placeScenery, *ride, _loc); - if (execRes.Error != Status::Ok) + if (execRes.Error != Status::ok) { auto gameAction = RideDemolishAction(ride->id, RideModifyType::demolish); gameAction.SetFlags(GetFlags()); @@ -259,7 +259,7 @@ namespace OpenRCT2::GameActions ride->vehicleColours[i] = _td.appearance.vehicleColours[i]; } - for (int32_t count = 1; count == 1 || r.Error != Status::Ok; ++count) + for (int32_t count = 1; count == 1 || r.Error != Status::ok; ++count) { auto name = count == 1 ? _td.gameStateData.name : (_td.gameStateData.name + " " + std::to_string(count)); auto gameAction = RideSetNameAction(ride->id, name); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 92a3175a46..0bba145ee8 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -83,38 +83,38 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %d", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { LOG_ERROR("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } if (!DirectionValid(_origin.direction)) { LOG_ERROR("Invalid direction for track placement, direction = %d", _origin.direction); return Result( - Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE); + Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE); } if (_rideType != ride->type && !gameState.cheats.allowArbitraryRideTypeChanges) { - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, kStringIdNone); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, kStringIdNone); } if (_rideType > RIDE_TYPE_COUNT) { LOG_ERROR("Invalid ride type for track placement, rideType = %d", _rideType); return Result( - Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE); + Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE); } if (_brakeSpeed > kMaximumTrackSpeed) { LOG_WARNING("Invalid speed for track placement, speed = %d", _brakeSpeed); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_SPEED_TOO_HIGH); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_SPEED_TOO_HIGH); } auto res = Result(); @@ -130,7 +130,7 @@ namespace OpenRCT2::GameActions if ((ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && _trackType == TrackElemType::EndStation) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NOT_ALLOWED_TO_MODIFY_STATION); + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NOT_ALLOWED_TO_MODIFY_STATION); } if (!(GetActionFlags() & Flags::AllowWhilePaused)) @@ -138,7 +138,7 @@ namespace OpenRCT2::GameActions if (GameIsPaused() && !gameState.cheats.buildInPauseMode) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED); } } @@ -150,7 +150,7 @@ namespace OpenRCT2::GameActions if (ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ONLY_ONE_ON_RIDE_PHOTO_PER_RIDE); } } @@ -159,7 +159,7 @@ namespace OpenRCT2::GameActions if (ride->lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ONLY_ONE_CABLE_LIFT_HILL_PER_RIDE); } } @@ -171,7 +171,7 @@ namespace OpenRCT2::GameActions if (ted.flags & TRACK_ELEM_FLAG_IS_STEEP_UP) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_STEEP_FOR_LIFT_HILL); + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_STEEP_FOR_LIFT_HILL); } } } @@ -187,11 +187,11 @@ namespace OpenRCT2::GameActions if (!LocationValid(tileCoords)) { - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); } if (!MapIsLocationOwned(tileCoords) && !gameState.cheats.sandboxMode) { - return Result(Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } numElements++; } @@ -200,7 +200,7 @@ namespace OpenRCT2::GameActions { LOG_ERROR("Not enough free map elements to place track."); return Result( - Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + Status::noFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } if (!gameState.cheats.allowTrackPlaceInvalidHeights) @@ -210,7 +210,7 @@ namespace OpenRCT2::GameActions if ((_origin.z & 0x0F) != 8) { return Result( - Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_INVALID_HEIGHT); + Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_INVALID_HEIGHT); } } else @@ -218,7 +218,7 @@ namespace OpenRCT2::GameActions if ((_origin.z & 0x0F) != 0) { return Result( - Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_INVALID_HEIGHT); + Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_INVALID_HEIGHT); } } } @@ -237,7 +237,7 @@ namespace OpenRCT2::GameActions if (mapLoc.z < 16) { - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_LOW); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_LOW); } int32_t baseZ = floor2(mapLoc.z, kCoordsZStep); @@ -256,7 +256,7 @@ namespace OpenRCT2::GameActions if (clearanceZ > MAX_TRACK_HEIGHT) { - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH); } auto crossingMode = (rtd.HasFlag(RtdFlag::supportsLevelCrossings) && _trackType == TrackElemType::Flat) @@ -265,7 +265,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( { mapLoc, baseZ, clearanceZ }, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, crossingMode); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; return canBuild; @@ -279,7 +279,7 @@ namespace OpenRCT2::GameActions if (resultData.GroundFlags != 0 && (resultData.GroundFlags & mapGroundFlags) == 0) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND); } } @@ -290,7 +290,7 @@ namespace OpenRCT2::GameActions if (resultData.GroundFlags & ELEMENT_IS_UNDERGROUND) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } } @@ -300,14 +300,14 @@ namespace OpenRCT2::GameActions if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_UNDERWATER); + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_UNDERWATER); } } if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER && !gameState.cheats.disableClearanceChecks) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_RIDE_CANT_BUILD_THIS_UNDERWATER); + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_RIDE_CANT_BUILD_THIS_UNDERWATER); } if (rtd.HasFlag(RtdFlag::trackMustBeOnWater) && !_trackDesignDrawingPreview) @@ -316,20 +316,20 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { return Result( - Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } auto waterHeight = surfaceElement->GetWaterHeight(); if (waterHeight == 0) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_WATER); + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_WATER); } if (waterHeight != baseZ) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_WATER); + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_WATER); } waterHeight -= kLandHeightStep; if (waterHeight == surfaceElement->GetBaseZ()) @@ -339,7 +339,7 @@ namespace OpenRCT2::GameActions || slope == kTileSlopeNCornerDown) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_WATER); } } @@ -352,7 +352,7 @@ namespace OpenRCT2::GameActions { mapLoc, baseZ, _origin.direction }, _rideIndex, {}, _fromTrackDesign); if (!addElementResult.Successful) { - return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, addElementResult.Message); + return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, addElementResult.Message); } } @@ -361,7 +361,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { return Result( - Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } if (!gameState.cheats.disableSupportLimits) @@ -384,7 +384,7 @@ namespace OpenRCT2::GameActions if (ride_height > maxHeight && !_trackDesignDrawingPreview) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH_FOR_SUPPORTS); + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH_FOR_SUPPORTS); } } } @@ -414,14 +414,14 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { LOG_ERROR("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } auto res = Result(); @@ -470,7 +470,7 @@ namespace OpenRCT2::GameActions auto canBuild = MapCanConstructWithClearAt( mapLocWithClearance, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags().with(CommandFlag::apply), kTileSlopeFlat, crossingMode); - if (canBuild.Error != Status::Ok) + if (canBuild.Error != Status::ok) { canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; return canBuild; @@ -517,7 +517,7 @@ namespace OpenRCT2::GameActions if (resultData.GroundFlags != 0 && (resultData.GroundFlags & mapGroundFlags) == 0) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND); } } @@ -529,7 +529,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { return Result( - Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t supportHeight = baseZ - surfaceElement->GetBaseZ(); @@ -559,7 +559,7 @@ namespace OpenRCT2::GameActions { LOG_ERROR("Cannot create track element for ride = %d", _rideIndex.ToUnderlying()); return Result( - Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + Status::noFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } trackElement->SetClearanceZ(clearanceZ); diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index bef46d5969..d7db2e5b05 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -113,13 +113,13 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", _origin.x, _origin.y, _origin.z, _origin.direction, _sequence); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); } if (tileElement->AsTrack()->IsIndestructible()) { return Result( - Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_YOU_ARE_NOT_ALLOWED_TO_REMOVE_THIS_SECTION); + Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_YOU_ARE_NOT_ALLOWED_TO_REMOVE_THIS_SECTION); } RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); @@ -129,20 +129,20 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %d.", rideIndex); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND); } if (ride->type >= RIDE_TYPE_COUNT) { LOG_ERROR("Ride type not found. ride type = %d.", ride->type); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_VALUE_OUT_OF_RANGE); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_VALUE_OUT_OF_RANGE); } const auto& ted = GetTrackElementDescriptor(trackType); auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex(); if (sequenceIndex >= ted.numSequences) { LOG_ERROR("Track block %d not found for track type %d.", sequenceIndex, trackType); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_BLOCK_NOT_FOUND); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_BLOCK_NOT_FOUND); } const auto& currentTrackBlock = ted.sequences[sequenceIndex].clearance; @@ -168,7 +168,7 @@ namespace OpenRCT2::GameActions if (!LocationValid(mapLoc)) { - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } MapInvalidateTileFull(mapLoc); @@ -206,7 +206,7 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", mapLoc.x, mapLoc.y, mapLoc.z, _origin.direction, i); - return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); + return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); } int32_t entranceDirections = ted.sequences[0].flags; @@ -215,7 +215,7 @@ namespace OpenRCT2::GameActions const auto removeElementResult = TrackRemoveStationElement({ mapLoc, _origin.direction }, rideIndex, {}); if (!removeElementResult.Successful) { - return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message); + return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message); } } @@ -223,7 +223,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { LOG_ERROR("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); - return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int16_t _support_height = tileElement->BaseHeight - surfaceElement->BaseHeight; @@ -297,7 +297,7 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", _origin.x, _origin.y, _origin.z, _origin.direction, _sequence); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); } RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); @@ -308,14 +308,14 @@ namespace OpenRCT2::GameActions if (ride == nullptr) { LOG_ERROR("Ride not found. ride index = %d.", rideIndex); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND); } const auto& ted = GetTrackElementDescriptor(trackType); auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex(); if (sequenceIndex >= ted.numSequences) { LOG_ERROR("Track block %d not found for track type %d.", sequenceIndex, trackType); - return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_BLOCK_NOT_FOUND); + return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_BLOCK_NOT_FOUND); } auto startLoc = _origin; @@ -376,7 +376,7 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", mapLoc.x, mapLoc.y, mapLoc.z, _origin.direction, i); - return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); + return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); } int32_t entranceDirections = ted.sequences[0].flags; @@ -385,7 +385,7 @@ namespace OpenRCT2::GameActions const auto removeElementResult = TrackRemoveStationElement({ mapLoc, _origin.direction }, rideIndex, {}); if (!removeElementResult.Successful) { - return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message); + return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message); } } @@ -393,7 +393,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { LOG_ERROR("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); - return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int16_t _support_height = tileElement->BaseHeight - surfaceElement->BaseHeight; @@ -414,7 +414,7 @@ namespace OpenRCT2::GameActions { mapLoc, _origin.direction }, rideIndex, { CommandFlag::apply }); if (!removeElementResult.Successful) { - return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message); + return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message); } } diff --git a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp index f50530a881..681f2d2d8b 100644 --- a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp +++ b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp @@ -64,20 +64,20 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_CHANGE_THIS, STR_OFF_EDGE_OF_MAP); } TileElement* tileElement = MapGetTrackElementAtOfType(_loc, _trackType); if (tileElement == nullptr) { LOG_ERROR("Track element of type %u not found at x = %d, y = %d, z = %d", _trackType, _loc.x, _loc.y, _loc.z); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); } if (_brakeSpeed > kMaximumTrackSpeed) { LOG_WARNING("Invalid speed for track, speed = %d", _brakeSpeed); - return Result(Status::InvalidParameters, STR_SPEED_TOO_HIGH, kStringIdNone); + return Result(Status::invalidParameters, STR_SPEED_TOO_HIGH, kStringIdNone); } if (isExecuting) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 4447f7d5c3..3db2342930 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -88,7 +88,7 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); } auto mapSizeMax = GetMapSizeMaxXY(); @@ -99,23 +99,23 @@ namespace OpenRCT2::GameActions { if (!MapIsLocationInPark(_loc)) { - return Result(Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } } else if (!MapIsLocationOwned(_loc)) { - return Result(Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } } else if (!_trackDesignDrawingPreview && (_loc.x > mapSizeMax.x || _loc.y > mapSizeMax.y)) { LOG_ERROR("Invalid x/y coordinates. x = %d y = %d", _loc.x, _loc.y); - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); } if (_edge > 3) { - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, kStringIdNone); } uint8_t edgeSlope = 0; @@ -126,7 +126,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y); - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } targetHeight = surfaceElement->GetBaseZ(); @@ -143,7 +143,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y); - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } if (surfaceElement->GetWaterHeight() > 0) @@ -152,13 +152,13 @@ namespace OpenRCT2::GameActions if (targetHeight < waterHeight && !gameState.cheats.disableClearanceChecks) { - return Result(Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); + return Result(Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } } if (targetHeight < surfaceElement->GetBaseZ() && !gameState.cheats.disableClearanceChecks) { - return Result(Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + return Result(Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } if (!(edgeSlope & (EDGE_SLOPE_UPWARDS | EDGE_SLOPE_DOWNWARDS))) @@ -170,7 +170,7 @@ namespace OpenRCT2::GameActions { if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks) { - return Result(Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + return Result(Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } if (surfaceElement->GetSlope() & kTileSlopeDiagonalFlag) @@ -186,7 +186,7 @@ namespace OpenRCT2::GameActions if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks) { return Result( - Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } newBaseHeight -= 2; } @@ -199,7 +199,7 @@ namespace OpenRCT2::GameActions { if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks) { - return Result(Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + return Result(Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } if (surfaceElement->GetSlope() & kTileSlopeDiagonalFlag) @@ -215,7 +215,7 @@ namespace OpenRCT2::GameActions if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks) { return Result( - Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } } } @@ -228,7 +228,7 @@ namespace OpenRCT2::GameActions if (wallEntry == nullptr) { LOG_ERROR("Wall Type not found %d", _wallType); - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } if (wallEntry->scrolling_mode != kScrollingModeNone) @@ -236,7 +236,7 @@ namespace OpenRCT2::GameActions if (HasReachedBannerLimit()) { LOG_ERROR("No free banners available"); - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } } @@ -245,7 +245,7 @@ namespace OpenRCT2::GameActions { if (wallEntry->flags & WALL_SCENERY_CANT_BUILD_ON_SLOPE) { - return Result(Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_ERR_UNABLE_TO_BUILD_THIS_ON_SLOPE); + return Result(Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_ERR_UNABLE_TO_BUILD_THIS_ON_SLOPE); } clearanceHeight += 2; } @@ -255,7 +255,7 @@ namespace OpenRCT2::GameActions if (!(GetFlags().has(CommandFlag::trackDesign)) && !gameState.cheats.disableClearanceChecks) { auto result = WallCheckObstruction(wallEntry, targetHeight / 8, clearanceHeight, &wallAcrossTrack); - if (result.Error != Status::Ok) + if (result.Error != Status::ok) { return result; } @@ -263,7 +263,7 @@ namespace OpenRCT2::GameActions if (!MapCheckCapacityAndReorganise(_loc)) { - return Result(Status::NoFreeElements, STR_CANT_BUILD_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + return Result(Status::noFreeElements, STR_CANT_BUILD_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } res.Cost = wallEntry->price; @@ -296,7 +296,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y); - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } targetHeight = surfaceElement->GetBaseZ(); @@ -315,7 +315,7 @@ namespace OpenRCT2::GameActions if (wallEntry == nullptr) { LOG_ERROR("Wall Type not found %d", _wallType); - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } uint8_t clearanceHeight = targetHeight / kCoordsZStep; @@ -329,7 +329,7 @@ namespace OpenRCT2::GameActions if (!(GetFlags().has(CommandFlag::trackDesign)) && !gameState.cheats.disableClearanceChecks) { auto result = WallCheckObstruction(wallEntry, targetHeight / kCoordsZStep, clearanceHeight, &wallAcrossTrack); - if (result.Error != Status::Ok) + if (result.Error != Status::ok) { return result; } @@ -342,7 +342,7 @@ namespace OpenRCT2::GameActions if (banner == nullptr) { LOG_ERROR("No free banners available"); - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } banner->text = {}; @@ -363,7 +363,7 @@ namespace OpenRCT2::GameActions auto* wallElement = TileElementInsert(targetLoc, 0b0000); if (wallElement == nullptr) { - return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } wallElement->ClearanceHeight = clearanceHeight; @@ -499,7 +499,7 @@ namespace OpenRCT2::GameActions *wallAcrossTrack = false; if (MapIsEdge(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); } TileElement* tileElement = MapGetFirstElementAt(_loc); @@ -521,7 +521,7 @@ namespace OpenRCT2::GameActions int32_t direction = tileElement->GetDirection(); if (_edge == direction) { - auto res = Result(Status::NoClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone); + auto res = Result(Status::noClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone); MapGetObstructionErrorText(tileElement, res); return res; } @@ -529,7 +529,7 @@ namespace OpenRCT2::GameActions } if (tileElement->GetOccupiedQuadrants() == 0) continue; - auto res = Result(Status::NoClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone); + auto res = Result(Status::noClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone); switch (elementType) { case TileElementType::Entrance: diff --git a/src/openrct2/actions/WallRemoveAction.cpp b/src/openrct2/actions/WallRemoveAction.cpp index e375378622..e7c92669d4 100644 --- a/src/openrct2/actions/WallRemoveAction.cpp +++ b/src/openrct2/actions/WallRemoveAction.cpp @@ -47,20 +47,20 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } const bool isGhost = GetFlags().has(CommandFlag::ghost); if (!isGhost && gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode && !MapIsLocationOwned(_loc)) { - return Result(Status::NotOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } TileElement* wallElement = GetFirstWallElementAt(_loc, isGhost); if (wallElement == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } res.Cost = 0; @@ -78,7 +78,7 @@ namespace OpenRCT2::GameActions TileElement* wallElement = GetFirstWallElementAt(_loc, isGhost); if (wallElement == nullptr) { - return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); + return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } res.Position.x = _loc.x + 16; diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index 3f4f8b22dd..6b37e33f16 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -64,12 +64,12 @@ namespace OpenRCT2::GameActions if (!LocationValid(_loc)) { - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP); } if (gLegacyScene != LegacyScene::scenarioEditor && !MapIsLocationInPark(_loc) && !getGameState().cheats.sandboxMode) { - return Result(Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } auto wallElement = MapGetWallElementAt(_loc); @@ -78,7 +78,7 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Could not find wall element at: x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_WALL_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_WALL_ELEMENT_NOT_FOUND); } if ((GetFlags().has(CommandFlag::ghost)) && !(wallElement->IsGhost())) @@ -92,25 +92,25 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Wall element does not have wall entry at x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return Result(Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } if (_primaryColour >= COLOUR_COUNT) { LOG_ERROR("Primary colour invalid: colour = %d", _primaryColour); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } else if (_secondaryColour >= COLOUR_COUNT) { LOG_ERROR("Secondary colour invalid: colour = %d", _secondaryColour); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } else if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR) { if (_tertiaryColour >= COLOUR_COUNT) { LOG_ERROR("Tertiary colour invalid: colour = %d", _tertiaryColour); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } } return res; @@ -131,7 +131,7 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Could not find wall element at: x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if ((GetFlags().has(CommandFlag::ghost)) && !(wallElement->IsGhost())) @@ -145,7 +145,7 @@ namespace OpenRCT2::GameActions LOG_ERROR( "Wall element does not have wall entry at x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return Result(Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); + return Result(Status::unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } wallElement->SetPrimaryColour(_primaryColour); diff --git a/src/openrct2/actions/WaterLowerAction.cpp b/src/openrct2/actions/WaterLowerAction.cpp index bbf3a65437..fe45486e83 100644 --- a/src/openrct2/actions/WaterLowerAction.cpp +++ b/src/openrct2/actions/WaterLowerAction.cpp @@ -102,7 +102,7 @@ namespace OpenRCT2::GameActions waterSetHeightAction.SetFlags(GetFlags()); auto result = isExecuting ? ExecuteNested(&waterSetHeightAction, gameState) : QueryNested(&waterSetHeightAction, gameState); - if (result.Error == Status::Ok) + if (result.Error == Status::ok) { res.Cost += result.Cost; hasChanged = true; @@ -117,7 +117,7 @@ namespace OpenRCT2::GameActions if (!withinOwnership) { - return Result(Status::Disallowed, STR_CANT_LOWER_WATER_LEVEL_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, STR_CANT_LOWER_WATER_LEVEL_HERE, STR_LAND_NOT_OWNED_BY_PARK); ; } diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index 2d05aa5a7a..c61e01fb32 100644 --- a/src/openrct2/actions/WaterRaiseAction.cpp +++ b/src/openrct2/actions/WaterRaiseAction.cpp @@ -116,7 +116,7 @@ namespace OpenRCT2::GameActions waterSetHeightAction.SetFlags(GetFlags()); auto result = isExecuting ? ExecuteNested(&waterSetHeightAction, gameState) : QueryNested(&waterSetHeightAction, gameState); - if (result.Error == Status::Ok) + if (result.Error == Status::ok) { res.Cost += result.Cost; hasChanged = true; @@ -131,7 +131,7 @@ namespace OpenRCT2::GameActions if (!withinOwnership) { - return Result(Status::Disallowed, STR_CANT_RAISE_WATER_LEVEL_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, STR_CANT_RAISE_WATER_LEVEL_HERE, STR_LAND_NOT_OWNED_BY_PARK); } if (isExecuting && hasChanged) diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index f894b97db8..0306b0cdbd 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -55,25 +55,25 @@ namespace OpenRCT2::GameActions if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode && gameState.park.flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES) { - return Result(Status::Disallowed, kStringIdNone, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); + return Result(Status::disallowed, kStringIdNone, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); } StringId errorMsg = CheckParameters(); if (errorMsg != kStringIdNone) { - return Result(Status::InvalidParameters, kStringIdNone, errorMsg); + return Result(Status::invalidParameters, kStringIdNone, errorMsg); } if (!LocationValid(_coords)) { - return Result(Status::NotOwned, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::notOwned, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK); } if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode) { if (!MapIsLocationInPark(_coords)) { - return Result(Status::Disallowed, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK); + return Result(Status::disallowed, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK); } } @@ -81,7 +81,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { LOG_ERROR("No surface element at: x %u, y %u", _coords.x, _coords.y); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t zHigh = surfaceElement->GetBaseZ(); @@ -97,13 +97,13 @@ namespace OpenRCT2::GameActions zLow = temp; } - if (auto res2 = MapCanConstructAt({ _coords, zLow, zHigh }, { 0b1111, 0b1111 }); res2.Error != Status::Ok) + if (auto res2 = MapCanConstructAt({ _coords, zLow, zHigh }, { 0b1111, 0b1111 }); res2.Error != Status::ok) { return res2; } if (surfaceElement->HasTrackThatNeedsWater()) { - return Result(Status::Disallowed, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ON_THIS_TILE_NEEDS_WATER); + return Result(Status::disallowed, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ON_THIS_TILE_NEEDS_WATER); } res.Cost = 250; @@ -126,7 +126,7 @@ namespace OpenRCT2::GameActions if (surfaceElement == nullptr) { LOG_ERROR("No surface element at: x %u, y %u", _coords.x, _coords.y); - return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } if (_height > surfaceElement->BaseHeight) diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 68936d21a2..b00c6b1879 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -660,7 +660,7 @@ void Peep::PickupAbort(int32_t old_x) gPickupPeepImage = ImageId(); } -// Returns GameActions::Status::OK when a peep can be dropped at the given location. When apply is set to true the peep gets +// Returns GameActions::Status::ok when a peep can be dropped at the given location. When apply is set to true the peep gets // dropped. GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply) { @@ -672,7 +672,7 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply) } if (tileElement == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); + return GameActions::Result(GameActions::Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } // Set the coordinate of destination to be exactly @@ -681,17 +681,17 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply) if (!MapIsLocationOwned(destination)) { - return GameActions::Result(GameActions::Status::NotOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_LAND_NOT_OWNED_BY_PARK); + return GameActions::Result(GameActions::Status::notOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_LAND_NOT_OWNED_BY_PARK); } if (auto res = MapCanConstructAt({ destination, destination.z, destination.z + (1 * 8) }, { 0b1111, 0 }); - res.Error != GameActions::Status::Ok) + res.Error != GameActions::Status::ok) { const auto stringId = std::get(res.ErrorMessage); if (stringId != STR_RAISE_OR_LOWER_LAND_FIRST && stringId != STR_FOOTPATH_IN_THE_WAY) { return GameActions::Result( - GameActions::Status::NoClearance, STR_ERR_CANT_PLACE_PERSON_HERE, stringId, res.ErrorMessageArgs.data()); + GameActions::Status::noClearance, STR_ERR_CANT_PLACE_PERSON_HERE, stringId, res.ErrorMessageArgs.data()); } } diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index f4f47a400f..a4997f6d4f 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -1005,7 +1005,7 @@ GameActions::Result StaffSetColour(StaffType staffType, colour_t value) break; default: return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); } return GameActions::Result(); } diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index f76ae92885..5b6b2a6664 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -751,7 +751,7 @@ static void ConsoleSetVariableAction(InteractiveConsole& console, std::string va { auto action = TAction(std::forward(args)...); action.SetCallback([&console, var](const GameActions::GameAction*, const GameActions::Result* res) { - if (res->Error != GameActions::Status::Ok) + if (res->Error != GameActions::Status::ok) console.WriteLineError( String::stdFormat( "set %s command failed: %s - %s.", var.c_str(), res->GetErrorTitle().c_str(), diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index c3cbf6610b..d362f28eb9 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -3579,23 +3579,23 @@ namespace OpenRCT2::Network NetworkGroup* fromgroup = network.GetGroupByID(actionPlayerId); if (player == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, kStringIdNone); + return GameActions::Result(GameActions::Status::invalidParameters, STR_CANT_DO_THIS, kStringIdNone); } if (network.GetGroupByID(groupId) == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, kStringIdNone); + return GameActions::Result(GameActions::Status::invalidParameters, STR_CANT_DO_THIS, kStringIdNone); } if (player->Flags & PlayerFlags::kIsServer) { return GameActions::Result( - GameActions::Status::InvalidParameters, STR_CANT_CHANGE_GROUP_THAT_THE_HOST_BELONGS_TO, kStringIdNone); + GameActions::Status::invalidParameters, STR_CANT_CHANGE_GROUP_THAT_THE_HOST_BELONGS_TO, kStringIdNone); } if (groupId == 0 && fromgroup != nullptr && fromgroup->Id != 0) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_SET_TO_THIS_GROUP, kStringIdNone); + return GameActions::Result(GameActions::Status::invalidParameters, STR_CANT_SET_TO_THIS_GROUP, kStringIdNone); } if (isExecuting) @@ -3644,7 +3644,7 @@ namespace OpenRCT2::Network NetworkGroup* newgroup = network.AddGroup(); if (newgroup == nullptr) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_DO_THIS, kStringIdNone); + return GameActions::Result(GameActions::Status::unknown, STR_CANT_DO_THIS, kStringIdNone); } } } @@ -3654,14 +3654,14 @@ namespace OpenRCT2::Network if (groupId == 0) { return GameActions::Result( - GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, kStringIdNone); + GameActions::Status::disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, kStringIdNone); } for (const auto& it : network.player_list) { if ((it.get())->Group == groupId) { return GameActions::Result( - GameActions::Status::Disallowed, STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO, kStringIdNone); + GameActions::Status::disallowed, STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO, kStringIdNone); } } if (isExecuting) @@ -3675,7 +3675,7 @@ namespace OpenRCT2::Network if (groupId == 0) { // can't change admin group permissions return GameActions::Result( - GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, kStringIdNone); + GameActions::Status::disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, kStringIdNone); } NetworkGroup* mygroup = nullptr; Player* player = network.GetPlayerByID(actionPlayerId); @@ -3686,7 +3686,7 @@ namespace OpenRCT2::Network if (mygroup == nullptr || !mygroup->CanPerformAction(networkPermission)) { return GameActions::Result( - GameActions::Status::Disallowed, STR_CANT_MODIFY_PERMISSION_THAT_YOU_DO_NOT_HAVE_YOURSELF, + GameActions::Status::disallowed, STR_CANT_MODIFY_PERMISSION_THAT_YOU_DO_NOT_HAVE_YOURSELF, kStringIdNone); } } @@ -3722,7 +3722,7 @@ namespace OpenRCT2::Network NetworkGroup* group = network.GetGroupByID(groupId); if (group == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_GROUP, kStringIdNone); + return GameActions::Result(GameActions::Status::invalidParameters, STR_CANT_RENAME_GROUP, kStringIdNone); } const char* oldName = group->GetName().c_str(); @@ -3735,7 +3735,7 @@ namespace OpenRCT2::Network if (name.empty()) { return GameActions::Result( - GameActions::Status::InvalidParameters, STR_CANT_RENAME_GROUP, STR_INVALID_GROUP_NAME); + GameActions::Status::invalidParameters, STR_CANT_RENAME_GROUP, STR_INVALID_GROUP_NAME); } if (isExecuting) @@ -3751,7 +3751,7 @@ namespace OpenRCT2::Network { if (groupId == 0) { - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_SET_TO_THIS_GROUP, kStringIdNone); + return GameActions::Result(GameActions::Status::disallowed, STR_CANT_SET_TO_THIS_GROUP, kStringIdNone); } if (isExecuting) { @@ -3762,7 +3762,7 @@ namespace OpenRCT2::Network default: LOG_ERROR("Invalid Modify Group Type: %u", static_cast(type)); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } network.SaveGroups(); @@ -3779,12 +3779,12 @@ namespace OpenRCT2::Network // Player might be already removed by the PLAYERLIST command, need to refactor non-game commands executing too // early. return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_PLAYER_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_PLAYER_NOT_FOUND); } if (player->Flags & PlayerFlags::kIsServer) { - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_KICK_THE_HOST, kStringIdNone); + return GameActions::Result(GameActions::Status::disallowed, STR_CANT_KICK_THE_HOST, kStringIdNone); } if (isExecuting) diff --git a/src/openrct2/rct12/ScenarioPatcher.cpp b/src/openrct2/rct12/ScenarioPatcher.cpp index f103ed2408..cafaab6cdd 100644 --- a/src/openrct2/rct12/ScenarioPatcher.cpp +++ b/src/openrct2/rct12/ScenarioPatcher.cpp @@ -663,7 +663,7 @@ static void ApplyPathFixes(const json_t& scenarioPatch) coordinate.ToCoordsXYZ(), slope, surfaceObjIndex, railingsObjIndex, direction, constructionFlags); auto& gameState = getGameState(); auto result = footpathPlaceAction.Execute(gameState); - if (result.Error != GameActions::Status::Ok) + if (result.Error != GameActions::Status::ok) { Guard::Assert(0, "Could not patch path"); } diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 9846311e7e..ca418ab977 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1164,7 +1164,7 @@ money64 SetOperatingSetting(RideId rideId, GameActions::RideSetSetting setting, { auto rideSetSetting = GameActions::RideSetSettingAction(rideId, setting, value); auto res = GameActions::Execute(&rideSetSetting, getGameState()); - return res.Error == GameActions::Status::Ok ? 0 : kMoney64Undefined; + return res.Error == GameActions::Status::ok ? 0 : kMoney64Undefined; } money64 SetOperatingSettingNested(RideId rideId, GameActions::RideSetSetting setting, uint8_t value, CommandFlags flags) @@ -1175,7 +1175,7 @@ money64 SetOperatingSettingNested(RideId rideId, GameActions::RideSetSetting set auto& gameState = getGameState(); auto res = flags.has(CommandFlag::apply) ? GameActions::ExecuteNested(&rideSetSetting, gameState) : GameActions::QueryNested(&rideSetSetting, gameState); - return res.Error == GameActions::Status::Ok ? 0 : kMoney64Undefined; + return res.Error == GameActions::Status::ok ? 0 : kMoney64Undefined; } /** diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index a7583fceb3..3399bbeec3 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -1092,7 +1092,7 @@ static GameActions::Result TrackDesignPlaceSceneryElement( auto res = flags.has(CommandFlag::apply) ? GameActions::ExecuteNested(&smallSceneryPlace, gameState) : GameActions::QueryNested(&smallSceneryPlace, gameState); - cost = res.Error == GameActions::Status::Ok ? res.Cost : 0; + cost = res.Error == GameActions::Status::ok ? res.Cost : 0; break; } case ObjectType::largeScenery: @@ -1211,7 +1211,7 @@ static GameActions::Result TrackDesignPlaceSceneryElement( auto res = flags.has(CommandFlag::apply) ? GameActions::ExecuteNested(&footpathPlaceAction, gameState) : GameActions::QueryNested(&footpathPlaceAction, gameState); // Ignore failures - cost = res.Error == GameActions::Status::Ok ? res.Cost : 0; + cost = res.Error == GameActions::Status::ok ? res.Cost : 0; } else { @@ -1293,7 +1293,7 @@ static GameActions::Result TrackDesignPlaceAllScenery( TrackDesignUpdatePreviewBounds(tds, mapCoord); auto placementRes = TrackDesignPlaceSceneryElement(tds, mapCoord, mode, scenery, rotation, origin.z); - if (placementRes.Error != GameActions::Status::Ok) + if (placementRes.Error != GameActions::Status::ok) { if (tds.placeOperation != TrackPlaceOperation::removeGhost) { @@ -1301,7 +1301,7 @@ static GameActions::Result TrackDesignPlaceAllScenery( return placementRes; } - if (placementRes.Error == GameActions::Status::NoClearance) + if (placementRes.Error == GameActions::Status::noClearance) { // Some scenery might be obstructed, don't abort the entire operation. continue; @@ -1352,7 +1352,7 @@ static std::optional TrackDesignPlaceEntrances( if (tile_element == nullptr) { return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); } do @@ -1393,7 +1393,7 @@ static std::optional TrackDesignPlaceEntrances( ? GameActions::ExecuteNested(&rideEntranceExitPlaceAction, gameState) : GameActions::QueryNested(&rideEntranceExitPlaceAction, gameState); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { return res; } @@ -1406,7 +1406,7 @@ static std::optional TrackDesignPlaceEntrances( else { auto res = GameActions::RideEntranceExitPlaceAction::TrackPlaceQuery(newCoords, false); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { return res; } @@ -1489,7 +1489,7 @@ static GameActions::Result TrackDesignPlaceMaze( mazePlace.SetFlags(flags); auto res = flags.has(CommandFlag::apply) ? GameActions::ExecuteNested(&mazePlace, gameState) : GameActions::QueryNested(&mazePlace, gameState); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { return res; } @@ -1646,7 +1646,7 @@ static GameActions::Result TrackDesignPlaceRide( auto res = flags.has(CommandFlag::apply) ? GameActions::ExecuteNested(&trackPlaceAction, gameState) : GameActions::QueryNested(&trackPlaceAction, gameState); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { return res; } @@ -1670,7 +1670,7 @@ static GameActions::Result TrackDesignPlaceRide( if (surfaceElement == nullptr) { return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } @@ -1783,14 +1783,14 @@ static GameActions::Result TrackDesignPlaceVirtual( _currentRideIndex = savedRideId; _currentTrackPieceDirection = savedTrackPieceDirection; - if (trackPlaceRes.Error != GameActions::Status::Ok) + if (trackPlaceRes.Error != GameActions::Status::ok) { return trackPlaceRes; } // Scenery elements auto sceneryPlaceRes = TrackDesignPlaceAllScenery(tds, td.sceneryElements, coords.direction); - if (sceneryPlaceRes.Error != GameActions::Status::Ok) + if (sceneryPlaceRes.Error != GameActions::Status::ok) { return sceneryPlaceRes; } @@ -1867,7 +1867,7 @@ static money64 TrackDesignCreateRide(int32_t type, int32_t subType, CommandFlags auto res = GameActions::ExecuteNested(&gameAction, gameState); // Callee's of this function expect kMoney64Undefined in case of failure. - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { return kMoney64Undefined; } @@ -1953,7 +1953,7 @@ static bool TrackDesignPlacePreview( { mapSize.x, mapSize.y, z, _currentTrackPieceDirection }); gameState.park.flags = backup_park_flags; - if (res.Error == GameActions::Status::Ok) + if (res.Error == GameActions::Status::ok) { if (entry_index == kObjectEntryIndexNull) { diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 80a013c9d3..fb98ca06a5 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -1087,7 +1087,7 @@ GameActions::Result ScriptEngine::QueryOrExecuteCustomGameAction(const GameActio if (!dukArgs) { auto action = GameActions::Result(); - action.Error = GameActions::Status::InvalidParameters; + action.Error = GameActions::Status::invalidParameters; action.ErrorTitle = "Invalid JSON"; return action; } @@ -1124,7 +1124,7 @@ GameActions::Result ScriptEngine::QueryOrExecuteCustomGameAction(const GameActio } auto action = GameActions::Result(); - action.Error = GameActions::Status::Unknown; + action.Error = GameActions::Status::unknown; action.ErrorTitle = "Unknown custom action"; action.ErrorMessage = customAction.GetPluginName() + ": " + actionz; return action; @@ -1151,7 +1151,7 @@ GameActions::Result ScriptEngine::DukToGameActionResult(const DukValue& d) } else { - result.Error = GameActions::Status::Unknown; + result.Error = GameActions::Status::unknown; result.ErrorTitle = "Unknown"; result.ErrorMessage = "Unknown"; } @@ -1201,7 +1201,7 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameActions::GameAction& acti DukObject obj(_context); obj.Set("error", static_cast(result.Error)); - if (result.Error != GameActions::Status::Ok) + if (result.Error != GameActions::Status::ok) { obj.Set("errorTitle", result.GetErrorTitle()); obj.Set("errorMessage", result.GetErrorMessage()); @@ -1223,7 +1223,7 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameActions::GameAction& acti // RideCreateAction only if (action.GetType() == GameCommand::CreateRide) { - if (result.Error == GameActions::Status::Ok) + if (result.Error == GameActions::Status::ok) { const auto rideIndex = result.GetData(); obj.Set("ride", rideIndex.ToUnderlying()); @@ -1232,7 +1232,7 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameActions::GameAction& acti // StaffHireNewAction only else if (action.GetType() == GameCommand::HireNewStaffMember) { - if (result.Error == GameActions::Status::Ok) + if (result.Error == GameActions::Status::ok) { const auto actionResult = result.GetData(); if (!actionResult.StaffEntityId.IsNull()) diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index 9dbcdaa78d..fd59904cb6 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -192,7 +192,7 @@ GameActions::Result MapCanConstructWithClearAt( bool canBuildCrossing = false; if (MapIsEdge(pos)) { - res.Error = GameActions::Status::InvalidParameters; + res.Error = GameActions::Status::invalidParameters; res.ErrorMessage = STR_OFF_EDGE_OF_MAP; return res; } @@ -206,7 +206,7 @@ GameActions::Result MapCanConstructWithClearAt( TileElement* tileElement = MapGetFirstElementAt(pos); if (tileElement == nullptr) { - res.Error = GameActions::Status::Unknown; + res.Error = GameActions::Status::unknown; res.ErrorMessage = kStringIdNone; return res; } @@ -227,7 +227,7 @@ GameActions::Result MapCanConstructWithClearAt( } MapGetObstructionErrorText(tileElement, res); - res.Error = GameActions::Status::NoClearance; + res.Error = GameActions::Status::noClearance; return res; } } @@ -242,7 +242,7 @@ GameActions::Result MapCanConstructWithClearAt( { if (!clearFunc(&tileElement, pos, flags, &res.Cost)) { - res.Error = GameActions::Status::NoClearance; + res.Error = GameActions::Status::noClearance; res.ErrorMessage = STR_CANNOT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_WATER; return res; } @@ -255,7 +255,7 @@ GameActions::Result MapCanConstructWithClearAt( if (heightFromGround > (18 * kCoordsZStep)) { - res.Error = GameActions::Status::Disallowed; + res.Error = GameActions::Status::disallowed; res.ErrorMessage = STR_LOCAL_AUTHORITY_WONT_ALLOW_CONSTRUCTION_ABOVE_TREE_HEIGHT; return res; } @@ -298,7 +298,7 @@ GameActions::Result MapCanConstructWithClearAt( } MapGetObstructionErrorText(tileElement, res); - res.Error = GameActions::Status::NoClearance; + res.Error = GameActions::Status::noClearance; return res; } } diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 5e162a1a06..45f5f156e7 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -50,7 +50,7 @@ static money64 RideEntranceExitPlaceGhost( rideEntranceExitPlaceAction.SetFlags({ CommandFlag::allowDuringPaused, CommandFlag::ghost }); auto res = GameActions::Execute(&rideEntranceExitPlaceAction, getGameState()); - return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + return res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined; } /** diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 9048a28186..27f0ee30e8 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1444,7 +1444,7 @@ void ClearElementAt(const CoordsXY& loc, TileElement** elementPtr) auto parkEntranceRemoveAction = GameActions::ParkEntranceRemoveAction(CoordsXYZ{ seqLoc, element->GetBaseZ() }); auto result = GameActions::ExecuteNested(&parkEntranceRemoveAction, gameState); // If asking nicely did not work, forcibly remove this to avoid an infinite loop. - if (result.Error != GameActions::Status::Ok) + if (result.Error != GameActions::Status::ok) { TileElementRemove(element); } @@ -1456,7 +1456,7 @@ void ClearElementAt(const CoordsXY& loc, TileElement** elementPtr) auto wallRemoveAction = GameActions::WallRemoveAction(wallLocation); auto result = GameActions::ExecuteNested(&wallRemoveAction, gameState); // If asking nicely did not work, forcibly remove this to avoid an infinite loop. - if (result.Error != GameActions::Status::Ok) + if (result.Error != GameActions::Status::ok) { TileElementRemove(element); } @@ -1468,7 +1468,7 @@ void ClearElementAt(const CoordsXY& loc, TileElement** elementPtr) { loc.x, loc.y, element->GetBaseZ(), element->GetDirection() }, element->AsLargeScenery()->GetSequenceIndex()); auto result = GameActions::ExecuteNested(&removeSceneryAction, gameState); // If asking nicely did not work, forcibly remove this to avoid an infinite loop. - if (result.Error != GameActions::Status::Ok) + if (result.Error != GameActions::Status::ok) { TileElementRemove(element); } @@ -1480,7 +1480,7 @@ void ClearElementAt(const CoordsXY& loc, TileElement** elementPtr) { loc.x, loc.y, element->GetBaseZ(), element->AsBanner()->GetPosition() }); auto result = GameActions::ExecuteNested(&bannerRemoveAction, gameState); // If asking nicely did not work, forcibly remove this to avoid an infinite loop. - if (result.Error != GameActions::Status::Ok) + if (result.Error != GameActions::Status::ok) { TileElementRemove(element); } diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 7f7d5b568e..da32aec7f7 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -53,19 +53,19 @@ namespace OpenRCT2::TileInspector { LOG_ERROR("First element is out of range for the tile"); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); } if (secondElement == nullptr) { LOG_ERROR("Second element is out of range for the tile"); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); } if (firstElement == secondElement) { LOG_ERROR("Can't swap the element with itself"); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_CANT_SWAP_TILE_ELEMENT_WITH_ITSELF); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_CANT_SWAP_TILE_ELEMENT_WITH_ITSELF); } // Swap their memory @@ -145,7 +145,7 @@ namespace OpenRCT2::TileInspector TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -187,7 +187,7 @@ namespace OpenRCT2::TileInspector if (isExecuting) { auto res = SwapTileElements(loc, first, second); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { return res; } @@ -210,7 +210,7 @@ namespace OpenRCT2::TileInspector TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -289,7 +289,7 @@ namespace OpenRCT2::TileInspector TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); if (!isExecuting) { @@ -307,7 +307,7 @@ namespace OpenRCT2::TileInspector // Make sure there is enough space for the new element if (!MapCheckCapacityAndReorganise(loc)) { - return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_PASTE, STR_TILE_ELEMENT_LIMIT_REACHED); + return GameActions::Result(GameActions::Status::noFreeElements, STR_CANT_PASTE, STR_TILE_ELEMENT_LIMIT_REACHED); } auto tileLoc = TileCoordsXY(loc); @@ -322,7 +322,7 @@ namespace OpenRCT2::TileInspector if (newBanner == nullptr) { LOG_ERROR("No free banners available"); - return GameActions::Result(GameActions::Status::Unknown, STR_TOO_MANY_BANNERS_IN_GAME, kStringIdNone); + return GameActions::Result(GameActions::Status::unknown, STR_TOO_MANY_BANNERS_IN_GAME, kStringIdNone); } auto newId = newBanner->id; // Copy the banners style @@ -375,7 +375,7 @@ namespace OpenRCT2::TileInspector const TileElement* const firstElement = MapGetFirstElementAt(loc); if (firstElement == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); // Count elements on tile int32_t numElement = 0; @@ -400,7 +400,7 @@ namespace OpenRCT2::TileInspector && otherElement->ClearanceHeight > currentElement->ClearanceHeight))) { auto res = SwapTileElements(loc, currentId - 1, currentId); - if (res.Error != GameActions::Status::Ok) + if (res.Error != GameActions::Status::ok) { // don't return error here, we've already ran some actions // and moved things as far as we could, the only sensible @@ -430,19 +430,19 @@ namespace OpenRCT2::TileInspector int16_t newClearanceHeight = static_cast(tileElement->ClearanceHeight + heightOffset); if (newBaseHeight < 0) { - return GameActions::Result(GameActions::Status::TooLow, STR_CANT_LOWER_ELEMENT_HERE, STR_TOO_LOW); + return GameActions::Result(GameActions::Status::tooLow, STR_CANT_LOWER_ELEMENT_HERE, STR_TOO_LOW); } if (newBaseHeight > kMaxTileElementHeight) { - return GameActions::Result(GameActions::Status::TooHigh, STR_CANT_RAISE_ELEMENT_HERE, STR_TOO_HIGH); + return GameActions::Result(GameActions::Status::tooHigh, STR_CANT_RAISE_ELEMENT_HERE, STR_TOO_HIGH); } if (newClearanceHeight < 0) { - return GameActions::Result(GameActions::Status::NoClearance, STR_CANT_LOWER_ELEMENT_HERE, STR_NO_CLEARANCE); + return GameActions::Result(GameActions::Status::noClearance, STR_CANT_LOWER_ELEMENT_HERE, STR_NO_CLEARANCE); } if (newClearanceHeight > kMaxTileElementHeight) { - return GameActions::Result(GameActions::Status::NoClearance, STR_CANT_RAISE_ELEMENT_HERE, STR_NO_CLEARANCE); + return GameActions::Result(GameActions::Status::noClearance, STR_CANT_RAISE_ELEMENT_HERE, STR_NO_CLEARANCE); } return GameActions::Result(); } @@ -452,10 +452,10 @@ namespace OpenRCT2::TileInspector TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); auto heightValidationResult = ValidateTileHeight(tileElement, heightOffset); - if (heightValidationResult.Error != GameActions::Status::Ok) + if (heightValidationResult.Error != GameActions::Status::ok) return heightValidationResult; if (isExecuting) @@ -498,7 +498,7 @@ namespace OpenRCT2::TileInspector // No surface element on tile if (surfaceelement == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -518,7 +518,7 @@ namespace OpenRCT2::TileInspector // No surface element on tile if (surfaceElement == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -565,7 +565,7 @@ namespace OpenRCT2::TileInspector // No surface element on tile if (surfaceElement == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -581,7 +581,7 @@ namespace OpenRCT2::TileInspector TileElement* const pathElement = MapGetNthElementAt(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TileElementType::Path) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_PATH_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_PATH_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -597,7 +597,7 @@ namespace OpenRCT2::TileInspector TileElement* const pathElement = MapGetNthElementAt(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TileElementType::Path) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_PATH_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_PATH_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -612,7 +612,7 @@ namespace OpenRCT2::TileInspector TileElement* const pathElement = MapGetNthElementAt(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TileElementType::Path) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_PATH_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_PATH_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -627,7 +627,7 @@ namespace OpenRCT2::TileInspector TileElement* const pathElement = MapGetNthElementAt(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TileElementType::Path) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_PATH_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_PATH_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -643,12 +643,12 @@ namespace OpenRCT2::TileInspector TileElement* const entranceElement = MapGetNthElementAt(loc, elementIndex); if (entranceElement == nullptr || entranceElement->GetType() != TileElementType::Entrance) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND); auto ride = GetRide(entranceElement->AsEntrance()->GetRideIndex()); if (ride == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); if (isExecuting) { @@ -674,7 +674,7 @@ namespace OpenRCT2::TileInspector TileElement* const wallElement = MapGetNthElementAt(loc, elementIndex); if (wallElement == nullptr || wallElement->GetType() != TileElementType::Wall) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_WALL_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_WALL_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -691,7 +691,7 @@ namespace OpenRCT2::TileInspector TileElement* const wallElement = MapGetNthElementAt(loc, elementIndex); if (wallElement == nullptr || wallElement->GetType() != TileElementType::Wall) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_WALL_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_WALL_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -712,7 +712,7 @@ namespace OpenRCT2::TileInspector TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -725,13 +725,13 @@ namespace OpenRCT2::TileInspector auto ride = GetRide(rideIndex); if (ride == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); const auto& ted = GetTrackElementDescriptor(type); auto sequenceIndex = trackElement->AsTrack()->GetSequenceIndex(); if (sequenceIndex >= ted.numSequences) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_BLOCK_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_BLOCK_NOT_FOUND); const auto& trackBlock = ted.sequences[sequenceIndex].clearance; uint8_t originDirection = trackElement->GetDirection(); @@ -756,7 +756,7 @@ namespace OpenRCT2::TileInspector { LOG_ERROR("Track map element part not found!"); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); } // track_remove returns here on failure, not sure when this would ever be hit. Only thing I can think of is @@ -783,7 +783,7 @@ namespace OpenRCT2::TileInspector TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -807,13 +807,13 @@ namespace OpenRCT2::TileInspector auto ride = GetRide(rideIndex); if (ride == nullptr) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); const auto& ted = GetTrackElementDescriptor(type); auto sequenceIndex = trackElement->AsTrack()->GetSequenceIndex(); if (sequenceIndex >= ted.numSequences) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_BLOCK_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_BLOCK_NOT_FOUND); const auto& trackBlock = ted.sequences[sequenceIndex].clearance; uint8_t originDirection = trackElement->GetDirection(); @@ -838,7 +838,7 @@ namespace OpenRCT2::TileInspector { LOG_ERROR("Track map element part not found!"); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); } // track_remove returns here on failure, not sure when this would ever be hit. Only thing I can think of is @@ -863,7 +863,7 @@ namespace OpenRCT2::TileInspector TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -879,7 +879,7 @@ namespace OpenRCT2::TileInspector TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -895,7 +895,7 @@ namespace OpenRCT2::TileInspector TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr || tileElement->GetType() != TileElementType::SmallScenery) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -915,7 +915,7 @@ namespace OpenRCT2::TileInspector TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr || tileElement->GetType() != TileElementType::SmallScenery) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -932,7 +932,7 @@ namespace OpenRCT2::TileInspector TileElement* const bannerElement = MapGetNthElementAt(loc, elementIndex); if (bannerElement == nullptr || bannerElement->GetType() != TileElementType::Banner) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); if (isExecuting) { @@ -949,7 +949,7 @@ namespace OpenRCT2::TileInspector TileElement* const wallElement = MapGetNthElementAt(loc, elementIndex); if (wallElement == nullptr || wallElement->GetType() != TileElementType::Wall) return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_WALL_ELEMENT_NOT_FOUND); + GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_WALL_ELEMENT_NOT_FOUND); if (isExecuting) {