diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index 2342435bca..7b9a1aac73 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -12,6 +12,7 @@ #include "../interface/Window.h" #include +#include #include #include #include @@ -24,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -437,7 +437,7 @@ namespace OpenRCT2::Title ResetAllSpriteQuadrantPlacements(); auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); ContextBroadcastIntent(&intent); - ScenerySetDefaultPlacementConfiguration(); + Ui::Windows::WindowScenerySetDefaultPlacementConfiguration(); News::InitQueue(); LoadPalette(); gScreenAge = 0; diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 41d81ee794..8bdacf984f 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -163,7 +163,7 @@ static Widget _editorBottomToolbarWidgets[] = { { WindowCloseAll(); SetAllSceneryItemsInvented(); - ScenerySetDefaultPlacementConfiguration(); + WindowScenerySetDefaultPlacementConfiguration(); GetGameState().EditorStep = EditorStep::LandscapeEditor; ContextOpenWindow(WindowClass::Map); GfxInvalidateScreen(); diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index d4882b6f24..8ac38b09bf 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -384,14 +384,13 @@ namespace OpenRCT2::Editor windowManager->SetMainView(gameState.SavedView, gameState.SavedViewZoom, gameState.SavedViewRotation); ResetAllSpriteQuadrantPlacements(); - ScenerySetDefaultPlacementConfiguration(); + windowManager->BroadcastIntent(Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG)); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_NEW_RIDES)); + windowManager->BroadcastIntent(Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD)); gWindowUpdateTicks = 0; LoadPalette(); - - windowManager->BroadcastIntent(Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD)); } /** diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index e25580571c..a89ff15af4 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -501,7 +501,10 @@ void FinishObjectSelection() else { SetAllSceneryItemsInvented(); - ScenerySetDefaultPlacementConfiguration(); + + auto intent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG); + ContextBroadcastIntent(&intent); + gameState.EditorStep = EditorStep::LandscapeEditor; GfxInvalidateScreen(); } diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index b40ae30576..5ef61ffbb1 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -369,10 +369,6 @@ void GameLoadInit() } ResetEntitySpatialIndices(); ResetAllSpriteQuadrantPlacements(); - ScenerySetDefaultPlacementConfiguration(); - - auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); - ContextBroadcastIntent(&intent); gWindowUpdateTicks = 0; gCurrentRealTimeTicks = 0; @@ -381,8 +377,9 @@ void GameLoadInit() if (!gOpenRCT2Headless) { - intent = Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD); - ContextBroadcastIntent(&intent); + windowManager->BroadcastIntent(Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG)); + windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_NEW_RIDES)); + windowManager->BroadcastIntent(Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD)); } gGameSpeed = 1; diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 89d044f912..6e3def1cd2 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -83,10 +83,12 @@ namespace OpenRCT2 GetGameState().NextGuestNumber = 1; ContextInit(); - ScenerySetDefaultPlacementConfiguration(); - auto intent = Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD); - ContextBroadcastIntent(&intent); + auto sceneryIntent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG); + ContextBroadcastIntent(&sceneryIntent); + + auto clipboardIntent = Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD); + ContextBroadcastIntent(&clipboardIntent); LoadPalette(); diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 406992cb3b..b178b4a35a 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1273,10 +1273,12 @@ static int32_t ConsoleCommandLoadObject(InteractiveConsole& console, const argum ResearchResetCurrentItem(); gSilentResearch = false; } - ScenerySetDefaultPlacementConfiguration(); - auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); - ContextBroadcastIntent(&intent); + auto sceneryIntent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG); + ContextBroadcastIntent(&sceneryIntent); + + auto ridesIntent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); + ContextBroadcastIntent(&ridesIntent); gWindowUpdateTicks = 0; GfxInvalidateScreen(); diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index e3472fc779..29bceebcef 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -94,7 +94,10 @@ void ScenarioReset(GameState_t& gameState) gameState.ScenarioRand.seed(s); ResearchResetCurrentItem(); - ScenerySetDefaultPlacementConfiguration(); + + auto intent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG); + ContextBroadcastIntent(&intent); + News::InitQueue(); gameState.Park.Rating = Park::CalculateParkRating(); diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index e6124ae47c..779ac729af 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -410,9 +410,3 @@ bool SceneryToolIsActive() return false; } - -void ScenerySetDefaultPlacementConfiguration() -{ - auto intent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG); - ContextBroadcastIntent(&intent); -} diff --git a/src/openrct2/world/Scenery.h b/src/openrct2/world/Scenery.h index 7dd35cb573..e1cda7d202 100644 --- a/src/openrct2/world/Scenery.h +++ b/src/openrct2/world/Scenery.h @@ -69,7 +69,6 @@ extern const CoordsXY SceneryQuadrantOffsets[]; extern money64 gClearSceneryCost; void SceneryUpdateTile(const CoordsXY& sceneryPos); -void ScenerySetDefaultPlacementConfiguration(); void SceneryRemoveGhostToolPlacement(); struct WallSceneryEntry; diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index 45a36f6ec8..d2387c5b36 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -57,7 +57,6 @@ static std::unique_ptr localStartGame(const std::string& parkPath) ResetEntitySpatialIndices(); ResetAllSpriteQuadrantPlacements(); - ScenerySetDefaultPlacementConfiguration(); LoadPalette(); EntityTweener::Get().Reset(); MapAnimationAutoCreate(); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index 848077f842..950d1e5b90 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -65,7 +65,6 @@ static void GameInit(bool retainSpatialIndices) ResetEntitySpatialIndices(); ResetAllSpriteQuadrantPlacements(); - ScenerySetDefaultPlacementConfiguration(); LoadPalette(); EntityTweener::Get().Reset(); MapAnimationAutoCreate();