Rename ParkSetEntranceFee to fit naming pattern

This commit is contained in:
Stephan Spengler 2023-01-02 14:42:28 +01:00 committed by Gymnasiast
parent f8ab17749d
commit bfcf66a8f7
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
12 changed files with 33 additions and 33 deletions

View File

@ -8,8 +8,8 @@
- 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 actions to fit the naming scheme.
- Improved: [#19044] Added special thanks to RMC and Wiegand to the About page.
- Change: [#19018] Renamed actions to fit the naming scheme.
- 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.
- Fix: [#18911] Mini Golf station does not draw correctly from all angles.

View File

@ -313,6 +313,7 @@ declare global {
queryAction(action: "parkentranceremove", args: ParkEntranceRemoveArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "parkmarketing", args: ParkMarketingArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "parksetdate", args: ParkSetDateArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "parksetentrancefee", args: ParkSetEntranceFeeArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "parksetloan", args: ParkSetLoanArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "parksetname", args: ParkSetNameArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "parksetparameter", args: ParkSetParameterArgs, callback?: (result: GameActionResult) => void): void;
@ -335,7 +336,6 @@ declare global {
queryAction(action: "ridesetstatus", args: RideSetStatusArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "ridesetvehicle", args: RideSetVehicleArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "scenariosetsetting", args: ScenarioSetSettingArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "setparkentrancefee", args: SetParkEntranceFeeArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "signsetname", args: SignSetNameArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "signsetstyle", args: SignSetStyleArgs, callback?: (result: GameActionResult) => void): void;
queryAction(action: "smallsceneryplace", args: SmallSceneryPlaceArgs, callback?: (result: GameActionResult) => void): void;
@ -404,6 +404,7 @@ declare global {
executeAction(action: "parkentranceremove", args: ParkEntranceRemoveArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "parkmarketing", args: ParkMarketingArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "parksetdate", args: ParkSetDateArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "parksetentrancefee", args: ParkSetEntranceFeeArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "parksetloan", args: ParkSetLoanArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "parksetname", args: ParkSetNameArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "parksetparameter", args: ParkSetParameterArgs, callback?: (result: GameActionResult) => void): void;
@ -426,7 +427,6 @@ declare global {
executeAction(action: "ridesetstatus", args: RideSetStatusArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "ridesetvehicle", args: RideSetVehicleArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "scenariosetsetting", args: ScenarioSetSettingArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "setparkentrancefee", args: SetParkEntranceFeeArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "signsetname", args: SignSetNameArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "signsetstyle", args: SignSetStyleArgs, callback?: (result: GameActionResult) => void): void;
executeAction(action: "smallsceneryplace", args: SmallSceneryPlaceArgs, callback?: (result: GameActionResult) => void): void;
@ -637,6 +637,7 @@ declare global {
"parkentranceremove" |
"parkmarketing" |
"parksetdate" |
"parksetentrancefee" |
"parksetloan" |
"parksetname" |
"parksetparameter" |
@ -659,7 +660,6 @@ declare global {
"ridesetstatus" |
"ridesetvehicle" |
"scenariosetsetting" |
"setparkentrancefee" |
"signsetname" |
"signsetstyle" |
"smallsceneryplace" |
@ -949,6 +949,10 @@ declare global {
day: number;
}
interface ParkSetEntranceFeeArgs extends GameActionArgs {
value: number;
}
interface ParkSetLoanArgs extends GameActionArgs {
value: number;
}
@ -1086,10 +1090,6 @@ declare global {
value: number;
}
interface SetParkEntranceFeeArgs extends GameActionArgs {
value: number;
}
interface SignSetNameArgs extends GameActionArgs {
id: number;
name: string;

View File

@ -22,8 +22,8 @@
#include <openrct2/Game.h>
#include <openrct2/GameState.h>
#include <openrct2/Input.h>
#include <openrct2/actions/ParkSetEntranceFeeAction.h>
#include <openrct2/actions/ParkSetNameAction.h>
#include <openrct2/actions/SetParkEntranceFeeAction.h>
#include <openrct2/config/Config.h>
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Formatter.h>
@ -828,14 +828,14 @@ private:
case WIDX_INCREASE_PRICE:
{
const auto newFee = std::min(MAX_ENTRANCE_FEE, gParkEntranceFee + 1.00_GBP);
auto gameAction = SetParkEntranceFeeAction(static_cast<money16>(newFee));
auto gameAction = ParkSetEntranceFeeAction(static_cast<money16>(newFee));
GameActions::Execute(&gameAction);
break;
}
case WIDX_DECREASE_PRICE:
{
const auto newFee = std::max(0.00_GBP, gParkEntranceFee - 1.00_GBP);
auto gameAction = SetParkEntranceFeeAction(static_cast<money16>(newFee));
auto gameAction = ParkSetEntranceFeeAction(static_cast<money16>(newFee));
GameActions::Execute(&gameAction);
break;
}

View File

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

View File

@ -43,6 +43,7 @@
#include "ParkEntranceRemoveAction.h"
#include "ParkMarketingAction.h"
#include "ParkSetDateAction.h"
#include "ParkSetEntranceFeeAction.h"
#include "ParkSetLoanAction.h"
#include "ParkSetNameAction.h"
#include "ParkSetParameterAction.h"
@ -65,7 +66,6 @@
#include "RideSetStatusAction.h"
#include "RideSetVehicleAction.h"
#include "ScenarioSetSettingAction.h"
#include "SetParkEntranceFeeAction.h"
#include "SignSetNameAction.h"
#include "SignSetStyleAction.h"
#include "SmallSceneryPlaceAction.h"
@ -165,7 +165,7 @@ namespace GameActions
REGISTER_ACTION(RideSetVehicleAction);
REGISTER_ACTION(RideSetSettingAction);
REGISTER_ACTION(ScenarioSetSettingAction);
REGISTER_ACTION(SetParkEntranceFeeAction);
REGISTER_ACTION(ParkSetEntranceFeeAction);
REGISTER_ACTION(SignSetNameAction);
REGISTER_ACTION(SignSetStyleAction);
REGISTER_ACTION(StaffFireAction);

View File

@ -12,7 +12,7 @@
#include "../world/Map.h"
#include "GameAction.h"
class MapChangeSizeAction final : public GameActionBase<GameCommand::MapChangeSize>
class MapChangeSizeAction final : public GameActionBase<GameCommand::ChangeMapSize>
{
public:
MapChangeSizeAction() = default;

View File

@ -7,7 +7,7 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "SetParkEntranceFeeAction.h"
#include "ParkSetEntranceFeeAction.h"
#include "../Cheats.h"
#include "../core/MemoryStream.h"
@ -15,29 +15,29 @@
#include "../localisation/StringIds.h"
#include "../world/Park.h"
SetParkEntranceFeeAction::SetParkEntranceFeeAction(money16 fee)
ParkSetEntranceFeeAction::ParkSetEntranceFeeAction(money16 fee)
: _fee(fee)
{
}
void SetParkEntranceFeeAction::AcceptParameters(GameActionParameterVisitor& visitor)
void ParkSetEntranceFeeAction::AcceptParameters(GameActionParameterVisitor& visitor)
{
visitor.Visit("value", _fee);
}
uint16_t SetParkEntranceFeeAction::GetActionFlags() const
uint16_t ParkSetEntranceFeeAction::GetActionFlags() const
{
return GameAction::GetActionFlags() | GameActions::Flags::AllowWhilePaused;
}
void SetParkEntranceFeeAction::Serialise(DataSerialiser& stream)
void ParkSetEntranceFeeAction::Serialise(DataSerialiser& stream)
{
GameAction::Serialise(stream);
stream << DS_TAG(_fee);
}
GameActions::Result SetParkEntranceFeeAction::Query() const
GameActions::Result ParkSetEntranceFeeAction::Query() const
{
bool noMoney = (gParkFlags & PARK_FLAGS_NO_MONEY) != 0;
bool forceFreeEntry = !ParkEntranceFeeUnlocked();
@ -52,7 +52,7 @@ GameActions::Result SetParkEntranceFeeAction::Query() const
return GameActions::Result();
}
GameActions::Result SetParkEntranceFeeAction::Execute() const
GameActions::Result ParkSetEntranceFeeAction::Execute() const
{
gParkEntranceFee = _fee;
window_invalidate_by_class(WindowClass::ParkInformation);

View File

@ -11,14 +11,14 @@
#include "GameAction.h"
class SetParkEntranceFeeAction final : public GameActionBase<GameCommand::SetParkEntranceFee>
class ParkSetEntranceFeeAction final : public GameActionBase<GameCommand::SetParkEntranceFee>
{
private:
money16 _fee{ MONEY16_UNDEFINED };
public:
SetParkEntranceFeeAction() = default;
SetParkEntranceFeeAction(money16 fee);
ParkSetEntranceFeeAction() = default;
ParkSetEntranceFeeAction(money16 fee);
void AcceptParameters(GameActionParameterVisitor& visitor) override;

View File

@ -98,6 +98,7 @@
<ClInclude Include="actions\ParkEntranceRemoveAction.h" />
<ClInclude Include="actions\ParkMarketingAction.h" />
<ClInclude Include="actions\ParkSetDateAction.h" />
<ClInclude Include="actions\ParkSetEntranceFeeAction.h" />
<ClInclude Include="actions\ParkSetLoanAction.h" />
<ClInclude Include="actions\ParkSetNameAction.h" />
<ClInclude Include="actions\ParkSetParameterAction.h" />
@ -121,7 +122,6 @@
<ClInclude Include="actions\RideSetStatusAction.h" />
<ClInclude Include="actions\RideSetVehicleAction.h" />
<ClInclude Include="actions\ScenarioSetSettingAction.h" />
<ClInclude Include="actions\SetParkEntranceFeeAction.h" />
<ClInclude Include="actions\SignSetNameAction.h" />
<ClInclude Include="actions\SignSetStyleAction.h" />
<ClInclude Include="actions\SmallSceneryPlaceAction.h" />
@ -598,6 +598,7 @@
<ClCompile Include="actions\ParkEntranceRemoveAction.cpp" />
<ClCompile Include="actions\ParkMarketingAction.cpp" />
<ClCompile Include="actions\ParkSetDateAction.cpp" />
<ClCompile Include="actions\ParkSetEntranceFeeAction.cpp" />
<ClCompile Include="actions\ParkSetLoanAction.cpp" />
<ClCompile Include="actions\ParkSetNameAction.cpp" />
<ClCompile Include="actions\ParkSetParameterAction.cpp" />
@ -621,7 +622,6 @@
<ClCompile Include="actions\RideSetStatusAction.cpp" />
<ClCompile Include="actions\RideSetVehicleAction.cpp" />
<ClCompile Include="actions\ScenarioSetSettingAction.cpp" />
<ClCompile Include="actions\SetParkEntranceFeeAction.cpp" />
<ClCompile Include="actions\SignSetNameAction.cpp" />
<ClCompile Include="actions\SignSetStyleAction.cpp" />
<ClCompile Include="actions\SmallSceneryPlaceAction.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::MapChangeSize,
GameCommand::ChangeMapSize,
},
},
NetworkAction{

View File

@ -1290,7 +1290,7 @@ const static EnumMap<GameCommand> ActionNameToType = {
{ "largesceneryremove", GameCommand::RemoveLargeScenery },
{ "largescenerysetcolour", GameCommand::SetLargeSceneryColour },
{ "loadorquit", GameCommand::LoadOrQuit },
{ "mapChangeSize", GameCommand::MapChangeSize },
{ "mapChangeSize", GameCommand::ChangeMapSize },
{ "mazeplacetrack", GameCommand::PlaceMazeDesign },
{ "mazesettrack", GameCommand::SetMazeTrack },
{ "networkmodifygroup", GameCommand::ModifyGroups },
@ -1298,6 +1298,7 @@ const static EnumMap<GameCommand> ActionNameToType = {
{ "parkentranceremove", GameCommand::RemoveParkEntrance },
{ "parkmarketing", GameCommand::StartMarketingCampaign },
{ "parksetdate", GameCommand::SetDate },
{ "parksetentrancefee", GameCommand::SetParkEntranceFee },
{ "parksetloan", GameCommand::SetCurrentLoan },
{ "parksetname", GameCommand::SetParkName },
{ "parksetparameter", GameCommand::SetParkOpen },
@ -1321,7 +1322,6 @@ const static EnumMap<GameCommand> ActionNameToType = {
{ "ridesetvehicle", GameCommand::SetRideVehicles },
{ "scenariosetsetting", GameCommand::EditScenarioOptions },
{ "setcheat", GameCommand::Cheat },
{ "setparkentrancefee", GameCommand::SetParkEntranceFee },
{ "signsetname", GameCommand::SetSignName },
{ "signsetstyle", GameCommand::SetSignStyle },
{ "smallsceneryplace", GameCommand::PlaceScenery },

View File

@ -16,10 +16,10 @@
#include <openrct2/GameState.h>
#include <openrct2/OpenRCT2.h>
#include <openrct2/ParkImporter.h>
#include <openrct2/actions/ParkSetEntranceFeeAction.h>
#include <openrct2/actions/ParkSetParameterAction.h>
#include <openrct2/actions/RideSetPriceAction.h>
#include <openrct2/actions/RideSetStatusAction.h>
#include <openrct2/actions/SetParkEntranceFeeAction.h>
#include <openrct2/entity/EntityRegistry.h>
#include <openrct2/entity/EntityTweener.h>
#include <openrct2/entity/Peep.h>
@ -99,7 +99,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds)
// Open park for free but charging for rides
execute<ParkSetParameterAction>(ParkParameter::Open);
execute<SetParkEntranceFeeAction>(0);
execute<ParkSetEntranceFeeAction>(0);
gParkFlags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
// Find ferris wheel
@ -160,7 +160,7 @@ TEST_F(PlayTests, CarRideWithOneCarOnlyAcceptsTwoGuests)
// Open park for free but charging for rides
execute<ParkSetParameterAction>(ParkParameter::Open);
execute<SetParkEntranceFeeAction>(0);
execute<ParkSetEntranceFeeAction>(0);
gParkFlags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
// Find car ride