From 2e1fa5e644e5fb91f3ce072d1b8931eae94d5e00 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Fri, 12 Jul 2024 14:59:00 +0200 Subject: [PATCH] Move a few more strings to UiStringIds.h (#22257) * Replace more StringIds.h includes with StringIdType.h * Move a few more strings to UiStringIds.h * Tweak: TextComposition.cpp does not need InteractiveConsole.h --- src/openrct2-ui/TextComposition.cpp | 5 +---- src/openrct2-ui/UiContext.cpp | 3 --- src/openrct2-ui/UiStringIds.h | 13 +++++++++++++ src/openrct2-ui/input/ShortcutManager.h | 4 +--- src/openrct2-ui/interface/Dropdown.h | 4 ++-- src/openrct2-ui/interface/Widget.cpp | 2 ++ src/openrct2-ui/interface/Widget.h | 4 ++-- src/openrct2-ui/windows/About.cpp | 3 +++ src/openrct2-ui/windows/AssetPacks.cpp | 1 + src/openrct2-ui/windows/CustomCurrency.cpp | 1 + src/openrct2-ui/windows/GameBottomToolbar.cpp | 2 ++ src/openrct2-ui/windows/ObjectLoadError.cpp | 2 ++ src/openrct2-ui/windows/ShortcutKeys.cpp | 1 + src/openrct2-ui/windows/TextInput.cpp | 1 + src/openrct2-ui/windows/Themes.cpp | 1 + src/openrct2-ui/windows/TrackDesignManage.cpp | 1 + src/openrct2-ui/windows/ViewClipping.cpp | 1 + src/openrct2/interface/InteractiveConsole.cpp | 2 +- src/openrct2/localisation/StringIds.h | 18 +++++------------- 19 files changed, 41 insertions(+), 28 deletions(-) diff --git a/src/openrct2-ui/TextComposition.cpp b/src/openrct2-ui/TextComposition.cpp index 1477446bb6..834ab3bd68 100644 --- a/src/openrct2-ui/TextComposition.cpp +++ b/src/openrct2-ui/TextComposition.cpp @@ -18,11 +18,8 @@ #include #include #include -#include #include - -// TODO: only because of STR_NONE. We can do better. -#include +#include #ifdef __MACOSX__ // macOS uses COMMAND rather than CTRL for many keyboard shortcuts diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 5f9b6598ea..4cf02727ef 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -47,9 +47,6 @@ #include #include -// TODO: only because of STR_NONE. We can do better. -#include - using namespace OpenRCT2; using namespace OpenRCT2::Drawing; using namespace OpenRCT2::Scripting; diff --git a/src/openrct2-ui/UiStringIds.h b/src/openrct2-ui/UiStringIds.h index e87a8275c8..62ff44bbcd 100644 --- a/src/openrct2-ui/UiStringIds.h +++ b/src/openrct2-ui/UiStringIds.h @@ -258,7 +258,17 @@ namespace OpenRCT2 STR_SHORTCUT_ZOOM_VIEW_IN = 2498, STR_SHORTCUT_ZOOM_VIEW_OUT = 2497, + // Widgets + STR_CLOSE_X = 824, + STR_CLOSE_X_WHITE = 6164, + STR_DROPDOWN_GLYPH = 876, + STR_NUMERIC_DOWN = 1219, + STR_NUMERIC_UP = 1218, + STR_TOGGLE_OPTION = 1156, + STR_TOGGLE_OPTION_CHECKED = 1157, // Used as STR_TOGGLE_OPTION + 1 + // Window: About.cpp + STR_ABOUT = 847, STR_ABOUT_FAIRGROUND_ORGAN = 6588, STR_ABOUT_OPENRCT2_DESCRIPTION = 6137, STR_ABOUT_OPENRCT2_DESCRIPTION_2 = 6138, @@ -314,6 +324,7 @@ namespace OpenRCT2 STR_TEXT_COLOUR_YELLOW = 3001, // Window: Changelog + STR_CHANGELOG_TITLE = 5344, STR_CONTRIBUTORS_WINDOW = 6542, STR_NEW_RELEASE_DOWNLOAD_PAGE = 6383, STR_NEW_RELEASE_VERSION_INFO = 6382, @@ -1009,6 +1020,7 @@ namespace OpenRCT2 STR_OBJECT_ERROR_WINDOW_FILE = 6127, STR_OBJECT_LOAD_ERROR_TITLE = 6123, STR_OBJECT_NAME = 6124, + STR_OBJECT_SELECTION_PARK_ENTRANCE = 3192, STR_OBJECT_SOURCE = 6131, STR_OBJECT_TYPE = 6125, @@ -1359,6 +1371,7 @@ namespace OpenRCT2 STR_DIFFERENT_COLOURS_PER_VEHICLE = 1131, STR_DOING_CIRCUS_SHOW = 1117, STR_DOWN_TIME_LABEL_1889 = 1889, + STR_DROPDOWN_MENU_LABEL = 1142, STR_DROPDOWN_MENU_LABEL_SELECTED = 1143, STR_DROPS = 1355, STR_ENTER_NEW_NAME_FOR_THIS_RIDE_ATTRACTION = 1058, diff --git a/src/openrct2-ui/input/ShortcutManager.h b/src/openrct2-ui/input/ShortcutManager.h index 1fb9ffee81..6080bba589 100644 --- a/src/openrct2-ui/input/ShortcutManager.h +++ b/src/openrct2-ui/input/ShortcutManager.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -22,9 +23,6 @@ #include #include -// TODO: only because of STR_NONE. We can do better. -#include - namespace OpenRCT2 { struct IPlatformEnvironment; diff --git a/src/openrct2-ui/interface/Dropdown.h b/src/openrct2-ui/interface/Dropdown.h index 95a451c872..7b79d1dc80 100644 --- a/src/openrct2-ui/interface/Dropdown.h +++ b/src/openrct2-ui/interface/Dropdown.h @@ -9,13 +9,13 @@ #pragma once +#include #include #include #include #include -// TODO: only because of STR_EMPTY. We can do better. -#include +using namespace OpenRCT2; namespace Dropdown { diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 3a98d5a490..f7ca2652b5 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -10,6 +10,7 @@ #include "Widget.h" #include +#include #include #include #include @@ -18,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/src/openrct2-ui/interface/Widget.h b/src/openrct2-ui/interface/Widget.h index dafa430e49..b7f36d242a 100644 --- a/src/openrct2-ui/interface/Widget.h +++ b/src/openrct2-ui/interface/Widget.h @@ -11,11 +11,11 @@ #include "Window.h" +#include #include #include -// TODO: only because of STR_NONE. We can do better. -#include +using namespace OpenRCT2; ImageId GetColourButtonImage(colour_t colour); Widget* GetWidgetByIndex(const WindowBase& w, WidgetIndex widgetIndex); diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index dda4b6f2db..98fec8cd25 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -139,6 +140,7 @@ static Widget *_windowAboutPageWidgets[] = { // Draw tab names { + // TODO: this string shouldn't be reused for this tab auto ft = Formatter(); ft.Add(STR_TITLE_SEQUENCE_OPENRCT2); DrawTextWrapped( @@ -146,6 +148,7 @@ static Widget *_windowAboutPageWidgets[] = { { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); } { + // TODO: this string shouldn't be reused for this tab auto ft = Formatter(); ft.Add(STR_TITLE_SEQUENCE_RCT2); DrawTextWrapped( diff --git a/src/openrct2-ui/windows/AssetPacks.cpp b/src/openrct2-ui/windows/AssetPacks.cpp index fafe057c39..5d8c885bad 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index e0201b9f70..610160deda 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include #include #include #include diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index f4f48dbe88..697baa6ce4 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -359,6 +360,7 @@ static Widget window_game_bottom_toolbar_widgets[] = std::memcpy(&stringId, ft.Data(), sizeof(StringId)); if (stringId == STR_NONE) { + // TODO: this string probably shouldn't be reused for this DrawTextWrapped( dpi, middleWidgetCoords, panelWidth, STR_TITLE_SEQUENCE_OPENRCT2, ft, { colours[0], TextAlignment::CENTRE }); diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index 8852b03ee8..9cf689cc6c 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,7 @@ #include #include #include + namespace OpenRCT2::Ui::Windows { #ifndef DISABLE_HTTP diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index ca356659ca..079a6556b8 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 4730a1b6ad..99c0243096 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index bef54652d2..dcd919d64f 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 1a83ff86f7..b0ac202097 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 9a570dd4fb..70746c1f8d 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index d8e8baf738..9b4a18342b 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -483,7 +483,7 @@ static int32_t ConsoleCommandStaff(InteractiveConsole& console, const arguments_ { char costume_name[128] = { 0 }; StringId costume = StaffCostumeNames[i]; - OpenRCT2::FormatStringLegacy(costume_name, 128, STR_DROPDOWN_MENU_LABEL, &costume); + OpenRCT2::FormatStringLegacy(costume_name, 128, STR_STRINGID, &costume); // That's a terrible hack here. Costume names include inline sprites // that don't work well with the console, so manually skip past them. console.WriteFormatLine(" costume %i: %s", i, costume_name + 7); diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 2a6f266f25..955160a224 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -67,20 +67,17 @@ enum : StringId STR_MONTH_SHORT_NOV = 820, // Unused STR_MONTH_SHORT_DEC = 821, // Unused - STR_CLOSE_X = 824, STR_CHOSEN_NAME_IN_USE_ALREADY = 825, STR_TOO_MANY_NAMES_DEFINED = 826, STR_NOT_ENOUGH_CASH_REQUIRES = 827, - STR_ABOUT = 847, - // STR_0858 to 0864 are removed. STR_STRINGID = 865, STR_ARG_2_STRINGID = 866, // Unused STR_ARG_4_STRINGID = 867, // Unused STR_ARG_8_STRINGID = 869, // Unused STR_ARG_12_STRINGID = 871, - STR_DROPDOWN_GLYPH = 876, + STR_TOO_LOW = 877, STR_TOO_HIGH = 878, STR_CANT_LOWER_LAND_HERE = 879, @@ -177,13 +174,12 @@ enum : StringId STR_RIDE_MODE_CONTINUOUS_CIRCUIT_BLOCK_SECTIONED = 1095, STR_RIDE_MODE_POWERED_LAUNCH = 1096, STR_RIDE_MODE_POWERED_LAUNCH_BLOCK_SECTIONED_MODE = 1097, - STR_DROPDOWN_MENU_LABEL = 1142, + STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION = 1144, STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION = 1145, STR_ENTRANCE_NOT_YET_BUILT = 1146, STR_EXIT_NOT_YET_BUILT = 1147, - STR_TOGGLE_OPTION = 1156, - STR_TOGGLE_OPTION_CHECKED = 1157, // Used as STR_TOGGLE_OPTION + 1 + STR_CANT_REMOVE_THIS = 1158, STR_CANT_POSITION_THIS_HERE = 1161, STR_MAP_TOOLTIP_STRINGID_STRINGID = 1165, @@ -211,8 +207,7 @@ enum : StringId STR_QUEUE_EMPTY = 1201, STR_QUEUE_ONE_PERSON = 1202, STR_QUEUE_PEOPLE = 1203, - STR_NUMERIC_UP = 1218, - STR_NUMERIC_DOWN = 1219, + STR_RIDE_COMPONENT_TRAIN = 1229, STR_RIDE_COMPONENT_TRAIN_PLURAL = 1230, STR_RIDE_COMPONENT_TRAIN_CAPITALISED = 1231, @@ -1210,7 +1205,6 @@ enum : StringId STR_INVALID_SELECTION_OF_OBJECTS = 3180, STR_PARK_ENTRANCE_TYPE_MUST_BE_SELECTED = 3182, STR_WATER_TYPE_MUST_BE_SELECTED = 3183, - STR_OBJECT_SELECTION_PARK_ENTRANCE = 3192, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER = 3213, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER = 3214, @@ -1276,7 +1270,7 @@ enum : StringId STR_TITLE_SEQUENCE_RCT1_AA_LL = 5307, STR_TITLE_SEQUENCE_RCT2 = 5308, STR_TITLE_SEQUENCE_OPENRCT2 = 5309, - STR_CHANGELOG_TITLE = 5344, + STR_CHEAT_REMOVE_ALL_GUESTS = 5359, STR_CHEAT_GIVE_ALL_GUESTS = 5361, STR_CHEAT_STAFF_SPEED = 5365, @@ -1495,8 +1489,6 @@ enum : StringId STR_CONSOLE = 6157, - STR_CLOSE_X_WHITE = 6164, - STR_LITTER_VOMIT = 6188, STR_DUCK = 6189,