forked from rosebudai/OpenRCT2-Web
Move SetAllLandOwned into EditorScene
This commit is contained in:
1 parent
85bcdf6bf3
commit
8455d576f7
6 files changed
+30
-25
No files matched your search
@@ -57,7 +57,6 @@
|
||||
#include <vector>
|
||||
|
||||
using namespace OpenRCT2;
|
||||
using OpenRCT2::GameActions::CommandFlag;
|
||||
|
||||
namespace OpenRCT2::Editor
|
||||
{
|
||||
@@ -89,26 +88,6 @@ namespace OpenRCT2::Editor
|
||||
context->CloseProgress();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0068ABEC
|
||||
*/
|
||||
void SetAllLandOwned()
|
||||
{
|
||||
auto& gameState = getGameState();
|
||||
|
||||
MapRange range = { 2 * kCoordsXYStep, 2 * kCoordsXYStep, (gameState.mapSize.x - 3) * kCoordsXYStep,
|
||||
(gameState.mapSize.y - 3) * kCoordsXYStep };
|
||||
|
||||
auto landSetRightsAction = GameActions::LandSetRightsAction(range, GameActions::LandSetRightSetting::setForSale);
|
||||
landSetRightsAction.SetFlags({ CommandFlag::noSpend });
|
||||
GameActions::Execute(&landSetRightsAction, gameState);
|
||||
|
||||
auto landBuyRightsAction = GameActions::LandBuyRightsAction(range, GameActions::LandBuyRightSetting::buyLand);
|
||||
landBuyRightsAction.SetFlags({ CommandFlag::noSpend });
|
||||
GameActions::Execute(&landBuyRightsAction, gameState);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AB9B8
|
||||
|
||||
@@ -22,8 +22,6 @@ namespace OpenRCT2
|
||||
|
||||
namespace OpenRCT2::Editor
|
||||
{
|
||||
void SetAllLandOwned();
|
||||
|
||||
void ObjectListLoad();
|
||||
ResultWithMessage CheckPark();
|
||||
std::pair<ObjectType, StringId> CheckObjectSelection();
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
#include "../../GameState.h"
|
||||
#include "../../OpenRCT2.h"
|
||||
#include "../../ParkImporter.h"
|
||||
#include "../../actions/GameActionRunner.h"
|
||||
#include "../../actions/ResultWithMessage.h"
|
||||
#include "../../actions/park/LandBuyRightsAction.h"
|
||||
#include "../../actions/park/LandSetRightsAction.h"
|
||||
#include "../../audio/Audio.h"
|
||||
#include "../../core/Path.hpp"
|
||||
#include "../../drawing/Drawing.h"
|
||||
@@ -34,6 +38,7 @@
|
||||
#include "../SceneManager.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
using OpenRCT2::GameActions::CommandFlag;
|
||||
|
||||
void EditorScene::Load()
|
||||
{
|
||||
@@ -311,3 +316,23 @@ void EditorScene::resetMainViewport()
|
||||
auto* mainWindow = WindowGetMain();
|
||||
mainWindow->setViewportLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0068ABEC
|
||||
*/
|
||||
void EditorScene::SetAllLandOwned()
|
||||
{
|
||||
auto& gameState = getGameState();
|
||||
|
||||
MapRange range = { 2 * kCoordsXYStep, 2 * kCoordsXYStep, (gameState.mapSize.x - 3) * kCoordsXYStep,
|
||||
(gameState.mapSize.y - 3) * kCoordsXYStep };
|
||||
|
||||
auto landSetRightsAction = GameActions::LandSetRightsAction(range, GameActions::LandSetRightSetting::setForSale);
|
||||
landSetRightsAction.SetFlags({ CommandFlag::noSpend });
|
||||
GameActions::Execute(&landSetRightsAction, gameState);
|
||||
|
||||
auto landBuyRightsAction = GameActions::LandBuyRightsAction(range, GameActions::LandBuyRightSetting::buyLand);
|
||||
landBuyRightsAction.SetFlags({ CommandFlag::noSpend });
|
||||
GameActions::Execute(&landBuyRightsAction, gameState);
|
||||
}
|
||||
@@ -33,6 +33,9 @@ namespace OpenRCT2
|
||||
static void FinaliseMainView();
|
||||
static void resetMainViewport();
|
||||
|
||||
protected:
|
||||
void SetAllLandOwned();
|
||||
|
||||
private:
|
||||
void AfterLoadCleanup();
|
||||
void clearMapForEditing();
|
||||
|
||||
@@ -34,7 +34,7 @@ void TrackDesignerScene::Load()
|
||||
auto& gameState = getGameState();
|
||||
gameStateInitAll(gameState, kDefaultMapSize);
|
||||
gameState.editorStep = Editor::Step::objectSelection;
|
||||
Editor::SetAllLandOwned();
|
||||
SetAllLandOwned();
|
||||
Editor::ObjectListLoad();
|
||||
ContextResetSubsystems();
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ void TrackManagerScene::Load()
|
||||
|
||||
auto& gameState = getGameState();
|
||||
gameStateInitAll(gameState, kDefaultMapSize);
|
||||
Editor::SetAllLandOwned();
|
||||
SetAllLandOwned();
|
||||
gameState.editorStep = Editor::Step::objectSelection;
|
||||
Editor::ObjectListLoad();
|
||||
ContextResetSubsystems();
|
||||
|
||||
Reference in new issue
Block a user