From d26b161668e42872287912b0de5e811a66c3f6a5 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 4 Aug 2026 21:07:25 +0200 Subject: [PATCH 1/4] Move gCurrentWindowColours to Drawing.String.cpp --- src/openrct2/drawing/Drawing.String.cpp | 3 +++ src/openrct2/drawing/Drawing.String.h | 2 ++ src/openrct2/interface/Window.cpp | 8 ++++---- src/openrct2/interface/Window.h | 2 -- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 7a53f9c8ab..1ac47ed1a1 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -30,6 +30,9 @@ namespace OpenRCT2::Drawing { static TextColours _savedTextPalette{}; + + Drawing::Colour gCurrentWindowColours[3]; + /** * * rct2: 0x006C23B1 diff --git a/src/openrct2/drawing/Drawing.String.h b/src/openrct2/drawing/Drawing.String.h index f358634017..44de533ba5 100644 --- a/src/openrct2/drawing/Drawing.String.h +++ b/src/openrct2/drawing/Drawing.String.h @@ -48,6 +48,8 @@ namespace OpenRCT2::Drawing const int8_t* yOffset{}; }; + extern Drawing::Colour gCurrentWindowColours[3]; + void drawStringCentredRaw( RenderTarget& rt, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle); void drawNewsTicker( diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 88899e3891..be9ba8cf7d 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -15,6 +15,7 @@ #include "../OpenRCT2.h" #include "../audio/Audio.h" #include "../config/Config.h" +#include "../drawing/Drawing.String.h" #include "../drawing/Drawing.h" #include "../drawing/RenderTarget.h" #include "../entity/EntityRegistry.h" @@ -40,7 +41,6 @@ namespace OpenRCT2 WindowCloseModifier gLastCloseModifier = { { WindowClass::null, 0 }, CloseWindowModifier::none }; uint32_t gWindowUpdateTicks; - Drawing::Colour gCurrentWindowColours[3]; Tool gCurrentToolId; WidgetRef gCurrentToolWidget; @@ -626,9 +626,9 @@ static constexpr float kWindowScrollLocations[][2] = { w.onPrepareDraw(); // Text colouring - gCurrentWindowColours[0] = w.colours[0].colour; - gCurrentWindowColours[1] = w.colours[1].colour; - gCurrentWindowColours[2] = w.colours[2].colour; + Drawing::gCurrentWindowColours[0] = w.colours[0].colour; + Drawing::gCurrentWindowColours[1] = w.colours[1].colour; + Drawing::gCurrentWindowColours[2] = w.colours[2].colour; w.onDraw(copy); } diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index a1272e7466..43a9e2b722 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -278,8 +278,6 @@ namespace OpenRCT2 extern uint32_t gWindowUpdateTicks; - extern Drawing::Colour gCurrentWindowColours[3]; - std::vector>::iterator WindowGetIterator(const WindowBase* w); void WindowVisitEach(std::function func); From 4bf86c6e6c96cb7a171bf51f9a6cadcdf3e178a6 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 4 Aug 2026 21:07:37 +0200 Subject: [PATCH 2/4] Move tile inspector constants to TileInspectorGlobals.h --- src/openrct2/interface/Window.h | 37 -------------------- src/openrct2/windows/TileInspectorGlobals.h | 38 +++++++++++++++++++++ 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 43a9e2b722..318b4a02b9 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -11,7 +11,6 @@ #include "../Identifiers.h" #include "../core/EnumUtils.hpp" -#include "../windows/TileInspectorGlobals.h" #include "Widget.h" #include "WindowClasses.h" #include "ZoomLevel.h" @@ -149,42 +148,6 @@ constexpr int32_t WC_TRACK_DESIGN_PLACE__WIDX_ROTATE = 3; constexpr int32_t WC_EDITOR_PARK_ENTRANCE__WIDX_ROTATE_ENTRANCE_BUTTON = 6; constexpr int32_t WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 = 22; constexpr int32_t WC_STAFF__WIDX_PICKUP = 9; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE = 15; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_COPY = 18; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE = 17; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_SORT = 16; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE = 12; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP = 13; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN = 14; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_X_INCREASE = 6; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_X_DECREASE = 7; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_Y_INCREASE = 10; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_Y_DECREASE = 11; -constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_SURFACE = EnumValue(TileInspectorPage::surface); -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SURFACE_SPINNER_HEIGHT_INCREASE = 29; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SURFACE_SPINNER_HEIGHT_DECREASE = 30; -constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_PATH = EnumValue(TileInspectorPage::path); -constexpr int32_t WC_TILE_INSPECTOR__WIDX_PATH_SPINNER_HEIGHT_INCREASE = 29; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_PATH_SPINNER_HEIGHT_DECREASE = 30; -constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_TRACK = EnumValue(TileInspectorPage::track); -constexpr int32_t WC_TILE_INSPECTOR__WIDX_TRACK_SPINNER_HEIGHT_INCREASE = 30; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_TRACK_SPINNER_HEIGHT_DECREASE = 31; -constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_SCENERY = EnumValue(TileInspectorPage::scenery); -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SCENERY_SPINNER_HEIGHT_INCREASE = 29; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_SCENERY_SPINNER_HEIGHT_DECREASE = 30; -constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_ENTRANCE = EnumValue(TileInspectorPage::entrance); -constexpr int32_t WC_TILE_INSPECTOR__WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE = 29; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE = 30; -constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_WALL = EnumValue(TileInspectorPage::wall); -constexpr int32_t WC_TILE_INSPECTOR__WIDX_WALL_SPINNER_HEIGHT_INCREASE = 29; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_WALL_SPINNER_HEIGHT_DECREASE = 30; -constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_LARGE_SCENERY = EnumValue(TileInspectorPage::largeScenery); -constexpr int32_t WC_TILE_INSPECTOR__WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE = 29; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE = 30; -constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_BANNER = EnumValue(TileInspectorPage::banner); -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BANNER_SPINNER_HEIGHT_INCREASE = 29; -constexpr int32_t WC_TILE_INSPECTOR__WIDX_BANNER_SPINNER_HEIGHT_DECREASE = 30; - enum class PromptMode : uint8_t { saveBeforeLoad = 0, diff --git a/src/openrct2/windows/TileInspectorGlobals.h b/src/openrct2/windows/TileInspectorGlobals.h index 572ca7a7a4..402bf0ad61 100644 --- a/src/openrct2/windows/TileInspectorGlobals.h +++ b/src/openrct2/windows/TileInspectorGlobals.h @@ -9,6 +9,8 @@ #pragma once +#include "../core/EnumUtils.hpp" + #include struct TileCoordsXY; @@ -29,3 +31,39 @@ enum class TileInspectorPage : int16_t extern TileCoordsXY windowTileInspectorTile; extern int32_t windowTileInspectorElementCount; extern int32_t windowTileInspectorSelectedIndex; + +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE = 15; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_COPY = 18; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE = 17; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_SORT = 16; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE = 12; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP = 13; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN = 14; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_X_INCREASE = 6; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_X_DECREASE = 7; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_Y_INCREASE = 10; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SPINNER_Y_DECREASE = 11; +constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_SURFACE = EnumValue(TileInspectorPage::surface); +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SURFACE_SPINNER_HEIGHT_INCREASE = 29; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SURFACE_SPINNER_HEIGHT_DECREASE = 30; +constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_PATH = EnumValue(TileInspectorPage::path); +constexpr int32_t WC_TILE_INSPECTOR__WIDX_PATH_SPINNER_HEIGHT_INCREASE = 29; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_PATH_SPINNER_HEIGHT_DECREASE = 30; +constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_TRACK = EnumValue(TileInspectorPage::track); +constexpr int32_t WC_TILE_INSPECTOR__WIDX_TRACK_SPINNER_HEIGHT_INCREASE = 30; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_TRACK_SPINNER_HEIGHT_DECREASE = 31; +constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_SCENERY = EnumValue(TileInspectorPage::scenery); +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SCENERY_SPINNER_HEIGHT_INCREASE = 29; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_SCENERY_SPINNER_HEIGHT_DECREASE = 30; +constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_ENTRANCE = EnumValue(TileInspectorPage::entrance); +constexpr int32_t WC_TILE_INSPECTOR__WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE = 29; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE = 30; +constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_WALL = EnumValue(TileInspectorPage::wall); +constexpr int32_t WC_TILE_INSPECTOR__WIDX_WALL_SPINNER_HEIGHT_INCREASE = 29; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_WALL_SPINNER_HEIGHT_DECREASE = 30; +constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_LARGE_SCENERY = EnumValue(TileInspectorPage::largeScenery); +constexpr int32_t WC_TILE_INSPECTOR__WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE = 29; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE = 30; +constexpr int32_t WC_TILE_INSPECTOR__TILE_INSPECTOR_PAGE_BANNER = EnumValue(TileInspectorPage::banner); +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BANNER_SPINNER_HEIGHT_INCREASE = 29; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BANNER_SPINNER_HEIGHT_DECREASE = 30; From 0f620b0714209970908c69d525173e77d2545189 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 4 Aug 2026 21:13:26 +0200 Subject: [PATCH 3/4] Remove Widget.h include from Window.h --- src/openrct2-ui/input/MouseInput.h | 1 + src/openrct2-ui/interface/Dropdown.h | 6 ++++-- src/openrct2-ui/interface/Theme.h | 2 ++ src/openrct2-ui/windows/Windows.h | 8 ++++++++ src/openrct2/interface/Window.h | 5 ++++- src/openrct2/interface/WindowBase.h | 1 + src/openrct2/paint/Painter.cpp | 1 + src/openrct2/ui/DummyWindowManager.cpp | 1 + src/openrct2/ui/WindowManager.h | 2 ++ 9 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/input/MouseInput.h b/src/openrct2-ui/input/MouseInput.h index b86dd3d61f..6a85c7b161 100644 --- a/src/openrct2-ui/input/MouseInput.h +++ b/src/openrct2-ui/input/MouseInput.h @@ -10,6 +10,7 @@ #pragma once #include +#include namespace OpenRCT2 { diff --git a/src/openrct2-ui/interface/Dropdown.h b/src/openrct2-ui/interface/Dropdown.h index bb435f2545..0ce9f09956 100644 --- a/src/openrct2-ui/interface/Dropdown.h +++ b/src/openrct2-ui/interface/Dropdown.h @@ -15,16 +15,18 @@ #include #include #include +#include +#include #include +#include #include #include -struct ImageId; - namespace OpenRCT2 { struct ColourWithFlags; class Formatter; + struct Widget; } // namespace OpenRCT2 namespace OpenRCT2::Dropdown diff --git a/src/openrct2-ui/interface/Theme.h b/src/openrct2-ui/interface/Theme.h index 88af897146..146a9bf8cd 100644 --- a/src/openrct2-ui/interface/Theme.h +++ b/src/openrct2-ui/interface/Theme.h @@ -9,7 +9,9 @@ #pragma once +#include #include +#include namespace OpenRCT2 { diff --git a/src/openrct2-ui/windows/Windows.h b/src/openrct2-ui/windows/Windows.h index 282e9b59d9..5ab77a6d4e 100644 --- a/src/openrct2-ui/windows/Windows.h +++ b/src/openrct2-ui/windows/Windows.h @@ -10,11 +10,14 @@ #pragma once #include +#include #include +#include #include #include #include +struct ScreenCoordsXY; struct StringWithArgs; struct Ride; struct RideSelection; @@ -36,6 +39,11 @@ namespace OpenRCT2 struct TileElement; } // namespace OpenRCT2 +namespace OpenRCT2::Drawing +{ + enum class Colour : uint8_t; +} + namespace OpenRCT2::Ui::Windows { constexpr int32_t kTabBarHeight = 43; diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 318b4a02b9..a6f1757e1d 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -11,7 +11,7 @@ #include "../Identifiers.h" #include "../core/EnumUtils.hpp" -#include "Widget.h" +#include "../core/FlagHolder.hpp" #include "WindowClasses.h" #include "ZoomLevel.h" @@ -20,6 +20,8 @@ enum class CloseWindowModifier : uint8_t; +struct CoordsXYZ; + namespace OpenRCT2::Drawing { struct RenderTarget; @@ -28,6 +30,7 @@ namespace OpenRCT2::Drawing namespace OpenRCT2 { using WindowNumber = int16_t; + using WidgetIndex = uint16_t; struct WindowBase; struct WindowCloseModifier; diff --git a/src/openrct2/interface/WindowBase.h b/src/openrct2/interface/WindowBase.h index 06eb9f856a..e6eede8782 100644 --- a/src/openrct2/interface/WindowBase.h +++ b/src/openrct2/interface/WindowBase.h @@ -13,6 +13,7 @@ #include "ColourWithFlags.h" #include "Cursors.h" #include "ScrollArea.h" +#include "Widget.h" #include "Window.h" #include diff --git a/src/openrct2/paint/Painter.cpp b/src/openrct2/paint/Painter.cpp index 59634477d6..a518588726 100644 --- a/src/openrct2/paint/Painter.cpp +++ b/src/openrct2/paint/Painter.cpp @@ -18,6 +18,7 @@ #include "../drawing/IDrawingEngine.h" #include "../drawing/Text.h" #include "../interface/Viewport.h" +#include "../interface/Widget.h" #include "../localisation/Formatting.h" #include "../paint/Paint.h" #include "../paint/VirtualFloor.h" diff --git a/src/openrct2/ui/DummyWindowManager.cpp b/src/openrct2/ui/DummyWindowManager.cpp index 35fc24ad6f..b986c1e47d 100644 --- a/src/openrct2/ui/DummyWindowManager.cpp +++ b/src/openrct2/ui/DummyWindowManager.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../interface/Widget.h" #include "WindowManager.h" namespace OpenRCT2::Ui diff --git a/src/openrct2/ui/WindowManager.h b/src/openrct2/ui/WindowManager.h index 78c40a3546..74f0de670e 100644 --- a/src/openrct2/ui/WindowManager.h +++ b/src/openrct2/ui/WindowManager.h @@ -10,7 +10,9 @@ #pragma once #include "../interface/Window.h" +#include "../localisation/StringIdType.h" #include "../windows/Intent.h" +#include "../world/Location.hpp" #include #include From 082994cd5266f2c3aac4fe09b5b265ac506e7e4c Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 4 Aug 2026 21:54:12 +0200 Subject: [PATCH 4/4] Move widget index globals into WidgetIndexGlobals.h --- src/openrct2-ui/input/Shortcuts.cpp | 1 + .../windows/EditorObjectSelection.cpp | 1 + .../windows/EditorParkEntrance.cpp | 1 + src/openrct2-ui/windows/Guest.cpp | 1 + src/openrct2-ui/windows/MazeConstruction.cpp | 1 + src/openrct2-ui/windows/RideConstruction.cpp | 1 + src/openrct2-ui/windows/Scenery.cpp | 1 + src/openrct2-ui/windows/Staff.cpp | 1 + src/openrct2-ui/windows/StaffList.cpp | 1 + src/openrct2-ui/windows/TrackDesignPlace.cpp | 1 + src/openrct2-ui/windows/TrackList.cpp | 1 + src/openrct2/interface/WidgetIndexGlobals.h | 43 +++++++++++++++++++ src/openrct2/interface/Window.cpp | 2 +- src/openrct2/interface/Window.h | 20 --------- src/openrct2/ride/Ride.cpp | 1 + src/openrct2/ride/RideConstruction.cpp | 1 + 16 files changed, 57 insertions(+), 21 deletions(-) create mode 100644 src/openrct2/interface/WidgetIndexGlobals.h diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 71165c3060..926d5148a8 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 5e0a0cef91..1e84cc0c1d 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 47a4777bd5..f4098c259d 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 73298df850..34a32b15af 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index e6cb0bec5e..de6fa71290 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 7ae0473558..1a3064a554 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 1047574764..d28e3f2438 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index c817263bed..e40c6806e2 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index b6502e9b7c..bebaf6ddcc 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 3cdf9e53eb..362c22c2db 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index a142828e17..1f233f7537 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2/interface/WidgetIndexGlobals.h b/src/openrct2/interface/WidgetIndexGlobals.h new file mode 100644 index 0000000000..ceac4cd57f --- /dev/null +++ b/src/openrct2/interface/WidgetIndexGlobals.h @@ -0,0 +1,43 @@ +/***************************************************************************** + * Copyright (c) 2014-2026 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 + +namespace OpenRCT2 +{ + constexpr int32_t WC_MAIN_WINDOW__0 = 0; + + constexpr int32_t WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT = 27; + constexpr int32_t WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE = 32; + constexpr int32_t WC_RIDE_CONSTRUCTION__WIDX_EXIT = 33; + constexpr int32_t WC_RIDE_CONSTRUCTION__WIDX_ROTATE = 34; + + constexpr int32_t WC_MAZE_CONSTRUCTION__WIDX_MAZE_DIRECTION_GROUPBOX = WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT; + constexpr int32_t WC_MAZE_CONSTRUCTION__WIDX_MAZE_ENTRANCE = WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE; + constexpr int32_t WC_MAZE_CONSTRUCTION__WIDX_MAZE_EXIT = WC_RIDE_CONSTRUCTION__WIDX_EXIT; + + constexpr int32_t WC_SCENERY__WIDX_SCENERY_BACKGROUND = 0; + constexpr int32_t WC_SCENERY__WIDX_SCENERY_TAB_1 = 15; + constexpr int32_t WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON = 5; + constexpr int32_t WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON = 10; + + constexpr int32_t WC_PEEP__WIDX_PATROL = 10; + constexpr int32_t WC_PEEP__WIDX_ACTION_LBL = 13; + constexpr int32_t WC_PEEP__WIDX_PICKUP = 14; + + constexpr int32_t WC_TRACK_DESIGN_LIST__WIDX_ROTATE = 8; + constexpr int32_t WC_TRACK_DESIGN_PLACE__WIDX_ROTATE = 3; + + constexpr int32_t WC_EDITOR_PARK_ENTRANCE__WIDX_ROTATE_ENTRANCE_BUTTON = 6; + constexpr int32_t WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 = 22; + + constexpr int32_t WC_STAFF__WIDX_PICKUP = 9; +} // namespace OpenRCT2 diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index be9ba8cf7d..9fedf0aae5 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -26,6 +26,7 @@ #include "../world/MapSelection.h" #include "Viewport.h" #include "Widget.h" +#include "WidgetIndexGlobals.h" #include "WindowBase.h" #include @@ -34,7 +35,6 @@ namespace OpenRCT2 { - std::vector> gWindowList; WindowBase* gWindowAudioExclusive; diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index a6f1757e1d..7dc558ee13 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -131,26 +131,6 @@ namespace OpenRCT2 #define VALIDATE_GLOBAL_WIDX(wc, widx) \ static_assert(widx == wc##__##widx, "Global WIDX of " #widx " doesn't match actual value.") -constexpr int32_t WC_MAIN_WINDOW__0 = 0; -constexpr int32_t WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT = 27; -constexpr int32_t WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE = 32; -constexpr int32_t WC_RIDE_CONSTRUCTION__WIDX_EXIT = 33; -constexpr int32_t WC_RIDE_CONSTRUCTION__WIDX_ROTATE = 34; -constexpr int32_t WC_MAZE_CONSTRUCTION__WIDX_MAZE_DIRECTION_GROUPBOX = WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT; -constexpr int32_t WC_MAZE_CONSTRUCTION__WIDX_MAZE_ENTRANCE = WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE; -constexpr int32_t WC_MAZE_CONSTRUCTION__WIDX_MAZE_EXIT = WC_RIDE_CONSTRUCTION__WIDX_EXIT; -constexpr int32_t WC_SCENERY__WIDX_SCENERY_BACKGROUND = 0; -constexpr int32_t WC_SCENERY__WIDX_SCENERY_TAB_1 = 15; -constexpr int32_t WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON = 5; -constexpr int32_t WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON = 10; -constexpr int32_t WC_PEEP__WIDX_PATROL = 10; -constexpr int32_t WC_PEEP__WIDX_ACTION_LBL = 13; -constexpr int32_t WC_PEEP__WIDX_PICKUP = 14; -constexpr int32_t WC_TRACK_DESIGN_LIST__WIDX_ROTATE = 8; -constexpr int32_t WC_TRACK_DESIGN_PLACE__WIDX_ROTATE = 3; -constexpr int32_t WC_EDITOR_PARK_ENTRANCE__WIDX_ROTATE_ENTRANCE_BUTTON = 6; -constexpr int32_t WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 = 22; -constexpr int32_t WC_STAFF__WIDX_PICKUP = 9; enum class PromptMode : uint8_t { saveBeforeLoad = 0, diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index f200c6fc6e..18dd3e4504 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -32,6 +32,7 @@ #include "../entity/Peep.h" #include "../entity/Staff.h" #include "../interface/Viewport.h" +#include "../interface/WidgetIndexGlobals.h" #include "../interface/WindowBase.h" #include "../localisation/Formatter.h" #include "../localisation/Formatting.h" diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index b47a126027..94218ab474 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -21,6 +21,7 @@ #include "../entity/EntityList.h" #include "../entity/EntityRegistry.h" #include "../entity/Staff.h" +#include "../interface/WidgetIndexGlobals.h" #include "../interface/WindowBase.h" #include "../localisation/Formatter.h" #include "../network/Network.h"