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
This commit is contained in:
Aaron van Geffen authored and GitHub committed 2024-07-12 14:59:00 +02:00
1 parent 0b011207dc
commit 2e1fa5e644
19 files changed
+41 -28

No files matched your search

+1 -4
View File
@@ -18,11 +18,8 @@
#include <openrct2/common.h>
#include <openrct2/core/Memory.hpp>
#include <openrct2/core/String.hpp>
#include <openrct2/interface/InteractiveConsole.h>
#include <openrct2/localisation/Language.h>
// TODO: only because of STR_NONE. We can do better.
#include <openrct2/localisation/StringIds.h>
#include <openrct2/localisation/StringIdType.h>
#ifdef __MACOSX__
// macOS uses COMMAND rather than CTRL for many keyboard shortcuts
-3
View File
@@ -47,9 +47,6 @@
#include <openrct2/world/Location.hpp>
#include <vector>
// TODO: only because of STR_NONE. We can do better.
#include <openrct2/localisation/StringIds.h>
using namespace OpenRCT2;
using namespace OpenRCT2::Drawing;
using namespace OpenRCT2::Scripting;
+13
View File
@@ -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,
+1 -3
View File
@@ -15,6 +15,7 @@
#include <functional>
#include <memory>
#include <openrct2/core/FileSystem.hpp>
#include <openrct2/localisation/StringIdType.h>
#include <optional>
#include <string>
#include <string_view>
@@ -22,9 +23,6 @@
#include <utility>
#include <vector>
// TODO: only because of STR_NONE. We can do better.
#include <openrct2/localisation/StringIds.h>
namespace OpenRCT2
{
struct IPlatformEnvironment;
+2 -2
View File
@@ -9,13 +9,13 @@
#pragma once
#include <openrct2-ui/UiStringIds.h>
#include <openrct2-ui/interface/Window.h>
#include <openrct2/common.h>
#include <openrct2/drawing/ImageId.hpp>
#include <openrct2/util/Util.h>
// TODO: only because of STR_EMPTY. We can do better.
#include <openrct2/localisation/StringIds.h>
using namespace OpenRCT2;
namespace Dropdown
{
+2
View File
@@ -10,6 +10,7 @@
#include "Widget.h"
#include <cmath>
#include <openrct2-ui/UiStringIds.h>
#include <openrct2/Context.h>
#include <openrct2/Game.h>
#include <openrct2/Input.h>
@@ -18,6 +19,7 @@
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Formatting.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/sprites.h>
#include <openrct2/util/Util.h>
+2 -2
View File
@@ -11,11 +11,11 @@
#include "Window.h"
#include <openrct2-ui/UiStringIds.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/interface/Widget.h>
// TODO: only because of STR_NONE. We can do better.
#include <openrct2/localisation/StringIds.h>
using namespace OpenRCT2;
ImageId GetColourButtonImage(colour_t colour);
Widget* GetWidgetByIndex(const WindowBase& w, WidgetIndex widgetIndex);
+3
View File
@@ -17,6 +17,7 @@
#include <openrct2/Version.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/sprites.h>
#include <openrct2/ui/UiContext.h>
@@ -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<StringId>(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<StringId>(STR_TITLE_SEQUENCE_RCT2);
DrawTextWrapped(
+1
View File
@@ -17,6 +17,7 @@
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Text.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/object/ObjectManager.h>
#include <openrct2/sprites.h>
@@ -7,6 +7,7 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include <openrct2-ui/UiStringIds.h>
#include <openrct2-ui/interface/Dropdown.h>
#include <openrct2-ui/interface/Widget.h>
#include <openrct2-ui/windows/Window.h>
@@ -23,6 +23,7 @@
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/management/Finance.h>
#include <openrct2/management/NewsItem.h>
#include <openrct2/peep/PeepAnimationData.h>
@@ -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 });
@@ -19,6 +19,7 @@
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Formatting.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/object/ObjectList.h>
#include <openrct2/object/ObjectManager.h>
#include <openrct2/object/ObjectRepository.h>
@@ -28,6 +29,7 @@
#include <sstream>
#include <string>
#include <vector>
namespace OpenRCT2::Ui::Windows
{
#ifndef DISABLE_HTTP
+1
View File
@@ -15,6 +15,7 @@
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/sprites.h>
namespace OpenRCT2::Ui::Windows
+1
View File
@@ -17,6 +17,7 @@
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/util/Util.h>
namespace OpenRCT2::Ui::Windows
+1
View File
@@ -18,6 +18,7 @@
#include <openrct2/drawing/Text.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/platform/Platform.h>
#include <openrct2/sprites.h>
@@ -13,6 +13,7 @@
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/platform/Platform.h>
#include <openrct2/ride/TrackDesignRepository.h>
+1
View File
@@ -16,6 +16,7 @@
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/paint/Paint.h>
#include <openrct2/sprites.h>
#include <openrct2/world/Location.hpp>
@@ -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);
+5 -13
View File
@@ -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,