1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Rename MapChangeSizeAction to fit naming pattern

This commit is contained in:
Stephan Spengler
2023-01-02 13:52:38 +01:00
committed by Gymnasiast
parent c5805eaae6
commit 32dd535044
10 changed files with 29 additions and 29 deletions

View File

@@ -8,7 +8,7 @@
- Improved: [#18826] [Plugin] Added all actions and their documentation to plugin API.
- Improved: [#18945] Languages can now fall back to other languages than English.
- Improved: [#18970] Trying to load a non-park save will now display a context error.
- Improved: [#19018] Renamed park entrance and peep spawn place actions to fit the naming scheme.
- Improved: [#19018] Renamed actions to fit the naming scheme.
- Improved: [#19044] Added special thanks to RMC and Wiegand to the About page.
- Fix: [#18467] “Selected only” Object Selection filter is active in Track Designs Manager, and cannot be toggled.
- Fix: [#18905] Ride Construction window theme is not applied correctly.

View File

@@ -285,7 +285,6 @@ declare global {
queryAction(action: "bannersetcolour", args: BannerSetColourArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "bannersetname", args: BannerSetNameArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "bannersetstyle", args: BannerSetStyleArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "changemapsize", args: ChangeMapSizeArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "clearscenery", args: ClearSceneryArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "climateset", args: ClimateSetArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "footpathadditionplace", args: FootpathAdditionPlaceArgs, callback?: (result: GameActionResult) => void): void;
@@ -305,6 +304,7 @@ declare global {
queryAction(action: "largesceneryremove", args: LargeSceneryRemoveArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "largescenerysetcolour", args: LargeScenerySetColourArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "loadorquit", args: LoadOrQuitArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "mapchangesize", args: MapChangeSizeArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "mazeplacetrack", args: MazePlaceTrackArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "mazesettrack", args: MazeSetTrackArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "networkmodifygroup", args: NetworkModifyGroupArgs, callback?: (result: GameActionResult) => void): void;
@@ -729,11 +729,6 @@ declare global {
parameter: number; // primary colour | secondary colour | 0: disable, 1: enable
}
interface ChangeMapSizeArgs extends GameActionArgs {
targetSizeX: number;
targetSizeY: number;
}
interface ClearSceneryArgs extends GameActionArgs {
itemsToClear: number; // Bit mask. 1: small scenery and walls, 2: large scenery, 4: footpaths.
}
@@ -891,6 +886,11 @@ declare global {
savePromptMode: number; // 0: save before load, 1: save before quit. Only used if mode = 0 (open save prompt).
}
interface MapChangeSizeArgs extends GameActionArgs {
targetSizeX: number;
targetSizeY: number;
}
interface MazePlaceTrackArgs extends GameActionArgs {
x: number;
y: number;

View File

@@ -17,8 +17,8 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/OpenRCT2.h>
#include <openrct2/actions/ChangeMapSizeAction.h>
#include <openrct2/actions/LandSetRightsAction.h>
#include <openrct2/actions/MapChangeSizeAction.h>
#include <openrct2/actions/ParkEntrancePlaceAction.h>
#include <openrct2/actions/PeepSpawnPlaceAction.h>
#include <openrct2/actions/SurfaceSetStyleAction.h>
@@ -630,8 +630,8 @@ public:
if (_resizeDirection != ResizeDirection::Y)
newMapSize.x = size;
auto changeMapSizeAction = ChangeMapSizeAction(newMapSize);
GameActions::Execute(&changeMapSizeAction);
auto mapChangeSizeAction = MapChangeSizeAction(newMapSize);
GameActions::Execute(&mapChangeSizeAction);
Invalidate();
}
break;
@@ -978,7 +978,7 @@ private:
if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::X)
newMapSize.x++;
auto increaseMapSizeAction = ChangeMapSizeAction(newMapSize);
auto increaseMapSizeAction = MapChangeSizeAction(newMapSize);
GameActions::Execute(&increaseMapSizeAction);
}
@@ -990,7 +990,7 @@ private:
if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::X)
newMapSize.x--;
auto decreaseMapSizeAction = ChangeMapSizeAction(newMapSize);
auto decreaseMapSizeAction = MapChangeSizeAction(newMapSize);
GameActions::Execute(&decreaseMapSizeAction);
}

View File

@@ -101,7 +101,7 @@ enum class GameCommand : int32_t
GuestSetFlags, // GA
SetDate, // GA
Custom, // GA
ChangeMapSize,
MapChangeSize,
FreezeRideRating,
Count,
};

View File

@@ -13,7 +13,6 @@
#include "BannerSetColourAction.h"
#include "BannerSetNameAction.h"
#include "BannerSetStyleAction.h"
#include "ChangeMapSizeAction.h"
#include "ClearAction.h"
#include "ClimateSetAction.h"
#include "CustomAction.h"
@@ -35,6 +34,7 @@
#include "LargeSceneryRemoveAction.h"
#include "LargeScenerySetColourAction.h"
#include "LoadOrQuitAction.h"
#include "MapChangeSizeAction.h"
#include "MazePlaceTrackAction.h"
#include "MazeSetTrackAction.h"
#include "NetworkModifyGroupAction.h"
@@ -205,7 +205,7 @@ namespace GameActions
REGISTER_ACTION(GuestSetFlagsAction);
REGISTER_ACTION(ParkSetDateAction);
REGISTER_ACTION(SetCheatAction);
REGISTER_ACTION(ChangeMapSizeAction);
REGISTER_ACTION(MapChangeSizeAction);
#ifdef ENABLE_SCRIPTING
REGISTER_ACTION(CustomAction);
#endif

View File

@@ -7,7 +7,7 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "ChangeMapSizeAction.h"
#include "MapChangeSizeAction.h"
#include "../Context.h"
#include "../drawing/IDrawingEngine.h"
@@ -16,23 +16,23 @@
#include "../windows/Intent.h"
#include "../world/Park.h"
ChangeMapSizeAction::ChangeMapSizeAction(const TileCoordsXY& targetSize)
MapChangeSizeAction::MapChangeSizeAction(const TileCoordsXY& targetSize)
: _targetSize(targetSize)
{
}
uint16_t ChangeMapSizeAction::GetActionFlags() const
uint16_t MapChangeSizeAction::GetActionFlags() const
{
return GameAction::GetActionFlags() | GameActions::Flags::AllowWhilePaused;
}
void ChangeMapSizeAction::Serialise(DataSerialiser& stream)
void MapChangeSizeAction::Serialise(DataSerialiser& stream)
{
GameAction::Serialise(stream);
stream << DS_TAG(_targetSize);
}
GameActions::Result ChangeMapSizeAction::Query() const
GameActions::Result MapChangeSizeAction::Query() const
{
if (_targetSize.x > MAXIMUM_MAP_SIZE_TECHNICAL || _targetSize.y > MAXIMUM_MAP_SIZE_TECHNICAL)
{
@@ -45,7 +45,7 @@ GameActions::Result ChangeMapSizeAction::Query() const
return GameActions::Result();
}
GameActions::Result ChangeMapSizeAction::Execute() const
GameActions::Result MapChangeSizeAction::Execute() const
{
// Expand map
while (_targetSize.x > gMapSize.x)
@@ -76,7 +76,7 @@ GameActions::Result ChangeMapSizeAction::Execute() const
return GameActions::Result();
}
void ChangeMapSizeAction::AcceptParameters(GameActionParameterVisitor& visitor)
void MapChangeSizeAction::AcceptParameters(GameActionParameterVisitor& visitor)
{
visitor.Visit("targetSizeX", _targetSize.x);
visitor.Visit("targetSizeY", _targetSize.y);

View File

@@ -12,11 +12,11 @@
#include "../world/Map.h"
#include "GameAction.h"
class ChangeMapSizeAction final : public GameActionBase<GameCommand::ChangeMapSize>
class MapChangeSizeAction final : public GameActionBase<GameCommand::MapChangeSize>
{
public:
ChangeMapSizeAction() = default;
ChangeMapSizeAction(const TileCoordsXY& targetSize);
MapChangeSizeAction() = default;
MapChangeSizeAction(const TileCoordsXY& targetSize);
void AcceptParameters(GameActionParameterVisitor& visitor) override;
uint16_t GetActionFlags() const override;

View File

@@ -67,7 +67,6 @@
<ClInclude Include="actions\BannerSetColourAction.h" />
<ClInclude Include="actions\BannerSetNameAction.h" />
<ClInclude Include="actions\BannerSetStyleAction.h" />
<ClInclude Include="actions\ChangeMapSizeAction.h" />
<ClInclude Include="actions\ClearAction.h" />
<ClInclude Include="actions\ClimateSetAction.h" />
<ClInclude Include="actions\CustomAction.h" />
@@ -90,6 +89,7 @@
<ClInclude Include="actions\LargeSceneryRemoveAction.h" />
<ClInclude Include="actions\LargeScenerySetColourAction.h" />
<ClInclude Include="actions\LoadOrQuitAction.h" />
<ClInclude Include="actions\MapChangeSizeAction.h" />
<ClInclude Include="actions\MazePlaceTrackAction.h" />
<ClInclude Include="actions\MazeSetTrackAction.h" />
<ClInclude Include="actions\NetworkModifyGroupAction.h" />
@@ -567,7 +567,6 @@
<ClCompile Include="actions\BannerSetColourAction.cpp" />
<ClCompile Include="actions\BannerSetNameAction.cpp" />
<ClCompile Include="actions\BannerSetStyleAction.cpp" />
<ClCompile Include="actions\ChangeMapSizeAction.cpp" />
<ClCompile Include="actions\ClearAction.cpp" />
<ClCompile Include="actions\ClimateSetAction.cpp" />
<ClCompile Include="actions\CustomAction.cpp" />
@@ -591,6 +590,7 @@
<ClCompile Include="actions\LargeSceneryRemoveAction.cpp" />
<ClCompile Include="actions\LargeScenerySetColourAction.cpp" />
<ClCompile Include="actions\LoadOrQuitAction.cpp" />
<ClCompile Include="actions\MapChangeSizeAction.cpp" />
<ClCompile Include="actions\MazePlaceTrackAction.cpp" />
<ClCompile Include="actions\MazeSetTrackAction.cpp" />
<ClCompile Include="actions\NetworkModifyGroupAction.cpp" />

View File

@@ -198,7 +198,7 @@ const std::array<NetworkAction, static_cast<size_t>(NetworkPermission::Count)> N
GameCommand::PlaceParkEntrance,
GameCommand::RemoveParkEntrance,
GameCommand::PlacePeepSpawn,
GameCommand::ChangeMapSize,
GameCommand::MapChangeSize,
},
},
NetworkAction{

View File

@@ -1271,7 +1271,6 @@ const static EnumMap<GameCommand> ActionNameToType = {
{ "bannersetcolour", GameCommand::SetBannerColour },
{ "bannersetname", GameCommand::SetBannerName },
{ "bannersetstyle", GameCommand::SetBannerStyle },
{ "changemapsize", GameCommand::ChangeMapSize },
{ "clearscenery", GameCommand::ClearScenery },
{ "climateset", GameCommand::SetClimate },
{ "footpathplace", GameCommand::PlacePath },
@@ -1291,6 +1290,7 @@ const static EnumMap<GameCommand> ActionNameToType = {
{ "largesceneryremove", GameCommand::RemoveLargeScenery },
{ "largescenerysetcolour", GameCommand::SetLargeSceneryColour },
{ "loadorquit", GameCommand::LoadOrQuit },
{ "mapChangeSize", GameCommand::MapChangeSize },
{ "mazeplacetrack", GameCommand::PlaceMazeDesign },
{ "mazesettrack", GameCommand::SetMazeTrack },
{ "networkmodifygroup", GameCommand::ModifyGroups },