From 12063aa884ab85b7ecbf6ca6724013bc42fcd297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 25 Apr 2025 17:34:39 +0300 Subject: [PATCH] Rename SetLocation to SetViewportLocation, this is less confusing --- src/openrct2/Editor.cpp | 6 +++--- src/openrct2/interface/InteractiveConsole.cpp | 2 +- src/openrct2/interface/WindowBase.cpp | 2 +- src/openrct2/interface/WindowBase.h | 2 +- src/openrct2/scenes/title/Command/SetLocation.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 8941ce5cdd..64149ef701 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -112,7 +112,7 @@ namespace OpenRCT2::Editor gameState.scenarioCategory = ScenarioCategory::other; ViewportInitAll(); WindowBase* mainWindow = OpenEditorWindows(); - mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); + mainWindow->SetViewportLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); LoadPalette(); gScreenAge = 0; gameState.scenarioName = LanguageGetString(STR_MY_NEW_SCENARIO); @@ -183,7 +183,7 @@ namespace OpenRCT2::Editor getGameState().editorStep = EditorStep::ObjectSelection; ViewportInitAll(); WindowBase* mainWindow = OpenEditorWindows(); - mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); + mainWindow->SetViewportLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); LoadPalette(); GameLoadScripts(); @@ -211,7 +211,7 @@ namespace OpenRCT2::Editor getGameState().editorStep = EditorStep::ObjectSelection; ViewportInitAll(); WindowBase* mainWindow = OpenEditorWindows(); - mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); + mainWindow->SetViewportLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); LoadPalette(); GameLoadScripts(); diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index a4ef0e0682..04982f35b2 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -916,7 +916,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar { auto location = TileCoordsXYZ(int_val[0], int_val[1], 0).ToCoordsXYZ().ToTileCentre(); location.z = TileElementHeight(location); - w->SetLocation(location); + w->SetViewportLocation(location); console.Execute("get location"); } } diff --git a/src/openrct2/interface/WindowBase.cpp b/src/openrct2/interface/WindowBase.cpp index a6c0d1508b..2173f7f2d7 100644 --- a/src/openrct2/interface/WindowBase.cpp +++ b/src/openrct2/interface/WindowBase.cpp @@ -8,7 +8,7 @@ namespace OpenRCT2 { - void WindowBase::SetLocation(const CoordsXYZ& coords) + void WindowBase::SetViewportLocation(const CoordsXYZ& coords) { WindowScrollToLocation(*this, coords); flags &= ~WF_SCROLLING_TO_LOCATION; diff --git a/src/openrct2/interface/WindowBase.h b/src/openrct2/interface/WindowBase.h index 8428fbcb19..77f229d273 100644 --- a/src/openrct2/interface/WindowBase.h +++ b/src/openrct2/interface/WindowBase.h @@ -109,7 +109,7 @@ namespace OpenRCT2 VisibilityCache visibility{}; EntityId viewport_smart_follow_sprite{ EntityId::GetNull() }; // Handles setting viewport target sprite etc - void SetLocation(const CoordsXYZ& coords); + void SetViewportLocation(const CoordsXYZ& coords); void Invalidate(); void RemoveViewport(); void SetWidgets(const std::span newWidgets); diff --git a/src/openrct2/scenes/title/Command/SetLocation.cpp b/src/openrct2/scenes/title/Command/SetLocation.cpp index d79e360f91..cb2ef15804 100644 --- a/src/openrct2/scenes/title/Command/SetLocation.cpp +++ b/src/openrct2/scenes/title/Command/SetLocation.cpp @@ -28,7 +28,7 @@ namespace OpenRCT2::Title // Prevent scroll adjustment due to window placement when in-game auto oldLegacyScene = gLegacyScene; gLegacyScene = LegacyScene::titleSequence; - w->SetLocation({ loc, z }); + w->SetViewportLocation({ loc, z }); gLegacyScene = oldLegacyScene; }