From c2d309af3828d7cf0f61f2afa16cdd9f8d96a68b Mon Sep 17 00:00:00 2001 From: Sadret Date: Tue, 3 Nov 2020 09:17:29 +0100 Subject: [PATCH] Close #13346: Change FootpathScenery to FootpathAddition (#13350) --- distribution/changelog.txt | 1 + distribution/openrct2.d.ts | 6 +++--- .../interface/ViewportInteraction.cpp | 6 +++--- src/openrct2-ui/windows/TopToolbar.cpp | 16 ++++++++-------- src/openrct2/Game.h | 4 ++-- ...ction.hpp => FootpathAdditionPlaceAction.hpp} | 6 +++--- ...tion.hpp => FootpathAdditionRemoveAction.hpp} | 6 +++--- src/openrct2/actions/GameActionRegistration.cpp | 8 ++++---- src/openrct2/libopenrct2.vcxproj | 4 ++-- src/openrct2/network/NetworkAction.cpp | 4 ++-- src/openrct2/scripting/ScriptEngine.cpp | 6 +++--- src/openrct2/world/Scenery.cpp | 8 ++++---- 12 files changed, 38 insertions(+), 37 deletions(-) rename src/openrct2/actions/{FootpathSceneryPlaceAction.hpp => FootpathAdditionPlaceAction.hpp} (96%) rename src/openrct2/actions/{FootpathSceneryRemoveAction.hpp => FootpathAdditionRemoveAction.hpp} (94%) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 123c3774f1..d3437faccd 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.3.2+ (in development) ------------------------------------------------------------------------ +- Change: [#13346] Change FootpathScenery to FootpathAddition in all occurrences - Fix: [#13334] Uninitialised variables in CustomTabDesc - Fix: [#13342] Rename tabChange to onTabChange in WindowDesc interface diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 3bb3eb9946..c10b2e7593 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -324,9 +324,9 @@ declare global { "climateset" | "footpathplace" | "footpathplacefromtrack" | - "foothpathremove" | - "footpathsceneryplace" | - "footpathsceneryremove" | + "footpathremove" | + "footpathadditionplace" | + "footpathadditionremove" | "guestsetflags" | "guestsetname" | "landbuyrights" | diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 7cd7bcddf1..d71e9809b6 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -615,8 +615,8 @@ static void viewport_interaction_remove_footpath(TileElement* tileElement, const */ static void viewport_interaction_remove_footpath_item(TileElement* tileElement, const CoordsXY& mapCoords) { - auto footpathSceneryRemoveAction = FootpathSceneryRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() }); - GameActions::Execute(&footpathSceneryRemoveAction); + auto footpathAdditionRemoveAction = FootpathAdditionRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() }); + GameActions::Execute(&footpathAdditionRemoveAction); } /** diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 4c34a83a59..88b9cb58b4 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -1866,16 +1866,16 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos if (gridPos.isNull()) return; - auto footpathSceneryPlaceAction = FootpathSceneryPlaceAction({ gridPos, z }, selectedScenery + 1); + auto footpathAdditionPlaceAction = FootpathAdditionPlaceAction({ gridPos, z }, selectedScenery + 1); - footpathSceneryPlaceAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { + footpathAdditionPlaceAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) { return; } OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); }); - auto res = GameActions::Execute(&footpathSceneryPlaceAction); + auto res = GameActions::Execute(&footpathAdditionPlaceAction); break; } case SCENERY_TYPE_WALL: @@ -2526,9 +2526,9 @@ static money32 try_place_ghost_scenery( // Path Bits // 6e265b int32_t z = (parameter_2 & 0xFF) * COORDS_Z_STEP; - auto footpathSceneryPlaceAction = FootpathSceneryPlaceAction({ map_tile.x, map_tile.y, z }, entryIndex + 1); - footpathSceneryPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); - footpathSceneryPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + auto footpathAdditionPlaceAction = FootpathAdditionPlaceAction({ map_tile.x, map_tile.y, z }, entryIndex + 1); + footpathAdditionPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); + footpathAdditionPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) { return; @@ -2536,7 +2536,7 @@ static money32 try_place_ghost_scenery( gSceneryGhostPosition = { map_tile, static_cast((parameter_2 & 0xFF) * COORDS_Z_STEP) }; gSceneryGhostType |= SCENERY_GHOST_FLAG_1; }); - auto res = GameActions::Execute(&footpathSceneryPlaceAction); + auto res = GameActions::Execute(&footpathAdditionPlaceAction); if (res->Error != GameActions::Status::Ok) return MONEY32_UNDEFINED; diff --git a/src/openrct2/Game.h b/src/openrct2/Game.h index 16f56db855..7bac76329d 100644 --- a/src/openrct2/Game.h +++ b/src/openrct2/Game.h @@ -94,8 +94,8 @@ enum GAME_COMMAND GAME_COMMAND_SET_CLIMATE, // GA GAME_COMMAND_SET_COLOUR_SCHEME, // GA GAME_COMMAND_SET_STAFF_COSTUME, // GA - GAME_COMMAND_PLACE_FOOTPATH_SCENERY, // GA - GAME_COMMAND_REMOVE_FOOTPATH_SCENERY, // GA + GAME_COMMAND_PLACE_FOOTPATH_ADDITION, // GA + GAME_COMMAND_REMOVE_FOOTPATH_ADDITION, // GA GAME_COMMAND_GUEST_SET_FLAGS, // GA GAME_COMMAND_SET_DATE, // GA GAME_COMMAND_CUSTOM, // GA diff --git a/src/openrct2/actions/FootpathSceneryPlaceAction.hpp b/src/openrct2/actions/FootpathAdditionPlaceAction.hpp similarity index 96% rename from src/openrct2/actions/FootpathSceneryPlaceAction.hpp rename to src/openrct2/actions/FootpathAdditionPlaceAction.hpp index 3138a5cee3..c5c2affc97 100644 --- a/src/openrct2/actions/FootpathSceneryPlaceAction.hpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.hpp @@ -22,15 +22,15 @@ #include "../world/Wall.h" #include "GameAction.h" -DEFINE_GAME_ACTION(FootpathSceneryPlaceAction, GAME_COMMAND_PLACE_FOOTPATH_SCENERY, GameActions::Result) +DEFINE_GAME_ACTION(FootpathAdditionPlaceAction, GAME_COMMAND_PLACE_FOOTPATH_ADDITION, GameActions::Result) { private: CoordsXYZ _loc; ObjectEntryIndex _pathItemType{}; public: - FootpathSceneryPlaceAction() = default; - FootpathSceneryPlaceAction(const CoordsXYZ& loc, ObjectEntryIndex pathItemType) + FootpathAdditionPlaceAction() = default; + FootpathAdditionPlaceAction(const CoordsXYZ& loc, ObjectEntryIndex pathItemType) : _loc(loc) , _pathItemType(pathItemType) { diff --git a/src/openrct2/actions/FootpathSceneryRemoveAction.hpp b/src/openrct2/actions/FootpathAdditionRemoveAction.hpp similarity index 94% rename from src/openrct2/actions/FootpathSceneryRemoveAction.hpp rename to src/openrct2/actions/FootpathAdditionRemoveAction.hpp index 134122caed..889f1867f9 100644 --- a/src/openrct2/actions/FootpathSceneryRemoveAction.hpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.hpp @@ -21,15 +21,15 @@ #include "../world/Wall.h" #include "GameAction.h" -DEFINE_GAME_ACTION(FootpathSceneryRemoveAction, GAME_COMMAND_REMOVE_FOOTPATH_SCENERY, GameActions::Result) +DEFINE_GAME_ACTION(FootpathAdditionRemoveAction, GAME_COMMAND_REMOVE_FOOTPATH_ADDITION, GameActions::Result) { private: CoordsXYZ _loc; public: - FootpathSceneryRemoveAction() = default; + FootpathAdditionRemoveAction() = default; - FootpathSceneryRemoveAction(const CoordsXYZ& loc) + FootpathAdditionRemoveAction(const CoordsXYZ& loc) : _loc(loc) { } diff --git a/src/openrct2/actions/GameActionRegistration.cpp b/src/openrct2/actions/GameActionRegistration.cpp index 08a2e95615..e50c84153d 100644 --- a/src/openrct2/actions/GameActionRegistration.cpp +++ b/src/openrct2/actions/GameActionRegistration.cpp @@ -16,11 +16,11 @@ #include "ClearAction.hpp" #include "ClimateSetAction.hpp" #include "CustomAction.hpp" +#include "FootpathAdditionPlaceAction.hpp" +#include "FootpathAdditionRemoveAction.hpp" #include "FootpathPlaceAction.hpp" #include "FootpathPlaceFromTrackAction.hpp" #include "FootpathRemoveAction.hpp" -#include "FootpathSceneryPlaceAction.hpp" -#include "FootpathSceneryRemoveAction.hpp" #include "GameAction.h" #include "GuestSetFlagsAction.hpp" #include "GuestSetNameAction.hpp" @@ -103,8 +103,8 @@ namespace GameActions Register(); Register(); Register(); - Register(); - Register(); + Register(); + Register(); Register(); Register(); Register(); diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 71ab99f4d3..03a7ffb23e 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -65,8 +65,8 @@ - - + + diff --git a/src/openrct2/network/NetworkAction.cpp b/src/openrct2/network/NetworkAction.cpp index 9016dae55c..f09e137dff 100644 --- a/src/openrct2/network/NetworkAction.cpp +++ b/src/openrct2/network/NetworkAction.cpp @@ -153,8 +153,8 @@ const std::array(NetworkPermission::Count)> N GAME_COMMAND_PLACE_PATH, GAME_COMMAND_PLACE_PATH_FROM_TRACK, GAME_COMMAND_REMOVE_PATH, - GAME_COMMAND_PLACE_FOOTPATH_SCENERY, - GAME_COMMAND_REMOVE_FOOTPATH_SCENERY, + GAME_COMMAND_PLACE_FOOTPATH_ADDITION, + GAME_COMMAND_REMOVE_FOOTPATH_ADDITION, }, }, NetworkAction{ diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 51403c51a7..05eb3bb682 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -43,7 +43,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::Scripting; -static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 7; +static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 8; struct ExpressionStringifier final { @@ -963,8 +963,8 @@ const static std::unordered_map ActionNameToType = { { "footpathplace", GAME_COMMAND_PLACE_PATH }, { "footpathplacefromtrack", GAME_COMMAND_PLACE_PATH_FROM_TRACK }, { "footpathremove", GAME_COMMAND_REMOVE_PATH }, - { "footpathsceneryplace", GAME_COMMAND_PLACE_FOOTPATH_SCENERY }, - { "footpathsceneryremove", GAME_COMMAND_REMOVE_FOOTPATH_SCENERY }, + { "footpathadditionplace", GAME_COMMAND_PLACE_FOOTPATH_ADDITION }, + { "footpathadditionremove", GAME_COMMAND_REMOVE_FOOTPATH_ADDITION }, { "guestsetflags", GAME_COMMAND_GUEST_SET_FLAGS }, { "guestsetname", GAME_COMMAND_SET_GUEST_NAME }, { "landbuyrights", GAME_COMMAND_BUY_LAND_RIGHTS }, diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index e79811c886..5a928895d7 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -13,7 +13,7 @@ #include "../Context.h" #include "../Game.h" #include "../actions/BannerRemoveAction.hpp" -#include "../actions/FootpathSceneryRemoveAction.hpp" +#include "../actions/FootpathAdditionRemoveAction.hpp" #include "../actions/LargeSceneryRemoveAction.hpp" #include "../actions/SmallSceneryRemoveAction.hpp" #include "../actions/WallRemoveAction.hpp" @@ -190,9 +190,9 @@ void scenery_remove_ghost_tool_placement() if (tileElement->GetBaseZ() != gSceneryGhostPosition.z) continue; - auto footpathSceneryRemoveAction = FootpathSceneryRemoveAction(gSceneryGhostPosition); - footpathSceneryRemoveAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_GHOST); - GameActions::Execute(&footpathSceneryRemoveAction); + auto footpathAdditionRemoveAction = FootpathAdditionRemoveAction(gSceneryGhostPosition); + footpathAdditionRemoveAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_GHOST); + GameActions::Execute(&footpathAdditionRemoveAction); break; } while (!(tileElement++)->IsLastForTile()); }