mirror of https://github.com/OpenRCT2/OpenRCT2.git
Unwrap game action compat wrappers
This commit is contained in:
parent
93807ec5bf
commit
5661da1c68
|
@ -20,6 +20,7 @@
|
|||
#include <openrct2/OpenRCT2.h>
|
||||
#include <openrct2/actions/BalloonPressAction.h>
|
||||
#include <openrct2/actions/FootpathAdditionRemoveAction.h>
|
||||
#include <openrct2/actions/FootpathRemoveAction.h>
|
||||
#include <openrct2/actions/LargeSceneryRemoveAction.h>
|
||||
#include <openrct2/actions/ParkEntranceRemoveAction.h>
|
||||
#include <openrct2/actions/SmallSceneryRemoveAction.h>
|
||||
|
@ -627,7 +628,8 @@ static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const Co
|
|||
{
|
||||
if (tileElement2->GetType() == TileElementType::Path && tileElement2->GetBaseZ() == z)
|
||||
{
|
||||
footpath_remove({ mapCoords, z }, GAME_COMMAND_FLAG_APPLY);
|
||||
auto action = FootpathRemoveAction({ mapCoords, z });
|
||||
GameActions::Execute(&action);
|
||||
break;
|
||||
}
|
||||
} while (!(tileElement2++)->IsLastForTile());
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
<ClInclude Include="interface\Viewport.h" />
|
||||
<ClInclude Include="interface\Widget.h" />
|
||||
<ClInclude Include="interface\Window.h" />
|
||||
<ClInclude Include="ride\Construction.h" />
|
||||
<ClInclude Include="scripting\CustomImages.h" />
|
||||
<ClInclude Include="scripting\CustomListView.h" />
|
||||
<ClInclude Include="scripting\CustomMenu.h" />
|
||||
|
@ -119,6 +120,7 @@
|
|||
<ClCompile Include="interface\ViewportInteraction.cpp" />
|
||||
<ClCompile Include="interface\Widget.cpp" />
|
||||
<ClCompile Include="interface\Window.cpp" />
|
||||
<ClCompile Include="ride\Construction.cpp" />
|
||||
<ClCompile Include="scripting\CustomImages.cpp" />
|
||||
<ClCompile Include="scripting\CustomListView.cpp" />
|
||||
<ClCompile Include="scripting\CustomMenu.cpp" />
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2022 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "Construction.h"
|
||||
|
||||
#include <openrct2/actions/RideCreateAction.h>
|
||||
#include <openrct2/ride/Ride.h>
|
||||
#include <openrct2/ride/RideTypes.h>
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006B4800
|
||||
*/
|
||||
void ride_construct_new(RideSelection listItem)
|
||||
{
|
||||
int32_t rideEntryIndex = ride_get_entry_index(listItem.Type, listItem.EntryIndex);
|
||||
int32_t colour1 = ride_get_random_colour_preset_index(listItem.Type);
|
||||
int32_t colour2 = ride_get_unused_preset_vehicle_colour(rideEntryIndex);
|
||||
|
||||
auto gameAction = RideCreateAction(listItem.Type, listItem.EntryIndex, colour1, colour2, gLastEntranceStyle);
|
||||
|
||||
gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
return;
|
||||
const auto rideIndex = result->GetData<RideId>();
|
||||
auto ride = get_ride(rideIndex);
|
||||
ride_construct(ride);
|
||||
});
|
||||
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2022 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openrct2/ride/RideTypes.h>
|
||||
|
||||
void ride_construct_new(RideSelection listItem);
|
|
@ -11,6 +11,7 @@
|
|||
#include <openrct2-ui/windows/Window.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/Game.h>
|
||||
#include <openrct2/actions/RideDemolishAction.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
#include <openrct2/localisation/Localisation.h>
|
||||
|
@ -62,8 +63,8 @@ public:
|
|||
{
|
||||
case WIDX_DEMOLISH:
|
||||
{
|
||||
auto* currentRide = get_ride(rideId);
|
||||
ride_action_modify(currentRide, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY);
|
||||
auto gameAction = RideDemolishAction(rideId, RIDE_MODIFY_DEMOLISH);
|
||||
GameActions::Execute(&gameAction);
|
||||
break;
|
||||
}
|
||||
case WIDX_CANCEL:
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <openrct2/Input.h>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
#include <openrct2/actions/FootpathPlaceAction.h>
|
||||
#include <openrct2/actions/FootpathRemoveAction.h>
|
||||
#include <openrct2/audio/audio.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
#include <openrct2/localisation/Localisation.h>
|
||||
|
@ -1177,8 +1178,8 @@ static void FootpathRemoveTileElement(TileElement* tileElement)
|
|||
}
|
||||
|
||||
gFootpathConstructFromPosition.z = tileElement->GetBaseZ();
|
||||
// Remove path
|
||||
footpath_remove(gFootpathConstructFromPosition, GAME_COMMAND_FLAG_APPLY);
|
||||
auto action = FootpathRemoveAction(gFootpathConstructFromPosition);
|
||||
GameActions::Execute(&action);
|
||||
|
||||
// Move selection
|
||||
edge = direction_reverse(edge);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <openrct2/GameState.h>
|
||||
#include <openrct2/Input.h>
|
||||
#include <openrct2/actions/GuestSetFlagsAction.h>
|
||||
#include <openrct2/actions/GuestSetNameAction.h>
|
||||
#include <openrct2/actions/PeepPickupAction.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/entity/Guest.h>
|
||||
|
@ -903,7 +904,8 @@ private:
|
|||
if (text.empty())
|
||||
return;
|
||||
std::string sText(text);
|
||||
guest_set_name(EntityId::FromUnderlying(number), sText.c_str());
|
||||
auto gameAction = GuestSetNameAction(EntityId::FromUnderlying(number), sText);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
|
||||
void OnToolUpdateOverview(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
|
|
|
@ -513,7 +513,16 @@ public:
|
|||
}
|
||||
|
||||
park_entrance_remove_ghost();
|
||||
park_entrance_place_ghost(parkEntrancePosition);
|
||||
|
||||
auto gameAction = PlaceParkEntranceAction(parkEntrancePosition, gFootpathSelectedId);
|
||||
gameAction.SetFlags(GAME_COMMAND_FLAG_GHOST);
|
||||
|
||||
auto result = GameActions::Execute(&gameAction);
|
||||
if (result.Error == GameActions::Status::Ok)
|
||||
{
|
||||
gParkEntranceGhostPosition = parkEntrancePosition;
|
||||
gParkEntranceGhostExists = true;
|
||||
}
|
||||
}
|
||||
|
||||
void PlaceParkEntranceToolDown(const ScreenCoordsXY& screenCoords)
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "openrct2/actions/MazeSetTrackAction.h"
|
||||
|
||||
#include <openrct2-ui/interface/Viewport.h>
|
||||
#include <openrct2-ui/interface/Widget.h>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/Game.h>
|
||||
#include <openrct2/Input.h>
|
||||
#include <openrct2/actions/MazeSetTrackAction.h>
|
||||
#include <openrct2/actions/RideDemolishAction.h>
|
||||
#include <openrct2/actions/RideEntranceExitPlaceAction.h>
|
||||
#include <openrct2/audio/audio.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
|
@ -121,8 +121,9 @@ public:
|
|||
{
|
||||
int32_t savedPausedState = gGamePaused;
|
||||
gGamePaused = 0;
|
||||
ride_action_modify(
|
||||
currentRide, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
|
||||
auto gameAction = RideDemolishAction(currentRide->id, RIDE_MODIFY_DEMOLISH);
|
||||
gameAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
|
||||
GameActions::Execute(&gameAction);
|
||||
gGamePaused = savedPausedState;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <openrct2-ui/interface/Widget.h>
|
||||
#include <openrct2-ui/ride/Construction.h>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/Game.h>
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <openrct2/GameState.h>
|
||||
#include <openrct2/Input.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>
|
||||
|
@ -827,13 +828,15 @@ private:
|
|||
case WIDX_INCREASE_PRICE:
|
||||
{
|
||||
const auto newFee = std::min(MAX_ENTRANCE_FEE, gParkEntranceFee + 1.00_GBP);
|
||||
park_set_entrance_fee(newFee);
|
||||
auto gameAction = SetParkEntranceFeeAction(static_cast<money16>(newFee));
|
||||
GameActions::Execute(&gameAction);
|
||||
break;
|
||||
}
|
||||
case WIDX_DECREASE_PRICE:
|
||||
{
|
||||
const auto newFee = std::max(0.00_GBP, gParkEntranceFee - 1.00_GBP);
|
||||
park_set_entrance_fee(newFee);
|
||||
auto gameAction = SetParkEntranceFeeAction(static_cast<money16>(newFee));
|
||||
GameActions::Execute(&gameAction);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <openrct2-ui/windows/Window.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/Game.h>
|
||||
#include <openrct2/actions/RideDemolishAction.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/localisation/Localisation.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
|
@ -61,8 +62,8 @@ public:
|
|||
{
|
||||
case WIDX_REFURBISH:
|
||||
{
|
||||
auto* currentRide = get_ride(rideId);
|
||||
ride_action_modify(currentRide, RIDE_MODIFY_RENEW, GAME_COMMAND_FLAG_APPLY);
|
||||
auto gameAction = RideDemolishAction(rideId, RIDE_MODIFY_RENEW);
|
||||
GameActions::Execute(&gameAction);
|
||||
break;
|
||||
}
|
||||
case WIDX_CANCEL:
|
||||
|
|
|
@ -28,8 +28,10 @@
|
|||
#include <openrct2/actions/ParkSetParameterAction.h>
|
||||
#include <openrct2/actions/RideSetAppearanceAction.h>
|
||||
#include <openrct2/actions/RideSetColourSchemeAction.h>
|
||||
#include <openrct2/actions/RideSetNameAction.h>
|
||||
#include <openrct2/actions/RideSetPriceAction.h>
|
||||
#include <openrct2/actions/RideSetSettingAction.h>
|
||||
#include <openrct2/actions/RideSetStatusAction.h>
|
||||
#include <openrct2/audio/audio.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
|
@ -1683,7 +1685,8 @@ static void WindowRideMainMouseup(rct_window* w, rct_widgetindex widgetIndex)
|
|||
status = RideStatus::Open;
|
||||
break;
|
||||
}
|
||||
ride_set_status(ride, status);
|
||||
auto gameAction = RideSetStatusAction(ride->id, status);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -2174,7 +2177,8 @@ static void WindowRideMainDropdown(rct_window* w, rct_widgetindex widgetIndex, i
|
|||
break;
|
||||
}
|
||||
}
|
||||
ride_set_status(ride, status);
|
||||
auto gameAction = RideSetStatusAction(ride->id, status);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -2262,7 +2266,8 @@ static void WindowRideMainTextinput(rct_window* w, rct_widgetindex widgetIndex,
|
|||
auto ride = get_ride(w->rideId);
|
||||
if (ride != nullptr)
|
||||
{
|
||||
ride_set_name(ride, text, 0);
|
||||
auto gameAction = RideSetNameAction(ride->id, text);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "openrct2/actions/MazeSetTrackAction.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
#include <openrct2-ui/interface/Dropdown.h>
|
||||
|
@ -19,7 +17,10 @@
|
|||
#include <openrct2/Context.h>
|
||||
#include <openrct2/Game.h>
|
||||
#include <openrct2/Input.h>
|
||||
#include <openrct2/actions/MazeSetTrackAction.h>
|
||||
#include <openrct2/actions/RideDemolishAction.h>
|
||||
#include <openrct2/actions/RideEntranceExitPlaceAction.h>
|
||||
#include <openrct2/actions/RideSetStatusAction.h>
|
||||
#include <openrct2/actions/TrackPlaceAction.h>
|
||||
#include <openrct2/actions/TrackRemoveAction.h>
|
||||
#include <openrct2/actions/TrackSetBrakeSpeedAction.h>
|
||||
|
@ -274,7 +275,8 @@ public:
|
|||
if (!_autoOpeningShop)
|
||||
{
|
||||
_autoOpeningShop = true;
|
||||
ride_set_status(currentRide, RideStatus::Open);
|
||||
auto gameAction = RideSetStatusAction(currentRide->id, RideStatus::Open);
|
||||
GameActions::Execute(&gameAction);
|
||||
_autoOpeningShop = false;
|
||||
}
|
||||
}
|
||||
|
@ -288,7 +290,8 @@ public:
|
|||
{
|
||||
int32_t previousPauseState = gGamePaused;
|
||||
gGamePaused = 0;
|
||||
ride_action_modify(currentRide, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY);
|
||||
auto gameAction = RideDemolishAction(currentRide->id, RIDE_MODIFY_DEMOLISH);
|
||||
GameActions::Execute(&gameAction);
|
||||
gGamePaused = previousPauseState;
|
||||
}
|
||||
}
|
||||
|
@ -956,7 +959,8 @@ public:
|
|||
if (currentRide != nullptr)
|
||||
{
|
||||
auto status = currentRide->status == RideStatus::Simulating ? RideStatus::Closed : RideStatus::Simulating;
|
||||
ride_set_status(currentRide, status);
|
||||
auto gameAction = RideSetStatusAction(currentRide->id, status);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#include <openrct2-ui/windows/Window.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/Game.h>
|
||||
#include <openrct2/actions/RideDemolishAction.h>
|
||||
#include <openrct2/actions/RideSetStatusAction.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/interface/Colour.h>
|
||||
|
@ -400,10 +402,10 @@ public:
|
|||
|
||||
// Open ride window
|
||||
const auto rideIndex = _rideList[index];
|
||||
auto* ridePtr = get_ride(rideIndex);
|
||||
if (_quickDemolishMode && network_get_mode() != NETWORK_MODE_CLIENT)
|
||||
{
|
||||
ride_action_modify(ridePtr, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY);
|
||||
auto gameAction = RideDemolishAction(rideIndex, RIDE_MODIFY_DEMOLISH);
|
||||
GameActions::Execute(&gameAction);
|
||||
RefreshList();
|
||||
}
|
||||
else
|
||||
|
@ -935,7 +937,8 @@ private:
|
|||
{
|
||||
if (rideRef.status != RideStatus::Closed && rideRef.GetClassification() == static_cast<RideClassification>(page))
|
||||
{
|
||||
ride_set_status(&rideRef, RideStatus::Closed);
|
||||
auto gameAction = RideSetStatusAction(rideRef.id, RideStatus::Closed);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -947,7 +950,8 @@ private:
|
|||
{
|
||||
if (rideRef.status != RideStatus::Open && rideRef.GetClassification() == static_cast<RideClassification>(page))
|
||||
{
|
||||
ride_set_status(&rideRef, RideStatus::Open);
|
||||
auto gameAction = RideSetStatusAction(rideRef.id, RideStatus::Open);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <openrct2-ui/interface/Widget.h>
|
||||
#include <openrct2-ui/ride/Construction.h>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/Editor.h>
|
||||
|
|
|
@ -1,118 +0,0 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2020 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../entity/Staff.h"
|
||||
#include "../ride/Track.h"
|
||||
#include "../world/Entrance.h"
|
||||
#include "../world/Park.h"
|
||||
#include "GameAction.h"
|
||||
#include "GuestSetNameAction.h"
|
||||
#include "MazeSetTrackAction.h"
|
||||
#include "PlaceParkEntranceAction.h"
|
||||
#include "PlacePeepSpawnAction.h"
|
||||
#include "RideCreateAction.h"
|
||||
#include "RideDemolishAction.h"
|
||||
#include "RideSetNameAction.h"
|
||||
#include "RideSetStatusAction.h"
|
||||
#include "SetParkEntranceFeeAction.h"
|
||||
#include "WallRemoveAction.h"
|
||||
|
||||
#pragma region PlaceParkEntranceAction
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00666F4E
|
||||
*/
|
||||
money32 park_entrance_place_ghost(const CoordsXYZD& entranceLoc)
|
||||
{
|
||||
park_entrance_remove_ghost();
|
||||
|
||||
auto gameAction = PlaceParkEntranceAction(entranceLoc, gFootpathSelectedId);
|
||||
gameAction.SetFlags(GAME_COMMAND_FLAG_GHOST);
|
||||
|
||||
auto result = GameActions::Execute(&gameAction);
|
||||
if (result.Error == GameActions::Status::Ok)
|
||||
{
|
||||
gParkEntranceGhostPosition = entranceLoc;
|
||||
gParkEntranceGhostExists = true;
|
||||
}
|
||||
return result.Cost;
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region SetParkEntranceFeeAction
|
||||
void park_set_entrance_fee(money32 fee)
|
||||
{
|
||||
auto gameAction = SetParkEntranceFeeAction(static_cast<money16>(fee));
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region RideCreateAction
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006B4800
|
||||
*/
|
||||
void ride_construct_new(RideSelection listItem)
|
||||
{
|
||||
int32_t rideEntryIndex = ride_get_entry_index(listItem.Type, listItem.EntryIndex);
|
||||
int32_t colour1 = ride_get_random_colour_preset_index(listItem.Type);
|
||||
int32_t colour2 = ride_get_unused_preset_vehicle_colour(rideEntryIndex);
|
||||
|
||||
auto gameAction = RideCreateAction(listItem.Type, listItem.EntryIndex, colour1, colour2, gLastEntranceStyle);
|
||||
|
||||
gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
return;
|
||||
const auto rideIndex = result->GetData<RideId>();
|
||||
auto ride = get_ride(rideIndex);
|
||||
ride_construct(ride);
|
||||
});
|
||||
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region RideSetStatusAction
|
||||
|
||||
void ride_set_status(Ride* ride, RideStatus status)
|
||||
{
|
||||
auto gameAction = RideSetStatusAction(ride->id, status);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region RideSetNameAction
|
||||
void ride_set_name(Ride* ride, const char* name, uint32_t flags)
|
||||
{
|
||||
auto gameAction = RideSetNameAction(ride->id, name);
|
||||
gameAction.SetFlags(flags);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region RideModifyAction
|
||||
void ride_action_modify(Ride* ride, int32_t modifyType, int32_t flags)
|
||||
{
|
||||
auto gameAction = RideDemolishAction(ride->id, modifyType);
|
||||
gameAction.SetFlags(flags);
|
||||
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region GuestSetName
|
||||
|
||||
void guest_set_name(EntityId spriteIndex, const char* name)
|
||||
{
|
||||
auto gameAction = GuestSetNameAction(spriteIndex, name);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
#pragma endregion
|
|
@ -467,8 +467,6 @@ extern uint8_t gGuestInitialThirst;
|
|||
|
||||
extern uint32_t gNextGuestNumber;
|
||||
|
||||
void guest_set_name(EntityId spriteIndex, const char* name);
|
||||
|
||||
void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft);
|
||||
|
||||
void increment_guests_in_park();
|
||||
|
|
|
@ -567,7 +567,6 @@
|
|||
<ClCompile Include="actions\FootpathPlaceFromTrackAction.cpp" />
|
||||
<ClCompile Include="actions\FootpathRemoveAction.cpp" />
|
||||
<ClCompile Include="actions\GameAction.cpp" />
|
||||
<ClCompile Include="actions\GameActionCompat.cpp" />
|
||||
<ClCompile Include="actions\GameActionRegistry.cpp" />
|
||||
<ClCompile Include="actions\GameActionResult.cpp" />
|
||||
<ClCompile Include="actions\GuestSetFlagsAction.cpp" />
|
||||
|
|
|
@ -1004,7 +1004,6 @@ void ride_check_all_reachable();
|
|||
|
||||
bool ride_try_get_origin_element(const Ride* ride, CoordsXYE* output);
|
||||
int32_t ride_find_track_gap(const Ride* ride, CoordsXYE* input, CoordsXYE* output);
|
||||
void ride_construct_new(RideSelection listItem);
|
||||
void ride_construct(Ride* ride);
|
||||
void ride_clear_blocked_tiles(Ride* ride);
|
||||
Staff* ride_get_mechanic(Ride* ride);
|
||||
|
@ -1021,8 +1020,6 @@ void ride_set_map_tooltip(TileElement* tileElement);
|
|||
void ride_prepare_breakdown(Ride* ride, int32_t breakdownReason);
|
||||
TileElement* ride_get_station_start_track_element(const Ride* ride, StationIndex stationIndex);
|
||||
TileElement* ride_get_station_exit_element(const CoordsXYZ& elementPos);
|
||||
void ride_set_status(Ride* ride, RideStatus status);
|
||||
void ride_set_name(Ride* ride, const char* name, uint32_t flags);
|
||||
int32_t ride_get_refund_price(const Ride* ride);
|
||||
int32_t ride_get_random_colour_preset_index(uint8_t ride_type);
|
||||
money32 ride_get_common_price(Ride* forRide);
|
||||
|
@ -1097,8 +1094,6 @@ bool ride_entry_has_category(const rct_ride_entry* rideEntry, uint8_t category);
|
|||
|
||||
int32_t ride_get_entry_index(int32_t rideType, int32_t rideSubType);
|
||||
|
||||
void ride_action_modify(Ride* ride, int32_t modifyType, int32_t flags);
|
||||
|
||||
void determine_ride_entrance_and_exit_locations();
|
||||
void ride_clear_leftover_entrances(Ride* ride);
|
||||
|
||||
|
|
|
@ -1015,7 +1015,8 @@ bool ride_modify(CoordsXYE* input)
|
|||
// Stop the ride again to clear all vehicles and peeps (compatible with network games)
|
||||
if (ride->status != RideStatus::Simulating)
|
||||
{
|
||||
ride_set_status(ride, RideStatus::Closed);
|
||||
auto gameAction = RideSetStatusAction(ride->id, RideStatus::Closed);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
|
||||
// Check if element is a station entrance or exit
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "../actions/LargeSceneryRemoveAction.h"
|
||||
#include "../actions/MazePlaceTrackAction.h"
|
||||
#include "../actions/RideCreateAction.h"
|
||||
#include "../actions/RideDemolishAction.h"
|
||||
#include "../actions/RideEntranceExitPlaceAction.h"
|
||||
#include "../actions/SmallSceneryPlaceAction.h"
|
||||
#include "../actions/SmallSceneryRemoveAction.h"
|
||||
|
@ -1541,10 +1542,9 @@ static GameActions::Result TrackDesignPlaceMaze(TrackDesignState& tds, TrackDesi
|
|||
|
||||
if (tds.PlaceOperation == PTD_OPERATION_REMOVE_GHOST)
|
||||
{
|
||||
ride_action_modify(
|
||||
ride, RIDE_MODIFY_DEMOLISH,
|
||||
GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND
|
||||
| GAME_COMMAND_FLAG_GHOST);
|
||||
auto gameAction = RideDemolishAction(ride->id, RIDE_MODIFY_DEMOLISH);
|
||||
gameAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST);
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
|
||||
tds.Origin = coords;
|
||||
|
|
|
@ -56,7 +56,6 @@ extern CoordsXYZD gRideEntranceExitGhostPosition;
|
|||
extern StationIndex gRideEntranceExitGhostStationIndex;
|
||||
|
||||
void park_entrance_remove_ghost();
|
||||
money32 park_entrance_place_ghost(const CoordsXYZD& entranceLoc);
|
||||
|
||||
void reset_park_entrance();
|
||||
void maze_entrance_hedge_replacement(const CoordsXYE& entrance);
|
||||
|
|
|
@ -130,20 +130,6 @@ TileElement* map_get_footpath_element(const CoordsXYZ& coords)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
money32 footpath_remove(const CoordsXYZ& footpathLoc, int32_t flags)
|
||||
{
|
||||
auto action = FootpathRemoveAction(footpathLoc);
|
||||
action.SetFlags(flags);
|
||||
|
||||
if (flags & GAME_COMMAND_FLAG_APPLY)
|
||||
{
|
||||
auto res = GameActions::Execute(&action);
|
||||
return res.Cost;
|
||||
}
|
||||
auto res = GameActions::Query(&action);
|
||||
return res.Cost;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006A76FF
|
||||
|
@ -216,10 +202,9 @@ void footpath_provisional_remove()
|
|||
{
|
||||
gProvisionalFootpath.Flags &= ~PROVISIONAL_PATH_FLAG_1;
|
||||
|
||||
footpath_remove(
|
||||
gProvisionalFootpath.Position,
|
||||
GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND
|
||||
| GAME_COMMAND_FLAG_GHOST);
|
||||
auto action = FootpathRemoveAction(gProvisionalFootpath.Position);
|
||||
action.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST);
|
||||
GameActions::Execute(&action);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -233,7 +233,6 @@ extern const CoordsXY BenchUseOffsets[NumOrthogonalDirections * 2];
|
|||
|
||||
TileElement* map_get_footpath_element(const CoordsXYZ& coords);
|
||||
void footpath_interrupt_peeps(const CoordsXYZ& footpathPos);
|
||||
money32 footpath_remove(const CoordsXYZ& footpathLoc, int32_t flags);
|
||||
money32 footpath_provisional_set(
|
||||
ObjectEntryIndex type, ObjectEntryIndex railingsType, const CoordsXYZ& footpathLoc, int32_t slope,
|
||||
PathConstructFlags constructFlags);
|
||||
|
|
|
@ -122,7 +122,6 @@ uint8_t calculate_guest_initial_happiness(uint8_t percentage);
|
|||
|
||||
void park_set_open(bool open);
|
||||
int32_t park_entrance_get_index(const CoordsXYZ& entrancePos);
|
||||
void park_set_entrance_fee(money32 value);
|
||||
money16 park_get_entrance_fee();
|
||||
|
||||
bool park_ride_prices_unlocked();
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
#include <openrct2/ParkImporter.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>
|
||||
|
@ -97,7 +99,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds)
|
|||
|
||||
// Open park for free but charging for rides
|
||||
execute<ParkSetParameterAction>(ParkParameter::Open);
|
||||
park_set_entrance_fee(0);
|
||||
execute<SetParkEntranceFeeAction>(0);
|
||||
gParkFlags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
|
||||
|
||||
// Find ferris wheel
|
||||
|
@ -108,7 +110,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds)
|
|||
Ride& ferrisWheel = *it;
|
||||
|
||||
// Open it for free
|
||||
ride_set_status(&ferrisWheel, RideStatus::Open);
|
||||
execute<RideSetStatusAction>(ferrisWheel.id, RideStatus::Open);
|
||||
execute<RideSetPriceAction>(ferrisWheel.id, 0, true);
|
||||
|
||||
// Ignore intensity to stimulate peeps to queue into ferris wheel
|
||||
|
@ -158,7 +160,7 @@ TEST_F(PlayTests, CarRideWithOneCarOnlyAcceptsTwoGuests)
|
|||
|
||||
// Open park for free but charging for rides
|
||||
execute<ParkSetParameterAction>(ParkParameter::Open);
|
||||
park_set_entrance_fee(0);
|
||||
execute<SetParkEntranceFeeAction>(0);
|
||||
gParkFlags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
|
||||
|
||||
// Find car ride
|
||||
|
@ -168,7 +170,7 @@ TEST_F(PlayTests, CarRideWithOneCarOnlyAcceptsTwoGuests)
|
|||
Ride& carRide = *it;
|
||||
|
||||
// Open it for free
|
||||
ride_set_status(&carRide, RideStatus::Open);
|
||||
execute<RideSetStatusAction>(carRide.id, RideStatus::Open);
|
||||
execute<RideSetPriceAction>(carRide.id, 0, true);
|
||||
|
||||
// Ignore intensity to stimulate peeps to queue into the ride
|
||||
|
|
Loading…
Reference in New Issue