From 2f68c7e82307e4f804435cf002049bb35a39540a Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Wed, 15 May 2024 20:29:11 +0200 Subject: [PATCH] Move STR_NONE, STR_EMPTY to StringIdType.h (#22019) --- src/openrct2-ui/input/ShortcutInput.cpp | 1 + src/openrct2-ui/input/ShortcutManager.h | 1 - src/openrct2/actions/GameActionResult.h | 1 - src/openrct2/actions/ResultWithMessage.h | 1 - src/openrct2/common.h | 3 +-- src/openrct2/localisation/Language.cpp | 1 - src/openrct2/localisation/Localisation.cpp | 1 + src/openrct2/localisation/StringIdType.h | 17 +++++++++++++++++ src/openrct2/localisation/StringIds.h | 3 --- .../paint/tile_element/Paint.Banner.cpp | 1 + .../paint/tile_element/Paint.LargeScenery.cpp | 1 + src/openrct2/paint/tile_element/Paint.Path.cpp | 1 + src/openrct2/paint/tile_element/Paint.Wall.cpp | 1 + src/openrct2/ride/RideData.h | 1 + 14 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 src/openrct2/localisation/StringIdType.h diff --git a/src/openrct2-ui/input/ShortcutInput.cpp b/src/openrct2-ui/input/ShortcutInput.cpp index 3df2c7466c..60fad93b65 100644 --- a/src/openrct2-ui/input/ShortcutInput.cpp +++ b/src/openrct2-ui/input/ShortcutInput.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include using namespace OpenRCT2; diff --git a/src/openrct2-ui/input/ShortcutManager.h b/src/openrct2-ui/input/ShortcutManager.h index 29e63e9470..7612a99e29 100644 --- a/src/openrct2-ui/input/ShortcutManager.h +++ b/src/openrct2-ui/input/ShortcutManager.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h index 15b17bbfd9..77dae0978b 100644 --- a/src/openrct2/actions/GameActionResult.h +++ b/src/openrct2/actions/GameActionResult.h @@ -8,7 +8,6 @@ *****************************************************************************/ #pragma once -#include "../localisation/StringIds.h" #include "../management/Finance.h" #include "../world/Location.hpp" diff --git a/src/openrct2/actions/ResultWithMessage.h b/src/openrct2/actions/ResultWithMessage.h index fd01d8e6c1..6a66e4980a 100644 --- a/src/openrct2/actions/ResultWithMessage.h +++ b/src/openrct2/actions/ResultWithMessage.h @@ -10,7 +10,6 @@ #pragma once #include "../common.h" -#include "../localisation/StringIds.h" struct ResultWithMessage { diff --git a/src/openrct2/common.h b/src/openrct2/common.h index f3b616a1fa..14a2f3dea1 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -21,6 +21,7 @@ #endif #include "Diagnostic.h" +#include "localisation/StringIdType.h" #include #include @@ -38,8 +39,6 @@ using datetime64 = uint64_t; constexpr datetime64 DATETIME64_MIN = 0; -using StringId = uint16_t; - #define abstract = 0 #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) diff --git a/src/openrct2/localisation/Language.cpp b/src/openrct2/localisation/Language.cpp index 4114c85a64..4bf4e9ada2 100644 --- a/src/openrct2/localisation/Language.cpp +++ b/src/openrct2/localisation/Language.cpp @@ -18,7 +18,6 @@ #include "LanguagePack.h" #include "Localisation.h" #include "LocalisationService.h" -#include "StringIds.h" #include diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index c2b65bbf7a..8f0fc19af5 100644 --- a/src/openrct2/localisation/Localisation.cpp +++ b/src/openrct2/localisation/Localisation.cpp @@ -20,6 +20,7 @@ #include "Date.h" #include "FormatCodes.h" #include "Formatting.h" +#include "StringIds.h" #include diff --git a/src/openrct2/localisation/StringIdType.h b/src/openrct2/localisation/StringIdType.h new file mode 100644 index 0000000000..1537f842a3 --- /dev/null +++ b/src/openrct2/localisation/StringIdType.h @@ -0,0 +1,17 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 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 + +using StringId = uint16_t; + +constexpr StringId STR_NONE = 0xFFFF; +constexpr StringId STR_EMPTY = 0; diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 2f9ea0671f..82f39e674e 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -11,11 +11,8 @@ #include "../common.h" -constexpr StringId STR_NONE = 0xFFFF; - enum : uint16_t { - STR_EMPTY = 0, STR_RIDE_NAME_DEFAULT = 1, STR_RIDE_NAME_1D = 31, STR_RIDE_NAME_1F = 33, diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index 5d0e2de1be..55462983bd 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -16,6 +16,7 @@ #include "../../localisation/Formatter.h" #include "../../localisation/Formatting.h" #include "../../localisation/Localisation.h" +#include "../../localisation/StringIds.h" #include "../../object/BannerObject.h" #include "../../object/ObjectEntryManager.h" #include "../../profiling/Profiling.h" diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index f84992f69b..05320a6d98 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -18,6 +18,7 @@ #include "../../localisation/Formatter.h" #include "../../localisation/Formatting.h" #include "../../localisation/Localisation.h" +#include "../../localisation/StringIds.h" #include "../../object/LargeSceneryObject.h" #include "../../profiling/Profiling.h" #include "../../ride/Ride.h" diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index f29eabe920..88718c4e75 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -19,6 +19,7 @@ #include "../../localisation/Formatter.h" #include "../../localisation/Formatting.h" #include "../../localisation/Localisation.h" +#include "../../localisation/StringIds.h" #include "../../object/FootpathObject.h" #include "../../object/FootpathRailingsObject.h" #include "../../object/FootpathSurfaceObject.h" diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index 25b7445fb3..59037ab768 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -18,6 +18,7 @@ #include "../../interface/Viewport.h" #include "../../localisation/Formatting.h" #include "../../localisation/Localisation.h" +#include "../../localisation/StringIds.h" #include "../../object/WallSceneryEntry.h" #include "../../profiling/Profiling.h" #include "../../ride/Track.h" diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index d02afe75df..0f876308f0 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -23,6 +23,7 @@ #include "../common.h" #include "../core/BitSet.hpp" #include "../entity/Guest.h" +#include "../localisation/StringIds.h" #include "../sprites.h" #include "../util/Util.h" #include "Ride.h"