From d3fd31c61199435108f442967c4cc2af3e4eb321 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 31 Jul 2022 14:22:58 +0200 Subject: [PATCH] Rename rct_string_id to StringId --- src/openrct2-ui/WindowManager.cpp | 2 +- src/openrct2-ui/input/MouseInput.cpp | 4 +- src/openrct2-ui/input/ShortcutInput.cpp | 4 +- src/openrct2-ui/input/ShortcutManager.h | 9 +- src/openrct2-ui/interface/Dropdown.h | 14 +- src/openrct2-ui/interface/Graph.cpp | 2 +- src/openrct2-ui/interface/Theme.cpp | 6 +- src/openrct2-ui/interface/Theme.h | 2 +- .../interface/ViewportInteraction.cpp | 62 ++++---- src/openrct2-ui/interface/Widget.cpp | 2 +- src/openrct2-ui/interface/Window.cpp | 4 +- src/openrct2-ui/interface/Window.h | 4 +- src/openrct2-ui/scripting/CustomListView.cpp | 8 +- src/openrct2-ui/windows/About.cpp | 6 +- src/openrct2-ui/windows/Banner.cpp | 4 +- src/openrct2-ui/windows/Changelog.cpp | 2 +- src/openrct2-ui/windows/Cheats.cpp | 10 +- src/openrct2-ui/windows/ClearScenery.cpp | 2 +- src/openrct2-ui/windows/CustomCurrency.cpp | 4 +- src/openrct2-ui/windows/Dropdown.cpp | 2 +- .../windows/EditorBottomToolbar.cpp | 6 +- .../windows/EditorInventionsList.cpp | 36 ++--- .../windows/EditorObjectSelection.cpp | 44 +++--- .../windows/EditorObjectiveOptions.cpp | 16 +-- .../windows/EditorScenarioOptions.cpp | 10 +- src/openrct2-ui/windows/Error.cpp | 2 +- src/openrct2-ui/windows/Finances.cpp | 18 +-- src/openrct2-ui/windows/Footpath.cpp | 2 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 29 ++-- src/openrct2-ui/windows/Guest.cpp | 30 ++-- src/openrct2-ui/windows/GuestList.cpp | 28 ++-- src/openrct2-ui/windows/InstallTrack.cpp | 8 +- src/openrct2-ui/windows/Land.cpp | 2 +- src/openrct2-ui/windows/LandRights.cpp | 2 +- src/openrct2-ui/windows/LoadSave.cpp | 22 +-- src/openrct2-ui/windows/Map.cpp | 4 +- src/openrct2-ui/windows/MapGen.cpp | 2 +- src/openrct2-ui/windows/MapTooltip.cpp | 8 +- src/openrct2-ui/windows/MazeConstruction.cpp | 4 +- src/openrct2-ui/windows/Multiplayer.cpp | 8 +- src/openrct2-ui/windows/NewCampaign.cpp | 2 +- src/openrct2-ui/windows/NewRide.cpp | 14 +- src/openrct2-ui/windows/News.cpp | 6 +- src/openrct2-ui/windows/NewsOptions.cpp | 4 +- src/openrct2-ui/windows/ObjectLoadError.cpp | 10 +- src/openrct2-ui/windows/Options.cpp | 24 ++-- src/openrct2-ui/windows/Park.cpp | 16 +-- src/openrct2-ui/windows/PatrolArea.cpp | 2 +- src/openrct2-ui/windows/Player.cpp | 6 +- src/openrct2-ui/windows/Research.cpp | 46 +++--- src/openrct2-ui/windows/Ride.cpp | 132 +++++++++--------- src/openrct2-ui/windows/RideConstruction.cpp | 18 +-- src/openrct2-ui/windows/RideList.cpp | 14 +- src/openrct2-ui/windows/SavePrompt.cpp | 4 +- src/openrct2-ui/windows/ScenarioSelect.cpp | 42 +++--- src/openrct2-ui/windows/Scenery.cpp | 16 +-- src/openrct2-ui/windows/ServerList.cpp | 10 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 20 +-- src/openrct2-ui/windows/Sign.cpp | 2 +- src/openrct2-ui/windows/Staff.cpp | 2 +- src/openrct2-ui/windows/StaffFirePrompt.cpp | 2 +- src/openrct2-ui/windows/StaffList.cpp | 12 +- src/openrct2-ui/windows/TextInput.cpp | 14 +- src/openrct2-ui/windows/Themes.cpp | 2 +- src/openrct2-ui/windows/TileInspector.cpp | 71 +++++----- src/openrct2-ui/windows/TopToolbar.cpp | 4 +- src/openrct2-ui/windows/TrackDesignManage.cpp | 2 +- src/openrct2-ui/windows/TrackDesignPlace.cpp | 2 +- src/openrct2-ui/windows/TrackList.cpp | 16 +-- src/openrct2-ui/windows/Transparency.cpp | 2 +- src/openrct2-ui/windows/ViewClipping.cpp | 2 +- src/openrct2-ui/windows/Viewport.cpp | 2 +- src/openrct2-ui/windows/Water.cpp | 2 +- src/openrct2-ui/windows/Window.h | 10 +- src/openrct2/Context.cpp | 2 +- src/openrct2/Context.h | 2 +- src/openrct2/Editor.cpp | 2 +- src/openrct2/Editor.h | 2 +- src/openrct2/EditorObjectSelectionSession.cpp | 4 +- src/openrct2/EditorObjectSelectionSession.h | 2 +- src/openrct2/actions/ClearAction.cpp | 2 +- src/openrct2/actions/GameActionResult.cpp | 4 +- src/openrct2/actions/GameActionResult.h | 4 +- src/openrct2/actions/LandBuyRightsAction.h | 2 +- src/openrct2/actions/LandSetHeightAction.cpp | 6 +- src/openrct2/actions/LandSetHeightAction.h | 4 +- src/openrct2/actions/LandSmoothAction.cpp | 3 +- src/openrct2/actions/LandSmoothAction.h | 2 +- src/openrct2/actions/ParkSetParameterAction.h | 2 +- src/openrct2/actions/ResultWithMessage.h | 2 +- src/openrct2/actions/RideSetSettingAction.cpp | 2 +- src/openrct2/actions/RideSetSettingAction.h | 2 +- src/openrct2/actions/RideSetStatusAction.cpp | 2 +- src/openrct2/actions/RideSetVehicleAction.cpp | 2 +- src/openrct2/actions/WaterSetHeightAction.cpp | 4 +- src/openrct2/actions/WaterSetHeightAction.h | 2 +- src/openrct2/common.h | 2 +- src/openrct2/drawing/Drawing.String.cpp | 4 +- src/openrct2/drawing/Drawing.h | 7 +- src/openrct2/drawing/NewDrawing.cpp | 2 +- src/openrct2/drawing/NewDrawing.h | 2 +- src/openrct2/drawing/ScrollingText.cpp | 6 +- src/openrct2/drawing/Text.cpp | 16 +-- src/openrct2/drawing/Text.h | 12 +- src/openrct2/entity/Guest.cpp | 12 +- src/openrct2/entity/Litter.cpp | 4 +- src/openrct2/entity/Litter.h | 2 +- src/openrct2/entity/MoneyEffect.cpp | 8 +- src/openrct2/entity/MoneyEffect.h | 2 +- src/openrct2/entity/Peep.cpp | 80 ++++++----- src/openrct2/entity/Peep.h | 2 +- src/openrct2/entity/Staff.cpp | 2 +- src/openrct2/entity/Staff.h | 2 +- src/openrct2/interface/InteractiveConsole.cpp | 4 +- src/openrct2/interface/Screenshot.cpp | 2 +- src/openrct2/interface/Widget.h | 14 +- src/openrct2/interface/Window.cpp | 4 +- src/openrct2/interface/Window.h | 10 +- src/openrct2/interface/Window_internal.h | 2 +- src/openrct2/localisation/Currency.h | 2 +- src/openrct2/localisation/Date.h | 4 +- src/openrct2/localisation/Formatter.h | 4 +- src/openrct2/localisation/Formatting.cpp | 18 +-- src/openrct2/localisation/Formatting.h | 16 +-- src/openrct2/localisation/Language.cpp | 8 +- src/openrct2/localisation/Language.h | 8 +- src/openrct2/localisation/LanguagePack.cpp | 14 +- src/openrct2/localisation/LanguagePack.h | 10 +- .../localisation/Localisation.Date.cpp | 4 +- src/openrct2/localisation/Localisation.cpp | 22 +-- src/openrct2/localisation/Localisation.h | 26 ++-- .../localisation/LocalisationService.cpp | 13 +- .../localisation/LocalisationService.h | 13 +- src/openrct2/localisation/StringIds.h | 4 +- src/openrct2/management/Award.cpp | 2 +- src/openrct2/management/Marketing.cpp | 2 +- src/openrct2/management/NewsItem.cpp | 4 +- src/openrct2/management/NewsItem.h | 4 +- src/openrct2/management/Research.cpp | 20 +-- src/openrct2/management/Research.h | 6 +- src/openrct2/network/NetworkAction.h | 2 +- src/openrct2/network/NetworkBase.cpp | 8 +- src/openrct2/network/NetworkBase.h | 2 +- src/openrct2/network/NetworkConnection.cpp | 2 +- src/openrct2/network/NetworkConnection.h | 2 +- src/openrct2/network/ServerList.h | 4 +- src/openrct2/network/network.h | 2 +- src/openrct2/object/FootpathRailingsObject.h | 2 +- src/openrct2/object/FootpathSurfaceObject.h | 2 +- src/openrct2/object/MusicObject.h | 2 +- src/openrct2/object/ObjectManager.cpp | 4 +- src/openrct2/object/ObjectManager.h | 2 +- src/openrct2/object/ObjectRepository.cpp | 2 +- src/openrct2/object/StationObject.h | 2 +- src/openrct2/object/TerrainEdgeObject.h | 2 +- src/openrct2/object/TerrainSurfaceObject.h | 2 +- src/openrct2/paint/Paint.cpp | 2 +- src/openrct2/paint/Paint.h | 4 +- .../paint/tile_element/Paint.Entrance.cpp | 8 +- .../paint/tile_element/Paint.Path.cpp | 4 +- src/openrct2/rct1/RCT1.h | 24 ++-- src/openrct2/rct1/S4Importer.cpp | 8 +- src/openrct2/rct12/RCT12.cpp | 2 +- src/openrct2/rct12/RCT12.h | 4 +- src/openrct2/rct2/RCT2.h | 38 ++--- src/openrct2/rct2/S6Importer.cpp | 4 +- src/openrct2/ride/Ride.cpp | 56 ++++---- src/openrct2/ride/Ride.h | 2 +- src/openrct2/ride/RideData.cpp | 2 +- src/openrct2/ride/RideData.h | 16 +-- src/openrct2/ride/RideEntry.h | 6 +- src/openrct2/ride/ShopItem.h | 10 +- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 2 +- src/openrct2/ride/TrackDesign.cpp | 8 +- src/openrct2/ride/TrackDesign.h | 8 +- src/openrct2/ride/TrackDesignSave.cpp | 6 +- src/openrct2/ride/Vehicle.cpp | 10 +- src/openrct2/scenario/Scenario.cpp | 4 +- src/openrct2/scenario/Scenario.h | 4 +- src/openrct2/title/TitleSequenceManager.cpp | 4 +- src/openrct2/ui/DummyWindowManager.cpp | 2 +- src/openrct2/ui/WindowManager.h | 2 +- src/openrct2/world/Banner.cpp | 10 +- src/openrct2/world/ConstructionClearance.cpp | 12 +- src/openrct2/world/Entrance.h | 8 +- src/openrct2/world/Footpath.h | 6 +- src/openrct2/world/Scenery.h | 4 +- src/openrct2/world/Water.h | 2 +- test/tests/FormattingTests.cpp | 12 +- 190 files changed, 879 insertions(+), 890 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index acd3d8a70a..86eecfdb22 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -201,7 +201,7 @@ public: } } - rct_window* ShowError(rct_string_id title, rct_string_id message, const Formatter& args) override + rct_window* ShowError(StringId title, StringId message, const Formatter& args) override { return WindowErrorOpen(title, message, args); } diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 4a36dd3490..582781a5a7 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -1085,7 +1085,7 @@ void ProcessMouseOver(const ScreenCoordsXY& screenCoords) CursorID cursorId = CursorID::Arrow; auto ft = Formatter(); - ft.Add(STR_NONE); + ft.Add(STR_NONE); SetMapTooltip(ft); window = window_find_from_point(screenCoords); @@ -1370,7 +1370,7 @@ void InputStateWidgetPressed( gDropdownLastColourHover = dropdown_index; WindowTooltipClose(); - static constexpr const rct_string_id _colourTooltips[] = { + static constexpr const StringId _colourTooltips[] = { STR_COLOUR_BLACK_TIP, STR_COLOUR_GREY_TIP, STR_COLOUR_WHITE_TIP, diff --git a/src/openrct2-ui/input/ShortcutInput.cpp b/src/openrct2-ui/input/ShortcutInput.cpp index 42abd6f8da..0f4e33e06d 100644 --- a/src/openrct2-ui/input/ShortcutInput.cpp +++ b/src/openrct2-ui/input/ShortcutInput.cpp @@ -189,7 +189,7 @@ ShortcutInput::ShortcutInput(std::string_view value) std::string_view ShortcutInput::GetModifierName(uint32_t key, bool localised) { - static std::unordered_map> _keys{ + static std::unordered_map> _keys{ { KMOD_SHIFT, { "SHIFT", STR_SHORTCUT_MOD_SHIFT } }, { KMOD_LSHIFT, { "LSHIFT", STR_SHORTCUT_MOD_LSHIFT } }, { KMOD_RSHIFT, { "RSHIFT", STR_SHORTCUT_MOD_RSHIFT } }, { KMOD_CTRL, { "CTRL", STR_SHORTCUT_MOD_CTRL } }, { KMOD_LCTRL, { "LCTRL", STR_SHORTCUT_MOD_LCTRL } }, { KMOD_RCTRL, { "RCTRL", STR_SHORTCUT_MOD_RCTRL } }, @@ -214,7 +214,7 @@ std::string_view ShortcutInput::GetModifierName(uint32_t key, bool localised) std::string_view ShortcutInput::GetLocalisedKeyName(uint32_t key) { - static std::unordered_map _keys{ + static std::unordered_map _keys{ { SDLK_LEFT, STR_SHORTCUT_LEFT }, { SDLK_RIGHT, STR_SHORTCUT_RIGHT }, { SDLK_UP, STR_SHORTCUT_UP }, diff --git a/src/openrct2-ui/input/ShortcutManager.h b/src/openrct2-ui/input/ShortcutManager.h index 2b7e12f3f4..d4a3ef7acc 100644 --- a/src/openrct2-ui/input/ShortcutManager.h +++ b/src/openrct2-ui/input/ShortcutManager.h @@ -57,7 +57,7 @@ namespace OpenRCT2::Ui { public: std::string Id; - rct_string_id LocalisedName = STR_NONE; + StringId LocalisedName = STR_NONE; std::string CustomName; std::vector Default; std::vector Current; @@ -71,7 +71,7 @@ namespace OpenRCT2::Ui { } - RegisteredShortcut(std::string_view id, rct_string_id localisedName, const std::function& action) + RegisteredShortcut(std::string_view id, StringId localisedName, const std::function& action) : Id(id) , LocalisedName(localisedName) , Action(action) @@ -79,8 +79,7 @@ namespace OpenRCT2::Ui } RegisteredShortcut( - std::string_view id, rct_string_id localisedName, std::string_view defaultChord, - const std::function& action) + std::string_view id, StringId localisedName, std::string_view defaultChord, const std::function& action) : Id(id) , LocalisedName(localisedName) , Default({ defaultChord }) @@ -90,7 +89,7 @@ namespace OpenRCT2::Ui } RegisteredShortcut( - std::string_view id, rct_string_id localisedName, std::string_view defaultChordA, std::string_view defaultChordB, + std::string_view id, StringId localisedName, std::string_view defaultChordA, std::string_view defaultChordB, const std::function& action) : Id(id) , LocalisedName(localisedName) diff --git a/src/openrct2-ui/interface/Dropdown.h b/src/openrct2-ui/interface/Dropdown.h index ccc6de666f..b5d73e1f54 100644 --- a/src/openrct2-ui/interface/Dropdown.h +++ b/src/openrct2-ui/interface/Dropdown.h @@ -18,9 +18,9 @@ namespace Dropdown { struct Item; - constexpr const rct_string_id SeparatorString = 0; - constexpr const rct_string_id FormatColourPicker = 0xFFFE; - constexpr const rct_string_id FormatLandPicker = 0xFFFF; + constexpr const StringId SeparatorString = 0; + constexpr const StringId FormatColourPicker = 0xFFFE; + constexpr const StringId FormatLandPicker = 0xFFFF; constexpr const int32_t ItemsMaxSize = 512; enum Flag @@ -67,7 +67,7 @@ namespace Dropdown struct Item { - rct_string_id Format; + StringId Format; int64_t Args; uint8_t Flags; @@ -89,7 +89,7 @@ namespace Dropdown struct ItemExt { - constexpr ItemExt(int32_t _expectedItemIndex, uint32_t _itemFormat, rct_string_id _stringId) + constexpr ItemExt(int32_t _expectedItemIndex, uint32_t _itemFormat, StringId _stringId) : expectedItemIndex(_expectedItemIndex) , itemFormat(_itemFormat) , stringId(_stringId) @@ -98,10 +98,10 @@ namespace Dropdown int32_t expectedItemIndex; uint32_t itemFormat; - rct_string_id stringId; + StringId stringId; }; - constexpr ItemExt ToggleOption(int32_t _expectedItemIndex, rct_string_id _stringId) + constexpr ItemExt ToggleOption(int32_t _expectedItemIndex, StringId _stringId) { return ItemExt(_expectedItemIndex, STR_TOGGLE_OPTION, _stringId); } diff --git a/src/openrct2-ui/interface/Graph.cpp b/src/openrct2-ui/interface/Graph.cpp index 7bd9923cbc..c47186da09 100644 --- a/src/openrct2-ui/interface/Graph.cpp +++ b/src/openrct2-ui/interface/Graph.cpp @@ -164,7 +164,7 @@ namespace Graph { // Draw month text auto ft = Formatter(); - ft.Add(DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]); + ft.Add(DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]); DrawTextBasic( dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft, { FontSpriteBase::SMALL, TextAlignment::CENTRE }); diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 510cad0f6f..b5cc6e9b9c 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -96,7 +96,7 @@ struct WindowThemeDesc { rct_windowclass WindowClass; const utf8* WindowClassSZ; - rct_string_id WindowName; + StringId WindowName; uint8_t NumColours; WindowTheme DefaultTheme; }; @@ -232,7 +232,7 @@ const UITheme PredefinedThemeRCT2 = UITheme::CreatePredefined("*RCT2", Predefine struct PredefinedTheme { const UITheme* Theme; - rct_string_id Name; + StringId Name; }; static constexpr const PredefinedTheme PredefinedThemes[] = { @@ -859,7 +859,7 @@ uint8_t ThemeDescGetNumColours(rct_windowclass wc) return desc->NumColours; } -rct_string_id ThemeDescGetName(rct_windowclass wc) +StringId ThemeDescGetName(rct_windowclass wc) { const WindowThemeDesc* desc = GetWindowThemeDescriptor(wc); if (desc == nullptr) diff --git a/src/openrct2-ui/interface/Theme.h b/src/openrct2-ui/interface/Theme.h index 84405135ec..e17025c4bb 100644 --- a/src/openrct2-ui/interface/Theme.h +++ b/src/openrct2-ui/interface/Theme.h @@ -45,4 +45,4 @@ void ThemeDuplicate(const utf8* name); void ThemeDelete(); uint8_t ThemeDescGetNumColours(rct_windowclass wc); -rct_string_id ThemeDescGetName(rct_windowclass wc); +StringId ThemeDescGetName(rct_windowclass wc); diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 7b65b6dc1c..21aecb0514 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -128,7 +128,7 @@ InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoord auto parkName = park.Name.c_str(); auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(parkName); SetMapTooltip(ft); break; @@ -280,7 +280,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor if (ride != nullptr && ride->status == RideStatus::Closed) { auto ft = Formatter(); - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); ride->FormatNameTo(ft); SetMapTooltip(ft); } @@ -310,11 +310,11 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor return info; auto ft = Formatter(); - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); if (tileElement->GetType() == TileElementType::Entrance) { - rct_string_id stringId; + StringId stringId; if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) { if (ride->num_stations > 1) @@ -337,11 +337,11 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor stringId = STR_RIDE_EXIT; } } - ft.Add(stringId); + ft.Add(stringId); } else if (tileElement->AsTrack()->IsStation()) { - rct_string_id stringId; + StringId stringId; if (ride->num_stations > 1) { stringId = STR_RIDE_STATION_X; @@ -350,7 +350,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor { stringId = STR_RIDE_STATION; } - ft.Add(stringId); + ft.Add(stringId); } else { @@ -368,7 +368,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor ride->FormatNameTo(ft); const auto& rtd = ride->GetRideTypeDescriptor(); - ft.Add(GetRideComponentName(rtd.NameConvention.station).capitalised); + ft.Add(GetRideComponentName(rtd.NameConvention.station).capitalised); StationIndex::UnderlyingType stationIndex; if (tileElement->GetType() == TileElementType::Entrance) @@ -393,10 +393,10 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor if (banner != nullptr) { auto ft = Formatter(); - ft.Add(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID); + ft.Add(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID); banner->FormatTextTo(ft); - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); - ft.Add(wallEntry->name); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); + ft.Add(wallEntry->name); SetMapTooltip(ft); return info; } @@ -412,10 +412,10 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor if (banner != nullptr) { auto ft = Formatter(); - ft.Add(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID); + ft.Add(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID); banner->FormatTextTo(ft); - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); - ft.Add(sceneryEntry->name); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); + ft.Add(sceneryEntry->name); SetMapTooltip(ft); return info; } @@ -430,10 +430,10 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor auto* bannerEntry = get_banner_entry(banner->type); auto ft = Formatter(); - ft.Add(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID); + ft.Add(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID); banner->FormatTextTo(ft, /*addColour*/ true); - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); - ft.Add(bannerEntry->name); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); + ft.Add(bannerEntry->name); SetMapTooltip(ft); return info; } @@ -458,29 +458,29 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor case ViewportInteractionItem::Scenery: { auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); - ft.Add(sceneryEntry->name); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); + ft.Add(sceneryEntry->name); SetMapTooltip(ft); return info; } case ViewportInteractionItem::Footpath: - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); if (tileElement->AsPath()->IsQueue()) - ft.Add(STR_QUEUE_LINE_MAP_TIP); + ft.Add(STR_QUEUE_LINE_MAP_TIP); else - ft.Add(STR_FOOTPATH_MAP_TIP); + ft.Add(STR_FOOTPATH_MAP_TIP); SetMapTooltip(ft); return info; case ViewportInteractionItem::FootpathItem: { auto* pathAddEntry = tileElement->AsPath()->GetAdditionEntry(); - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); if (tileElement->AsPath()->IsBroken()) { - ft.Add(STR_BROKEN); + ft.Add(STR_BROKEN); } - ft.Add(pathAddEntry != nullptr ? pathAddEntry->name : STR_NONE); + ft.Add(pathAddEntry != nullptr ? pathAddEntry->name : STR_NONE); SetMapTooltip(ft); return info; } @@ -491,24 +491,24 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor if (tileElement->GetType() != TileElementType::Entrance) break; - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); - ft.Add(STR_OBJECT_SELECTION_PARK_ENTRANCE); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); + ft.Add(STR_OBJECT_SELECTION_PARK_ENTRANCE); SetMapTooltip(ft); return info; case ViewportInteractionItem::Wall: { auto* wallEntry = tileElement->AsWall()->GetEntry(); - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); - ft.Add(wallEntry->name); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); + ft.Add(wallEntry->name); SetMapTooltip(ft); return info; } case ViewportInteractionItem::LargeScenery: { auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); - ft.Add(sceneryEntry->name); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE); + ft.Add(sceneryEntry->name); SetMapTooltip(ft); return info; } diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index e5769457a0..d72903517e 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -443,7 +443,7 @@ static void WidgetTextInset(rct_drawpixelinfo* dpi, rct_window& w, rct_widgetind WidgetText(dpi, w, widgetIndex); } -static std::pair WidgetGetStringidAndArgs(const rct_widget& widget) +static std::pair WidgetGetStringidAndArgs(const rct_widget& widget) { auto stringId = widget.text; void* formatArgs = gCommonFormatArgs; diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 8a2c327d40..66822abd06 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -753,8 +753,8 @@ void Window::Close() } void Window::TextInputOpen( - rct_widgetindex callWidget, rct_string_id title, rct_string_id description, const Formatter& descriptionArgs, - rct_string_id existingText, uintptr_t existingArgs, int32_t maxLength) + rct_widgetindex callWidget, StringId title, StringId description, const Formatter& descriptionArgs, StringId existingText, + uintptr_t existingArgs, int32_t maxLength) { WindowTextInputOpen(this, callWidget, title, description, descriptionArgs, existingText, existingArgs, maxLength); } diff --git a/src/openrct2-ui/interface/Window.h b/src/openrct2-ui/interface/Window.h index a4265c2933..27af63ab83 100644 --- a/src/openrct2-ui/interface/Window.h +++ b/src/openrct2-ui/interface/Window.h @@ -28,8 +28,8 @@ struct Window : rct_window void DrawWidgets(rct_drawpixelinfo& dpi); void Close(); void TextInputOpen( - rct_widgetindex callWidget, rct_string_id title, rct_string_id description, const Formatter& descriptionArgs, - rct_string_id existingText, uintptr_t existingArgs, int32_t maxLength); + rct_widgetindex callWidget, StringId title, StringId description, const Formatter& descriptionArgs, + StringId existingText, uintptr_t existingArgs, int32_t maxLength); }; void WindowAllWheelInput(); diff --git a/src/openrct2-ui/scripting/CustomListView.cpp b/src/openrct2-ui/scripting/CustomListView.cpp index e2b94983bf..9d85eb9f09 100644 --- a/src/openrct2-ui/scripting/CustomListView.cpp +++ b/src/openrct2-ui/scripting/CustomListView.cpp @@ -681,13 +681,13 @@ void CustomListView::PaintHeading( if (sortOrder == ColumnSortOrder::Ascending) { auto ft = Formatter(); - ft.Add(STR_UP); + ft.Add(STR_UP); DrawTextBasic(dpi, pos + ScreenCoordsXY{ size.width - 1, 0 }, STR_BLACK_STRING, ft, { TextAlignment::RIGHT }); } else if (sortOrder == ColumnSortOrder::Descending) { auto ft = Formatter(); - ft.Add(STR_DOWN); + ft.Add(STR_DOWN); DrawTextBasic(dpi, pos + ScreenCoordsXY{ size.width - 1, 0 }, STR_BLACK_STRING, ft, { TextAlignment::RIGHT }); } } @@ -754,10 +754,10 @@ void CustomListView::PaintSeperator( void CustomListView::PaintCell( rct_drawpixelinfo* dpi, const ScreenCoordsXY& pos, const ScreenSize& size, const char* text, bool isHighlighted) const { - rct_string_id stringId = isHighlighted ? STR_WINDOW_COLOUR_2_STRINGID : STR_BLACK_STRING; + StringId stringId = isHighlighted ? STR_WINDOW_COLOUR_2_STRINGID : STR_BLACK_STRING; auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(text); DrawTextEllipsised(dpi, pos, size.width, stringId, ft, {}); } diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index 7d2366a465..7469dd486f 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -23,7 +23,7 @@ using namespace OpenRCT2; static constexpr const int32_t WW = 400; static constexpr const int32_t WH = 352; -static constexpr const rct_string_id WINDOW_TITLE = STR_ABOUT; +static constexpr const StringId WINDOW_TITLE = STR_ABOUT; static constexpr const int32_t TABHEIGHT = 50; // clang-format off @@ -138,13 +138,13 @@ public: // Draw tab names { auto ft = Formatter(); - ft.Add(STR_TITLE_SEQUENCE_OPENRCT2); + ft.Add(STR_TITLE_SEQUENCE_OPENRCT2); DrawTextWrapped( &dpi, aboutOpenRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); } { auto ft = Formatter(); - ft.Add(STR_TITLE_SEQUENCE_RCT2); + ft.Add(STR_TITLE_SEQUENCE_RCT2); DrawTextWrapped( &dpi, aboutRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); } diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 62cf6aa163..ccd9e7b231 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -23,7 +23,7 @@ static constexpr const int32_t WW = 113; static constexpr const int32_t WH = 96; -static constexpr const rct_string_id WINDOW_TITLE = STR_BANNER_WINDOW_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_BANNER_WINDOW_TITLE; // clang-format off enum WindowBannerWidgetIdx { @@ -39,7 +39,7 @@ enum WindowBannerWidgetIdx { WIDX_TEXT_COLOUR_DROPDOWN_BUTTON }; -static constexpr const rct_string_id BannerColouredTextFormats[] = { +static constexpr const StringId BannerColouredTextFormats[] = { STR_TEXT_COLOR_BLACK, STR_TEXT_COLOR_GREY, STR_TEXT_COLOR_WHITE, diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 80a02dee82..0778749563 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -38,7 +38,7 @@ enum { static constexpr const int32_t WW = 500; static constexpr const int32_t WH = 400; -static constexpr const rct_string_id WINDOW_TITLE = STR_CHANGELOG_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_CHANGELOG_TITLE; constexpr int32_t MIN_WW = 300; constexpr int32_t MIN_WH = 250; diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 6024725715..ea53d8ec33 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -41,14 +41,14 @@ enum WINDOW_CHEATS_PAGE_COUNT, }; -static rct_string_id _staffSpeedNames[] = +static StringId _staffSpeedNames[] = { STR_FROZEN, STR_NORMAL, STR_FAST, }; -static constexpr const rct_string_id WeatherTypes[] = +static constexpr const StringId WeatherTypes[] = { STR_SUNNY, STR_PARTIALLY_CLOUDY, @@ -175,7 +175,7 @@ enum WindowCheatsWidgetIdx #pragma region MEASUREMENTS -static constexpr const rct_string_id WINDOW_TITLE = STR_CHEAT_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_CHEAT_TITLE; static constexpr const int32_t WW = 249; static constexpr const int32_t WH = 300; @@ -338,7 +338,7 @@ static uint64_t window_cheats_page_hold_down_widgets[] = { 0, }; -static rct_string_id window_cheats_page_titles[] = { +static StringId window_cheats_page_titles[] = { STR_CHEAT_TITLE_FINANCIAL, STR_CHEAT_TITLE_GUEST, STR_CHEAT_TITLE_PARK, @@ -590,7 +590,7 @@ public: } } - OpenRCT2String OnTooltip(rct_widgetindex widgetIndex, rct_string_id fallback) override + OpenRCT2String OnTooltip(rct_widgetindex widgetIndex, StringId fallback) override { if (page == WINDOW_CHEATS_PAGE_RIDES && widgetIndex == WIDX_UNLOCK_OPERATING_LIMITS) { diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index c89e66b77d..27698420fd 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -30,7 +30,7 @@ enum WindowClearSceneryWidgetIdx WIDX_FOOTPATH }; // clang-format on -static constexpr const rct_string_id WINDOW_TITLE = STR_CLEAR_SCENERY; +static constexpr const StringId WINDOW_TITLE = STR_CLEAR_SCENERY; static constexpr const int32_t WW = 98; static constexpr const int32_t WH = 94; diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 5786424a84..1371b290d1 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -18,7 +18,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_CUSTOM_CURRENCY_WINDOW_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_CUSTOM_CURRENCY_WINDOW_TITLE; static constexpr const int32_t WH = 100; static constexpr const int32_t WW = 400; @@ -216,7 +216,7 @@ public: auto drawPos = windowPos + ScreenCoordsXY{ window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1, window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].top }; - rct_string_id stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) + StringId stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) ? STR_PREFIX : STR_SUFFIX; DrawTextBasic(&dpi, drawPos, stringId, {}, { colours[1] }); diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 64f8c3cbec..37ee17c0ec 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -179,7 +179,7 @@ public: gfx_filter_rect(&dpi, { screenCoords, rightBottom }, FilterPaletteID::PaletteDarken3); } - rct_string_id item = gDropdownItems[i].Format; + StringId item = gDropdownItems[i].Format; if (item == Dropdown::FormatLandPicker || item == Dropdown::FormatColourPicker) { // Image item diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 5273f79e51..de3cb5f1b3 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -49,7 +49,7 @@ class EditorBottomToolbarWindow final : public Window private: using FuncPtr = void (EditorBottomToolbarWindow::*)() const; - static constexpr const rct_string_id _editorStepNames[] = { + static constexpr const StringId _editorStepNames[] = { STR_EDITOR_STEP_OBJECT_SELECTION, STR_EDITOR_STEP_LANDSCAPE_EDITOR, STR_EDITOR_STEP_INVENTIONS_LIST_SET_UP, STR_EDITOR_STEP_OPTIONS_SELECTION, STR_EDITOR_STEP_OBJECTIVE_SELECTION, STR_EDITOR_STEP_SAVE_SCENARIO, STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER, STR_EDITOR_STEP_TRACK_DESIGNS_MANAGER, @@ -306,7 +306,7 @@ private: int16_t textX = (widgets[WIDX_PREVIOUS_IMAGE].left + 30 + widgets[WIDX_PREVIOUS_IMAGE].right) / 2 + windowPos.x; int16_t textY = widgets[WIDX_PREVIOUS_IMAGE].top + 6 + windowPos.y; - rct_string_id stringId = _editorStepNames[EnumValue(gEditorStep) - 1]; + StringId stringId = _editorStepNames[EnumValue(gEditorStep) - 1]; if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) stringId = STR_EDITOR_STEP_OBJECT_SELECTION; @@ -343,7 +343,7 @@ private: int16_t textX = (widgets[WIDX_NEXT_IMAGE].left + widgets[WIDX_NEXT_IMAGE].right - 30) / 2 + windowPos.x; int16_t textY = widgets[WIDX_NEXT_IMAGE].top + 6 + windowPos.y; - rct_string_id stringId = _editorStepNames[EnumValue(gEditorStep) + 1]; + StringId stringId = _editorStepNames[EnumValue(gEditorStep) + 1]; if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) stringId = STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER; diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 831ea94251..4b4429dcfe 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -29,7 +29,7 @@ static constexpr const int32_t WW = 600; static constexpr const int32_t WH = 400; -static constexpr const rct_string_id WINDOW_TITLE = STR_INVENTION_LIST; +static constexpr const StringId WINDOW_TITLE = STR_INVENTION_LIST; // clang-format off enum { @@ -94,24 +94,24 @@ static void ResearchRidesSetup() } } -static std::pair WindowEditorInventionsListPrepareName(const ResearchItem& researchItem, bool withGap) +static std::pair WindowEditorInventionsListPrepareName(const ResearchItem& researchItem, bool withGap) { - rct_string_id drawString; - rct_string_id stringId = researchItem.GetName(); + StringId drawString; + StringId stringId = researchItem.GetName(); auto ft = Formatter(); if (researchItem.type == Research::EntryType::Ride && !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) { drawString = withGap ? STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME_DRAG : STR_WINDOW_COLOUR_2_STRINGID_STRINGID; - rct_string_id rideTypeName = get_ride_naming(researchItem.baseRideType, get_ride_entry(researchItem.entryIndex)).Name; - ft.Add(rideTypeName); - ft.Add(stringId); + StringId rideTypeName = get_ride_naming(researchItem.baseRideType, get_ride_entry(researchItem.entryIndex)).Name; + ft.Add(rideTypeName); + ft.Add(stringId); } else { drawString = STR_WINDOW_COLOUR_2_STRINGID; - ft.Add(stringId); + ft.Add(stringId); } return std::make_pair(drawString, ft); @@ -305,24 +305,24 @@ public: colour = colours[1] | COLOUR_FLAG_INSET; } - const rct_string_id itemNameId = researchItem.GetName(); + const StringId itemNameId = researchItem.GetName(); if (researchItem.type == Research::EntryType::Ride && !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) { const auto rideEntry = get_ride_entry(researchItem.entryIndex); - const rct_string_id rideTypeName = get_ride_naming(researchItem.baseRideType, rideEntry).Name; + const StringId rideTypeName = get_ride_naming(researchItem.baseRideType, rideEntry).Name; // Draw group name auto ft = Formatter(); - ft.Add(rideTypeName); + ft.Add(rideTypeName); DrawTextEllipsised( &dpi, { 1, itemY }, columnSplitOffset - 11, STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME, ft, { colour, fontSpriteBase }); // Draw vehicle name ft = Formatter(); - ft.Add(itemNameId); + ft.Add(itemNameId); DrawTextEllipsised( &dpi, { columnSplitOffset + 1, itemY }, columnSplitOffset - 11, STR_BLACK_STRING, ft, { colour, fontSpriteBase }); @@ -331,7 +331,7 @@ public: { // Scenery group, flat ride or shop auto ft = Formatter(); - ft.Add(itemNameId); + ft.Add(itemNameId); DrawTextEllipsised(&dpi, { 1, itemY }, boxWidth, STR_BLACK_STRING, ft, { colour, fontSpriteBase }); } } @@ -429,7 +429,7 @@ public: // Item category screenPos.x = windowPos.x + widgets[WIDX_RESEARCH_ORDER_SCROLL].right + 4; ft = Formatter(); - ft.Add(researchItem->GetCategoryInventionString()); + ft.Add(researchItem->GetCategoryInventionString()); DrawTextBasic(&dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, ft); } @@ -640,16 +640,16 @@ public: void Init(ResearchItem& researchItem) { _draggedItem = researchItem; - rct_string_id stringId = researchItem.GetName(); + StringId stringId = researchItem.GetName(); char buffer[256] = {}; if (researchItem.type == Research::EntryType::Ride && !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) { const auto rideEntry = get_ride_entry(researchItem.entryIndex); - const rct_string_id rideTypeName = get_ride_naming(researchItem.baseRideType, rideEntry).Name; + const StringId rideTypeName = get_ride_naming(researchItem.baseRideType, rideEntry).Name; Formatter ft; - ft.Add(stringId); - ft.Add(rideTypeName); + ft.Add(stringId); + ft.Add(rideTypeName); format_string(buffer, 256, STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME, &ft); } else diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 7a411d5750..9c6025ca5a 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -115,13 +115,13 @@ static char _filter_string[MAX_PATH]; #define _FILTER_SELECTED (_filter_flags & FILTER_SELECTED) #define _FILTER_NONSELECTED (_filter_flags & FILTER_NONSELECTED) -static constexpr const rct_string_id WINDOW_TITLE = STR_OBJECT_SELECTION; +static constexpr const StringId WINDOW_TITLE = STR_OBJECT_SELECTION; static constexpr const int32_t WH = 400; static constexpr const int32_t WW = 755; struct ObjectPageDesc { - rct_string_id Caption; + StringId Caption; uint32_t Image; bool IsAdvanced; }; @@ -240,7 +240,7 @@ static constexpr const int32_t window_editor_object_selection_animation_divisor[ 2, // Stall }; -static rct_string_id GetRideTypeStringId(const ObjectRepositoryItem* item); +static StringId GetRideTypeStringId(const ObjectRepositoryItem* item); static bool VisibleListSortRideType(const ObjectListItem& a, const ObjectListItem& b); static bool VisibleListSortRideName(const ObjectListItem& a, const ObjectListItem& b); void EditorLoadSelectedObjects(); @@ -617,8 +617,8 @@ public: const auto objectSelectResult = window_editor_object_selection_select_object(0, inputFlags, listItem->repositoryItem); if (!objectSelectResult.Successful) { - rct_string_id error_title = (inputFlags & INPUT_FLAG_EDITOR_OBJECT_SELECT) ? STR_UNABLE_TO_SELECT_THIS_OBJECT - : STR_UNABLE_TO_DE_SELECT_THIS_OBJECT; + StringId error_title = (inputFlags & INPUT_FLAG_EDITOR_OBJECT_SELECT) ? STR_UNABLE_TO_SELECT_THIS_OBJECT + : STR_UNABLE_TO_DE_SELECT_THIS_OBJECT; context_show_error(error_title, objectSelectResult.Message, {}); return; @@ -751,7 +751,7 @@ public: { width_limit /= 2; // Draw ride type - rct_string_id rideTypeStringId = GetRideTypeStringId(listItem.repositoryItem); + StringId rideTypeStringId = GetRideTypeStringId(listItem.repositoryItem); safe_strcpy(buffer, language_get_string(rideTypeStringId), 256 - (buffer - bufferWithColour)); auto ft = Formatter(); ft.Add(gCommonStringFormatBuffer); @@ -780,12 +780,12 @@ public: * * rct2: 0x006AB058 */ - OpenRCT2String OnTooltip(const rct_widgetindex widgetIndex, const rct_string_id fallback) override + OpenRCT2String OnTooltip(const rct_widgetindex widgetIndex, const StringId fallback) override { if (widgetIndex >= WIDX_TAB_1 && static_cast(widgetIndex) < WIDX_TAB_1 + std::size(ObjectSelectionPages)) { auto ft = Formatter(); - ft.Add(ObjectSelectionPages[(widgetIndex - WIDX_TAB_1)].Caption); + ft.Add(ObjectSelectionPages[(widgetIndex - WIDX_TAB_1)].Caption); return { fallback, ft }; } return { fallback, {} }; @@ -843,7 +843,7 @@ public: // Set window title and buttons auto ft = Formatter::Common(); - ft.Add(ObjectSelectionPages[selected_tab].Caption); + ft.Add(ObjectSelectionPages[selected_tab].Caption); auto& titleWidget = widgets[WIDX_TITLE]; auto& installTrackWidget = widgets[WIDX_INSTALL_TRACK]; if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) @@ -1034,10 +1034,9 @@ public: if (listSortTypeWidget.type != WindowWidgetType::Empty) { auto ft = Formatter(); - auto stringId = _listSortType == RIDE_SORT_TYPE - ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) - : STR_NONE; - ft.Add(stringId); + auto stringId = _listSortType == RIDE_SORT_TYPE ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) + : STR_NONE; + ft.Add(stringId); auto screenPos = windowPos + ScreenCoordsXY{ listSortTypeWidget.left + 1, listSortTypeWidget.top + 1 }; DrawTextEllipsised(&dpi, screenPos, listSortTypeWidget.width(), STR_OBJECTS_SORT_TYPE, ft, { colours[1] }); } @@ -1045,10 +1044,9 @@ public: if (listSortRideWidget.type != WindowWidgetType::Empty) { auto ft = Formatter(); - auto stringId = _listSortType == RIDE_SORT_RIDE - ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) - : STR_NONE; - ft.Add(stringId); + auto stringId = _listSortType == RIDE_SORT_RIDE ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) + : STR_NONE; + ft.Add(stringId); auto screenPos = windowPos + ScreenCoordsXY{ listSortRideWidget.left + 1, listSortRideWidget.top + 1 }; DrawTextEllipsised(&dpi, screenPos, listSortRideWidget.width(), STR_OBJECTS_SORT_RIDE, ft, { colours[1] }); } @@ -1075,7 +1073,7 @@ public: auto screenPos = windowPos + ScreenCoordsXY{ previewWidget.midX() + 1, previewWidget.bottom + 3 }; _width = this->width - widgets[WIDX_LIST].right - 6; auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(listItem->repositoryItem->Name.c_str()); DrawTextEllipsised(&dpi, screenPos, _width, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); } @@ -1201,7 +1199,7 @@ private: if (!description.empty()) { auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(description.c_str()); screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_WINDOW_COLOUR_2_STRINGID, ft) + LIST_ROW_HEIGHT; @@ -1277,7 +1275,7 @@ private: { auto path = Path::GetFileName(listItem->repositoryItem->Path); auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(path.c_str()); DrawTextBasic( dpi, { windowPos.x + this->width - 5, screenPos.y }, STR_WINDOW_COLOUR_2_STRINGID, ft, @@ -1297,7 +1295,7 @@ private: } authorsString.append(listItem->repositoryItem->Authors[i]); } - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(authorsString.c_str()); DrawTextEllipsised( dpi, { windowPos.x + width - 5, screenPos.y }, width - widgets[WIDX_LIST].right - 4, @@ -1536,9 +1534,9 @@ static bool VisibleListSortRideType(const ObjectListItem& a, const ObjectListIte return result != 0 ? result < 0 : VisibleListSortRideName(a, b); } -static rct_string_id GetRideTypeStringId(const ObjectRepositoryItem* item) +static StringId GetRideTypeStringId(const ObjectRepositoryItem* item) { - rct_string_id result = STR_NONE; + StringId result = STR_NONE; for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) { uint8_t rideType = item->RideInfo.RideType[i]; diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 7df01198d4..88c1058942 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -33,7 +33,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_OBJECTIVE_SELECTION; +static constexpr const StringId WINDOW_TITLE = STR_OBJECTIVE_SELECTION; static constexpr const int32_t WH = 229; static constexpr const int32_t WW = 450; @@ -46,7 +46,7 @@ enum { WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_COUNT }; -static constexpr const rct_string_id ObjectiveDropdownOptionNames[] = { +static constexpr const StringId ObjectiveDropdownOptionNames[] = { STR_OBJECTIVE_DROPDOWN_NONE, STR_OBJECTIVE_DROPDOWN_NUMBER_OF_GUESTS_AT_A_GIVEN_DATE, STR_OBJECTIVE_DROPDOWN_PARK_VALUE_AT_A_GIVEN_DATE, @@ -770,7 +770,7 @@ static void WindowEditorObjectiveOptionsMainInvalidate(rct_window* w) static void WindowEditorObjectiveOptionsMainPaint(rct_window* w, rct_drawpixelinfo* dpi) { int32_t width; - rct_string_id stringId; + StringId stringId; WindowDrawWidgets(*w, dpi); WindowEditorObjectiveOptionsDrawTabImages(w, dpi); @@ -782,7 +782,7 @@ static void WindowEditorObjectiveOptionsMainPaint(rct_window* w, rct_drawpixelin // Objective value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE].left + 1, w->widgets[WIDX_OBJECTIVE].top }; auto ft = Formatter(); - ft.Add(ObjectiveDropdownOptionNames[gScenarioObjective.Type]); + ft.Add(ObjectiveDropdownOptionNames[gScenarioObjective.Type]); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); if (w->widgets[WIDX_OBJECTIVE_ARG_1].type != WindowWidgetType::Empty) @@ -871,7 +871,7 @@ static void WindowEditorObjectiveOptionsMainPaint(rct_window* w, rct_drawpixelin auto parkName = park.Name.c_str(); ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(parkName); DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_PARK_NAME, ft); } @@ -881,7 +881,7 @@ static void WindowEditorObjectiveOptionsMainPaint(rct_window* w, rct_drawpixelin width = w->widgets[WIDX_SCENARIO_NAME].left - 16; ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(gScenarioName.c_str()); DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft); @@ -894,7 +894,7 @@ static void WindowEditorObjectiveOptionsMainPaint(rct_window* w, rct_drawpixelin width = w->widgets[WIDX_DETAILS].left - 4; ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(gScenarioDetails.c_str()); DrawTextWrapped(dpi, screenCoords, width, STR_BLACK_STRING, ft); @@ -905,7 +905,7 @@ static void WindowEditorObjectiveOptionsMainPaint(rct_window* w, rct_drawpixelin // Scenario category value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CATEGORY].left + 1, w->widgets[WIDX_CATEGORY].top }; ft = Formatter(); - ft.Add(ScenarioCategoryStringIds[gScenarioCategory]); + ft.Add(ScenarioCategoryStringIds[gScenarioCategory]); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 35090294a9..8d1d8ec54d 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -48,7 +48,7 @@ enum { WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_COUNT }; -static constexpr const rct_string_id ClimateNames[] = { +static constexpr const StringId ClimateNames[] = { STR_CLIMATE_COOL_AND_WET, STR_CLIMATE_WARM, STR_CLIMATE_HOT_AND_DRY, @@ -1300,11 +1300,11 @@ static void WindowEditorScenarioOptionsParkPaint(rct_window* w, rct_drawpixelinf auto ft = Formatter(); // Pay for park and/or rides value if (gParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES) - ft.Add(STR_PAID_ENTRY_PAID_RIDES); + ft.Add(STR_PAID_ENTRY_PAID_RIDES); else if (gParkFlags & PARK_FLAGS_PARK_FREE_ENTRY) - ft.Add(STR_FREE_PARK_ENTER); + ft.Add(STR_FREE_PARK_ENTER); else - ft.Add(STR_PAY_PARK_ENTER); + ft.Add(STR_PAY_PARK_ENTER); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } @@ -1331,7 +1331,7 @@ static void WindowEditorScenarioOptionsParkPaint(rct_window* w, rct_drawpixelinf // Climate value screenCoords = w->windowPos + ScreenCoordsXY{ climateWidget.left + 1, climateWidget.top }; auto ft = Formatter(); - ft.Add(ClimateNames[static_cast(gClimate)]); + ft.Add(ClimateNames[static_cast(gClimate)]); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index 5046a9dca2..ffe65a7ccd 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -48,7 +48,7 @@ static uint16_t _window_error_num_lines; * bx: title * dx: message */ -rct_window* WindowErrorOpen(rct_string_id title, rct_string_id message, const Formatter& args) +rct_window* WindowErrorOpen(StringId title, StringId message, const Formatter& args) { auto titlez = format_string(title, args.Data()); auto messagez = format_string(message, args.Data()); diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 8a1f008328..efd8e7d54c 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -179,7 +179,7 @@ static_assert(std::size(_windowFinancesPageWidgets) == WINDOW_FINANCES_PAGE_COUN #pragma endregion -static constexpr const rct_string_id _windowFinancesSummaryRowLabels[static_cast(ExpenditureType::Count)] = { +static constexpr const StringId _windowFinancesSummaryRowLabels[static_cast(ExpenditureType::Count)] = { STR_FINANCES_SUMMARY_RIDE_CONSTRUCTION, STR_FINANCES_SUMMARY_RIDE_RUNNING_COSTS, STR_FINANCES_SUMMARY_LAND_PURCHASE, @@ -390,7 +390,7 @@ public: // Month heading auto ft = Formatter(); - ft.Add(STR_FINANCES_SUMMARY_MONTH_HEADING); + ft.Add(STR_FINANCES_SUMMARY_MONTH_HEADING); ft.Add(monthyear); DrawTextBasic( &dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, @@ -406,8 +406,8 @@ public: if (expenditure != 0) { profit += expenditure; - const rct_string_id format = expenditure >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE - : STR_FINANCES_SUMMARY_EXPENDITURE_VALUE; + const StringId format = expenditure >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE + : STR_FINANCES_SUMMARY_EXPENDITURE_VALUE; ft = Formatter(); ft.Add(expenditure); DrawTextBasic( @@ -419,7 +419,7 @@ public: screenCoords.y += 4; // Month profit - const rct_string_id format = profit >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE : STR_FINANCES_SUMMARY_LOSS_VALUE; + const StringId format = profit >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE : STR_FINANCES_SUMMARY_LOSS_VALUE; ft = Formatter(); ft.Add(profit); DrawTextBasic( @@ -551,7 +551,7 @@ public: // Current cash ft = Formatter(); ft.Add(gCash); - rct_string_id stringId = gCash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL; + StringId stringId = gCash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL; DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 8, 294 }, stringId, ft); // Objective related financial information @@ -828,18 +828,18 @@ public: } else { - ft.Add(STR_NONE); + ft.Add(STR_NONE); } break; } case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE: - ft.Add(GetShopItemDescriptor(marketingCampaign->ShopItemType).Naming.Plural); + ft.Add(GetShopItemDescriptor(marketingCampaign->ShopItemType).Naming.Plural); break; default: { auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); auto parkName = park.Name.c_str(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(parkName); } } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 85f3a69a6a..061583bc9d 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -31,7 +31,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_FOOTPATHS; +static constexpr const StringId WINDOW_TITLE = STR_FOOTPATHS; static constexpr const int32_t WH = 421; static constexpr const int32_t WW = 106; static constexpr const uint16_t ARROW_PULSE_DURATION = 200; diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 08d5b70c6b..4b54d3ed68 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -70,7 +70,7 @@ static rct_widget window_game_bottom_toolbar_widgets[] = uint8_t gToolbarDirtyFlags; static void WindowGameBottomToolbarMouseup(rct_window *w, rct_widgetindex widgetIndex); -static OpenRCT2String WindowGameBottomToolbarTooltip(rct_window* w, const rct_widgetindex widgetIndex, const rct_string_id fallback); +static OpenRCT2String WindowGameBottomToolbarTooltip(rct_window* w, const rct_widgetindex widgetIndex, const StringId fallback); static void WindowGameBottomToolbarInvalidate(rct_window *w); static void WindowGameBottomToolbarPaint(rct_window *w, rct_drawpixelinfo *dpi); static void WindowGameBottomToolbarUpdate(rct_window* w); @@ -188,8 +188,7 @@ static void WindowGameBottomToolbarMouseup(rct_window* w, rct_widgetindex widget } } -static OpenRCT2String WindowGameBottomToolbarTooltip( - rct_window* w, const rct_widgetindex widgetIndex, const rct_string_id fallback) +static OpenRCT2String WindowGameBottomToolbarTooltip(rct_window* w, const rct_widgetindex widgetIndex, const StringId fallback) { int32_t month, day; auto ft = Formatter(); @@ -207,8 +206,8 @@ static OpenRCT2String WindowGameBottomToolbarTooltip( month = date_get_month(gDateMonthsElapsed); day = ((gDateMonthTicks * days_in_month[month]) >> 16) & 0xFF; - ft.Add(DateDayNames[day]); - ft.Add(DateGameMonthNames[month]); + ft.Add(DateDayNames[day]); + ft.Add(DateGameMonthNames[month]); break; } return { fallback, ft }; @@ -410,19 +409,19 @@ static void WindowGameBottomToolbarDrawLeftPanel(rct_drawpixelinfo* dpi, rct_win = (gHoverWidget.window_classification == WC_BOTTOM_TOOLBAR && gHoverWidget.widget_index == WIDX_MONEY ? COLOUR_WHITE : NOT_TRANSLUCENT(w->colours[0])); - rct_string_id stringId = gCash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH; + StringId stringId = gCash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH; auto ft = Formatter(); ft.Add(gCash); DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); } - static constexpr const rct_string_id _guestCountFormats[] = { + static constexpr const StringId _guestCountFormats[] = { STR_BOTTOM_TOOLBAR_NUM_GUESTS_STABLE, STR_BOTTOM_TOOLBAR_NUM_GUESTS_DECREASE, STR_BOTTOM_TOOLBAR_NUM_GUESTS_INCREASE, }; - static constexpr const rct_string_id _guestCountFormatsSingular[] = { + static constexpr const StringId _guestCountFormatsSingular[] = { STR_BOTTOM_TOOLBAR_NUM_GUESTS_STABLE_SINGULAR, STR_BOTTOM_TOOLBAR_NUM_GUESTS_DECREASE_SINGULAR, STR_BOTTOM_TOOLBAR_NUM_GUESTS_INCREASE_SINGULAR, @@ -433,8 +432,8 @@ static void WindowGameBottomToolbarDrawLeftPanel(rct_drawpixelinfo* dpi, rct_win rct_widget widget = window_game_bottom_toolbar_widgets[WIDX_GUESTS]; auto screenCoords = ScreenCoordsXY{ w->windowPos.x + widget.midX(), w->windowPos.y + widget.midY() - 6 }; - rct_string_id stringId = gNumGuestsInPark == 1 ? _guestCountFormatsSingular[gGuestChangeModifier] - : _guestCountFormats[gGuestChangeModifier]; + StringId stringId = gNumGuestsInPark == 1 ? _guestCountFormatsSingular[gGuestChangeModifier] + : _guestCountFormats[gGuestChangeModifier]; colour_t colour = (gHoverWidget.window_classification == WC_BOTTOM_TOOLBAR && gHoverWidget.widget_index == WIDX_GUESTS ? COLOUR_WHITE @@ -506,9 +505,9 @@ static void WindowGameBottomToolbarDrawRightPanel(rct_drawpixelinfo* dpi, rct_wi = (gHoverWidget.window_classification == WC_BOTTOM_TOOLBAR && gHoverWidget.widget_index == WIDX_DATE ? COLOUR_WHITE : NOT_TRANSLUCENT(w->colours[0])); - rct_string_id stringId = DateFormatStringFormatIds[gConfigGeneral.date_format]; + StringId stringId = DateFormatStringFormatIds[gConfigGeneral.date_format]; auto ft = Formatter(); - ft.Add(DateDayNames[day]); + ft.Add(DateDayNames[day]); ft.Add(month); ft.Add(year); DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); @@ -521,7 +520,7 @@ static void WindowGameBottomToolbarDrawRightPanel(rct_drawpixelinfo* dpi, rct_wi static_cast(screenCoords.y + line_height + 1) }; int32_t temperature = gClimateCurrent.Temperature; - rct_string_id format = STR_CELSIUS_VALUE; + StringId format = STR_CELSIUS_VALUE; if (gConfigGeneral.temperature_format == TemperatureUnit::Fahrenheit) { temperature = climate_celsius_to_fahrenheit(temperature); @@ -670,9 +669,9 @@ static void WindowGameBottomToolbarDrawMiddlePanel(rct_drawpixelinfo* dpi, rct_w int32_t width = middleOutsetWidget->width() - 62; // Check if there is a map tooltip to draw - rct_string_id stringId; + StringId stringId; auto ft = GetMapTooltip(); - std::memcpy(&stringId, ft.Data(), sizeof(rct_string_id)); + std::memcpy(&stringId, ft.Data(), sizeof(StringId)); if (stringId == STR_NONE) { DrawTextWrapped( diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index d5302f1440..c5c34b96ce 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -34,7 +34,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_STRINGID; +static constexpr const StringId WINDOW_TITLE = STR_STRINGID; static constexpr const int32_t WH = 157; static constexpr const int32_t WW = 192; @@ -1190,7 +1190,7 @@ private: // Nausea tolerance { - static constexpr const rct_string_id _nauseaTolerances[] = { + static constexpr const StringId _nauseaTolerances[] = { STR_PEEP_STAT_NAUSEA_TOLERANCE_NONE, STR_PEEP_STAT_NAUSEA_TOLERANCE_LOW, STR_PEEP_STAT_NAUSEA_TOLERANCE_AVERAGE, @@ -1199,7 +1199,7 @@ private: screenCoords.y += LIST_ROW_HEIGHT; auto nausea_tolerance = EnumValue(peep->NauseaTolerance) & 0x3; auto ft = Formatter(); - ft.Add(_nauseaTolerances[nausea_tolerance]); + ft.Add(_nauseaTolerances[nausea_tolerance]); DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_NAUSEA_TOLERANCE, ft); } } @@ -1348,7 +1348,7 @@ private: } else { - ft.Add(STR_PEEP_FAVOURITE_RIDE_NOT_AVAILABLE); + ft.Add(STR_PEEP_FAVOURITE_RIDE_NOT_AVAILABLE); } DrawTextEllipsised(&dpi, screenCoords, width - 14, STR_FAVOURITE_RIDE, ft); @@ -1362,7 +1362,7 @@ private: for (int32_t listIndex = 0; listIndex < no_list_items; listIndex++) { auto y = listIndex * 10; - rct_string_id stringId = STR_BLACK_STRING; + StringId stringId = STR_BLACK_STRING; if (listIndex == selected_list_item) { gfx_filter_rect(&dpi, { 0, y, 800, y + 9 }, FilterPaletteID::PaletteDarken1); @@ -1632,7 +1632,7 @@ private: } } - std::pair InventoryFormatItem(Guest& guest, ShopItem item) const + std::pair InventoryFormatItem(Guest& guest, ShopItem item) const { auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); auto parkName = park.Name.c_str(); @@ -1640,8 +1640,8 @@ private: // Default arguments auto ft = Formatter(); ft.Add(GetShopItemDescriptor(item).Image); - ft.Add(GetShopItemDescriptor(item).Naming.Display); - ft.Add(STR_STRING); + ft.Add(GetShopItemDescriptor(item).Naming.Display); + ft.Add(STR_STRING); ft.Add(parkName); // Special overrides @@ -1672,8 +1672,8 @@ private: case VOUCHER_TYPE_PARK_ENTRY_FREE: ft.Rewind(); ft.Increment(6); - ft.Add(STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_FREE); - ft.Add(STR_STRING); + ft.Add(STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_FREE); + ft.Add(STR_STRING); ft.Add(parkName); break; case VOUCHER_TYPE_RIDE_FREE: @@ -1682,22 +1682,22 @@ private: { ft.Rewind(); ft.Increment(6); - ft.Add(STR_PEEP_INVENTORY_VOUCHER_RIDE_FREE); + ft.Add(STR_PEEP_INVENTORY_VOUCHER_RIDE_FREE); invRide->FormatNameTo(ft); } break; case VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE: ft.Rewind(); ft.Increment(6); - ft.Add(STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_HALF_PRICE); - ft.Add(STR_STRING); + ft.Add(STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_HALF_PRICE); + ft.Add(STR_STRING); ft.Add(parkName); break; case VOUCHER_TYPE_FOOD_OR_DRINK_FREE: ft.Rewind(); ft.Increment(6); - ft.Add(STR_PEEP_INVENTORY_VOUCHER_FOOD_OR_DRINK_FREE); - ft.Add(GetShopItemDescriptor(guest.VoucherShopItem).Naming.Singular); + ft.Add(STR_PEEP_INVENTORY_VOUCHER_FOOD_OR_DRINK_FREE); + ft.Add(GetShopItemDescriptor(guest.VoucherShopItem).Naming.Singular); break; } break; diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 07e03449c3..7ccdf35ca3 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -27,7 +27,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_GUESTS; +static constexpr const StringId WINDOW_TITLE = STR_GUESTS; static constexpr const int32_t WH = 330; static constexpr const int32_t WW = 350; @@ -93,9 +93,9 @@ private: { uint8_t args[12]{}; - rct_string_id GetFirstStringId() + StringId GetFirstStringId() { - rct_string_id firstStrId{}; + StringId firstStrId{}; std::memcpy(&firstStrId, args, sizeof(firstStrId)); return firstStrId; } @@ -186,7 +186,7 @@ public: auto guestRide = get_ride(RideId::FromUnderlying(index)); if (guestRide != nullptr) { - ft.Add( + ft.Add( guestRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE); guestRide->FormatNameTo(ft); @@ -202,7 +202,7 @@ public: auto guestRide = get_ride(RideId::FromUnderlying(index)); if (guestRide != nullptr) { - ft.Add(STR_QUEUING_FOR); + ft.Add(STR_QUEUING_FOR); guestRide->FormatNameTo(ft); _selectedFilter = GuestFilterType::Guests; @@ -217,7 +217,7 @@ public: auto guestRide = get_ride(RideId::FromUnderlying(index)); if (guestRide != nullptr) { - ft.Add(STR_NONE); + ft.Add(STR_NONE); guestRide->FormatNameTo(ft); _selectedFilter = GuestFilterType::GuestsThinking; @@ -229,7 +229,7 @@ public: } case GuestListFilterType::GuestsThinkingX: { - ft.Add(PeepThoughts[index & 0xFF]); + ft.Add(PeepThoughts[index & 0xFF]); _selectedFilter = GuestFilterType::GuestsThinking; _highlightedIndex = {}; @@ -451,7 +451,7 @@ public: DrawTabImages(dpi); // Filter description - rct_string_id format; + StringId format; auto screenCoords = windowPos + ScreenCoordsXY{ 6, widgets[WIDX_TAB_CONTENT_PANEL].top + 3 }; if (_selectedTab == TabId::Individual) { @@ -672,7 +672,7 @@ private: && y < dpi.y + dpi.height) { // Highlight backcolour and text colour (format) - rct_string_id format = STR_BLACK_STRING; + StringId format = STR_BLACK_STRING; if (index == _highlightedIndex) { gfx_filter_rect(&dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); @@ -742,7 +742,7 @@ private: break; // Highlight backcolour and text colour (format) - rct_string_id format = STR_BLACK_STRING; + StringId format = STR_BLACK_STRING; if (index == _highlightedIndex) { gfx_filter_rect(&dpi, { 0, y, 800, y + SUMMARISED_GUEST_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1); @@ -771,7 +771,7 @@ private: // Draw guest count ft = Formatter(); - ft.Add(STR_GUESTS_COUNT_COMMA_SEP); + ft.Add(STR_GUESTS_COUNT_COMMA_SEP); ft.Add(group.NumGuests); DrawTextBasic(&dpi, { 326, y }, format, ft, { TextAlignment::RIGHT }); } @@ -807,7 +807,7 @@ private: auto peepArgs = GetArgumentsFromPeep(peep, guestViewType); if (_filterArguments.GetFirstStringId() == STR_NONE && _selectedFilter == GuestFilterType::GuestsThinking) { - Formatter(peepArgs.args).Add(STR_NONE); + Formatter(peepArgs.args).Add(STR_NONE); } return _filterArguments == peepArgs; } @@ -904,7 +904,7 @@ private: return result; } - static constexpr rct_string_id GetViewName(GuestViewType type) + static constexpr StringId GetViewName(GuestViewType type) { switch (type) { @@ -916,7 +916,7 @@ private: } } - static constexpr rct_string_id GetFilterString(GuestFilterType type) + static constexpr StringId GetFilterString(GuestFilterType type) { switch (type) { diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index fe12f95e45..6d861784b6 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -41,7 +41,7 @@ enum { WIDX_CANCEL }; -static constexpr const rct_string_id WINDOW_TITLE = STR_TRACK_DESIGN_INSTALL_WINDOW_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_TRACK_DESIGN_INSTALL_WINDOW_TITLE; static constexpr const int32_t WW = 380; static constexpr const int32_t WH = 460; constexpr int32_t PREVIEW_BUTTONS_LEFT = WW - 25; @@ -251,12 +251,12 @@ static void WindowInstallTrackPaint(rct_window* w, rct_drawpixelinfo* dpi) { auto groupIndex = object_manager_get_loaded_object_entry_index(objectEntry); auto rideName = get_ride_naming(td6->type, get_ride_entry(groupIndex)); - ft.Add(rideName.Name); + ft.Add(rideName.Name); } else { // Fall back on the technical track name if the vehicle object cannot be loaded - ft.Add(GetRideTypeDescriptor(td6->type).Naming.Name); + ft.Add(GetRideTypeDescriptor(td6->type).Naming.Name); } DrawTextBasic(dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft); @@ -319,7 +319,7 @@ static void WindowInstallTrackPaint(rct_window* w, rct_drawpixelinfo* dpi) // Ride length auto ft = Formatter(); - ft.Add(STR_RIDE_LENGTH_ENTRY); + ft.Add(STR_RIDE_LENGTH_ENTRY); ft.Add(td6->ride_length); DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); screenPos.y += LIST_ROW_HEIGHT; diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 8d975f2f3d..14dbcab1f7 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -21,7 +21,7 @@ using namespace OpenRCT2; -static constexpr const rct_string_id WINDOW_TITLE = STR_LAND; +static constexpr const StringId WINDOW_TITLE = STR_LAND; static constexpr const int32_t WH = 160; static constexpr const int32_t WW = 98; diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 8ba5d94ac4..ed7eee2bbb 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -22,7 +22,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_LAND_RIGHTS; +static constexpr const StringId WINDOW_TITLE = STR_LAND_RIGHTS; static constexpr const int32_t WH = 94; static constexpr const int32_t WW = 98; diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 8772622204..5d065e6745 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -40,7 +40,7 @@ #pragma region Widgets -static constexpr const rct_string_id WINDOW_TITLE = STR_NONE; +static constexpr const StringId WINDOW_TITLE = STR_NONE; static constexpr const int32_t WW = 350; static constexpr const int32_t WH = 400; @@ -356,7 +356,7 @@ static u8string Browse(bool isSave) OpenRCT2::Ui::FileDialogDesc desc = {}; u8string extension{}; auto fileType = FileExtension::Unknown; - rct_string_id title = STR_NONE; + StringId title = STR_NONE; switch (_type & 0x0E) { case LOADSAVETYPE_GAME: @@ -712,7 +712,7 @@ static void WindowLoadsavePaint(rct_window* w, rct_drawpixelinfo* dpi) DrawTextEllipsised(dpi, { w->windowPos.x + 4, w->windowPos.y + 20 }, w->width - 8, STR_STRING, ft); // Name button text - rct_string_id id = STR_NONE; + StringId id = STR_NONE; if (gConfigGeneral.load_save_sort == Sort::NameAscending) id = STR_UP; else if (gConfigGeneral.load_save_sort == Sort::NameDescending) @@ -721,7 +721,7 @@ static void WindowLoadsavePaint(rct_window* w, rct_drawpixelinfo* dpi) // Draw name button indicator. rct_widget sort_name_widget = window_loadsave_widgets[WIDX_SORT_NAME]; ft = Formatter(); - ft.Add(id); + ft.Add(id); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, ft, { COLOUR_GREY }); @@ -736,7 +736,7 @@ static void WindowLoadsavePaint(rct_window* w, rct_drawpixelinfo* dpi) rct_widget sort_date_widget = window_loadsave_widgets[WIDX_SORT_DATE]; ft = Formatter(); - ft.Add(id); + ft.Add(id); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, ft, { COLOUR_GREY }); @@ -759,7 +759,7 @@ static void WindowLoadsaveScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int if (y + SCROLLABLE_ROW_HEIGHT < dpi->y) continue; - rct_string_id stringId = STR_BLACK_STRING; + StringId stringId = STR_BLACK_STRING; // If hovering over item, change the color and fill the backdrop. if (i == w->selected_list_item) @@ -771,13 +771,13 @@ static void WindowLoadsaveScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int if (_listItems[i].loaded) { auto ft = Formatter(); - ft.Add(STR_RIGHTGUILLEMET); + ft.Add(STR_RIGHTGUILLEMET); DrawTextBasic(dpi, { 0, y }, stringId, ft); } // Print filename auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(_listItems[i].name.c_str()); int32_t max_file_width = w->widgets[WIDX_SORT_NAME].width() - 10; DrawTextEllipsised(dpi, { 10, y }, max_file_width, stringId, ft); @@ -786,12 +786,12 @@ static void WindowLoadsaveScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int if (_listItems[i].type == TYPE_FILE) { ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(_listItems[i].date_formatted.c_str()); DrawTextEllipsised(dpi, { dateAnchor - DATE_TIME_GAP, y }, maxDateWidth, stringId, ft, { TextAlignment::RIGHT }); ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(_listItems[i].time_formatted.c_str()); DrawTextEllipsised(dpi, { dateAnchor + DATE_TIME_GAP, y }, maxTimeWidth, stringId, ft); } @@ -1196,7 +1196,7 @@ static void WindowOverwritePromptPaint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(*w, dpi); auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(_window_overwrite_prompt_name); ScreenCoordsXY stringCoords(w->windowPos.x + w->width / 2, w->windowPos.y + (w->height / 2) - 3); diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index b0fb9eee06..caa957a5f8 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -53,7 +53,7 @@ static constexpr uint16_t MapColourUnowned(uint16_t colour) constexpr int32_t MAP_WINDOW_MAP_SIZE = MAXIMUM_MAP_SIZE_TECHNICAL * 2; -static constexpr const rct_string_id WINDOW_TITLE = STR_MAP_LABEL; +static constexpr const StringId WINDOW_TITLE = STR_MAP_LABEL; static constexpr const int32_t WH = 259; static constexpr const int32_t WW = 245; @@ -880,7 +880,7 @@ public: { screenCoords = windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP].bottom + 2 }; - static constexpr rct_string_id _mapLabels[] = { + static constexpr StringId _mapLabels[] = { STR_MAP_RIDE, STR_MAP_FOOD_STALL, STR_MAP_DRINK_STALL, STR_MAP_SOUVENIR_STALL, STR_MAP_INFO_KIOSK, STR_MAP_FIRST_AID, STR_MAP_CASH_MACHINE, STR_MAP_TOILET, }; diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 93c0ed1f43..1cb8c5c5ed 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -119,7 +119,7 @@ enum #pragma region Widgets -static constexpr const rct_string_id WINDOW_TITLE = STR_MAPGEN_WINDOW_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_MAPGEN_WINDOW_TITLE; static constexpr const int32_t WW = 250; static constexpr const int32_t WH = 273; diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 0e140cf57a..9397d9e085 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -78,8 +78,8 @@ void WindowMapTooltipUpdateVisibility() _lastCursor = cursor; // Show or hide tooltip - rct_string_id stringId; - std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(rct_string_id)); + StringId stringId; + std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId)); if (_cursorHoldDuration < 25 || stringId == STR_NONE || InputTestPlaceObjectModifier( @@ -139,8 +139,8 @@ static void WindowMapTooltipUpdate(rct_window* w) */ static void WindowMapTooltipPaint(rct_window* w, rct_drawpixelinfo* dpi) { - rct_string_id stringId; - std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(rct_string_id)); + StringId stringId; + std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId)); if (stringId == STR_NONE) { return; diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 8251e00bcc..21cbc86591 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -28,7 +28,7 @@ #pragma region Widgets -static constexpr const rct_string_id WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE; static constexpr const int32_t WH = 200; static constexpr const int32_t WW = 166; @@ -287,7 +287,7 @@ public: else { ft.Increment(4); - ft.Add(STR_NONE); + ft.Add(STR_NONE); } } diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 1142b585ee..81bee5f497 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -111,7 +111,7 @@ static rct_widget *window_multiplayer_page_widgets[] = { window_multiplayer_options_widgets, }; -static constexpr rct_string_id WindowMultiplayerPageTitles[] = { +static constexpr StringId WindowMultiplayerPageTitles[] = { STR_MULTIPLAYER_INFORMATION_TITLE, STR_MULTIPLAYER_PLAYERS_TITLE, STR_MULTIPLAYER_GROUPS_TITLE, @@ -559,7 +559,7 @@ static void WindowMultiplayerPlayersInvalidate(rct_window* w) static void WindowMultiplayerPlayersPaint(rct_window* w, rct_drawpixelinfo* dpi) { - rct_string_id stringId; + StringId stringId; WindowDrawWidgets(*w, dpi); WindowMultiplayerDrawTabImages(w, dpi); @@ -632,11 +632,11 @@ static void WindowMultiplayerPlayersScrollpaint(rct_window* w, rct_drawpixelinfo auto ft = Formatter(); if (action != -999) { - ft.Add(network_get_action_name_string_id(action)); + ft.Add(network_get_action_name_string_id(action)); } else { - ft.Add(STR_ACTION_NA); + ft.Add(STR_ACTION_NA); } DrawTextEllipsised(dpi, { 256, screenCoords.y }, 100, STR_BLACK_STRING, ft); diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 1530115607..2b413a7236 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -23,7 +23,7 @@ using namespace OpenRCT2; -static constexpr const rct_string_id WINDOW_TITLE = STR_NONE; +static constexpr const StringId WINDOW_TITLE = STR_NONE; static constexpr const int32_t WH = 109; static constexpr const int32_t WW = 350; diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 43cb8b5f9f..a5f62fdbcc 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -38,7 +38,7 @@ using namespace OpenRCT2::TrackMetaData; -static constexpr const rct_string_id WINDOW_TITLE = STR_NONE; +static constexpr const StringId WINDOW_TITLE = STR_NONE; static constexpr const int32_t WH = 382; static constexpr const int32_t WW = 601; static constexpr const int32_t NEW_RIDE_LIST_ITEMS_MAX = 384; @@ -250,7 +250,7 @@ static rct_window_event_list window_new_ride_events([](auto& events) { #pragma endregion -static constexpr const rct_string_id window_new_ride_titles[] = { +static constexpr const StringId window_new_ride_titles[] = { STR_NEW_TRANSPORT_RIDES, // WINDOW_NEW_RIDE_PAGE_TRANSPORT STR_NEW_GENTLE_RIDES, // WINDOW_NEW_RIDE_PAGE_GENTLE STR_NEW_ROLLER_COASTERS, // WINDOW_NEW_RIDE_PAGE_ROLLER_COASTER @@ -917,8 +917,8 @@ static void WindowNewRidePaintRideInformation( WindowNewRideUpdateVehicleAvailability(item.Type); // Ride name and description - ft.Add(rideNaming.Name); - ft.Add(rideNaming.Description); + ft.Add(rideNaming.Name); + ft.Add(rideNaming.Description); DrawTextWrapped(dpi, screenPos, width, STR_NEW_RIDE_NAME_AND_DESCRIPTION, ft); if (!_vehicleAvailability.empty()) @@ -926,7 +926,7 @@ static void WindowNewRidePaintRideInformation( if (gConfigInterface.list_ride_vehicles_separately) { ft = Formatter(); - ft.Add(rideEntry->naming.Name); + ft.Add(rideEntry->naming.Name); DrawTextEllipsised(dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WW - 2, STR_NEW_RIDE_VEHICLE_NAME, ft); } else @@ -945,7 +945,7 @@ static void WindowNewRidePaintRideInformation( } ft.Add(_lastTrackDesignCount); - rct_string_id designCountStringId; + StringId designCountStringId; switch (_lastTrackDesignCount) { case 0: @@ -972,7 +972,7 @@ static void WindowNewRidePaintRideInformation( price = (price >> 16) * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier; // - rct_string_id stringId = STR_NEW_RIDE_COST; + StringId stringId = STR_NEW_RIDE_COST; if (!GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) stringId = STR_NEW_RIDE_COST_FROM; diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 54335739dc..e3214ba0e7 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -21,7 +21,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_RECENT_MESSAGES; +static constexpr const StringId WINDOW_TITLE = STR_RECENT_MESSAGES; static constexpr const int32_t WH = 300; static constexpr const int32_t WW = 400; @@ -197,8 +197,8 @@ public: // Date text { auto ft = Formatter(); - ft.Add(DateDayNames[newsItem.Day - 1]); - ft.Add(DateGameMonthNames[date_get_month(newsItem.MonthYear)]); + ft.Add(DateDayNames[newsItem.Day - 1]); + ft.Add(DateGameMonthNames[date_get_month(newsItem.MonthYear)]); DrawTextBasic(&dpi, { 2, y }, STR_NEWS_DATE_FORMAT, ft, { COLOUR_WHITE, FontSpriteBase::SMALL }); } // Item text diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index 169cb7a699..0f05ad3a34 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -14,7 +14,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_NOTIFICATION_SETTINGS; +static constexpr const StringId WINDOW_TITLE = STR_NOTIFICATION_SETTINGS; static constexpr const int32_t WH = 300; static constexpr const int32_t WW = 400; @@ -30,7 +30,7 @@ enum struct NotificationDef { uint8_t category; - rct_string_id caption; + StringId caption; size_t config_offset; }; diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index 8d4542ea15..2aec660adf 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -264,7 +264,7 @@ enum WindowObjectLoadErrorWidgetIdx { WIDX_DOWNLOAD_ALL }; -static constexpr const rct_string_id WINDOW_TITLE = STR_OBJECT_LOAD_ERROR_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_OBJECT_LOAD_ERROR_TITLE; static constexpr const int32_t WW = 450; static constexpr const int32_t WH = 400; static constexpr const int32_t WW_LESS_PADDING = WW - 5; @@ -288,12 +288,12 @@ static rct_widget window_object_load_error_widgets[] = { // clang-format on /** - * Returns an rct_string_id that represents an rct_object_entry's type. + * Returns an StringId that represents an rct_object_entry's type. * * Could possibly be moved out of the window file if other * uses exist and a suitable location is found. */ -static constexpr rct_string_id GetStringFromObjectType(const ObjectType type) +static constexpr StringId GetStringFromObjectType(const ObjectType type) { switch (type) { @@ -489,12 +489,12 @@ public: // Draw explanatory message auto ft = Formatter(); - ft.Add(STR_OBJECT_ERROR_WINDOW_EXPLANATION); + ft.Add(STR_OBJECT_ERROR_WINDOW_EXPLANATION); DrawTextWrapped(&dpi, windowPos + ScreenCoordsXY{ 5, 18 }, WW - 10, STR_BLACK_STRING, ft); // Draw file name ft = Formatter(); - ft.Add(STR_OBJECT_ERROR_WINDOW_FILE); + ft.Add(STR_OBJECT_ERROR_WINDOW_FILE); ft.Add(_filePath.c_str()); DrawTextEllipsised(&dpi, { windowPos.x + 5, windowPos.y + 43 }, WW - 5, STR_BLACK_STRING, ft); } diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 5b05e43e2a..7e91a57905 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -212,7 +212,7 @@ enum WindowOptionsWidgetIdx { WIDX_PATH_TO_RCT1_CLEAR, }; -static constexpr const rct_string_id WINDOW_TITLE = STR_OPTIONS_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_OPTIONS_TITLE; static constexpr const int32_t WW = 310; static constexpr const int32_t WH = 332; @@ -607,7 +607,7 @@ public: } } - OpenRCT2String OnTooltip(rct_widgetindex widgetIndex, rct_string_id fallback) override + OpenRCT2String OnTooltip(rct_widgetindex widgetIndex, StringId fallback) override { if (page == WINDOW_OPTIONS_PAGE_ADVANCED) return AdvancedTooltip(widgetIndex, fallback); @@ -1031,7 +1031,7 @@ private: SetCheckboxValue(WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX, gConfigGeneral.transparent_screenshot); SetCheckboxValue(WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.upper_case_banners); - static constexpr rct_string_id _virtualFloorStyleStrings[] = { + static constexpr StringId _virtualFloorStyleStrings[] = { STR_VIRTUAL_FLOOR_STYLE_DISABLED, STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT, STR_VIRTUAL_FLOOR_STYLE_GLASSY, @@ -1259,7 +1259,7 @@ private: // Distance: metric / imperial / si { - rct_string_id stringId = STR_NONE; + StringId stringId = STR_NONE; switch (gConfigGeneral.measurement_format) { case MeasurementFormat::Imperial: @@ -1466,7 +1466,7 @@ private: return { 500, 0 }; } - rct_string_id GetTitleMusicName() + StringId GetTitleMusicName() { auto index = EnumValue(gConfigSound.title_music); if (index < 0 || static_cast(index) >= std::size(TitleMusicNames)) @@ -1479,7 +1479,7 @@ private: void AudioPrepareDraw() { // Sound device - rct_string_id audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; + StringId audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; const char* audioDeviceName = nullptr; const int32_t currentDeviceIndex = OpenRCT2::Audio::GetCurrentDeviceIndex(); if (currentDeviceIndex == -1 || OpenRCT2::Audio::GetDeviceCount() == 0) @@ -1814,12 +1814,12 @@ private: auto ft = Formatter::Common(); if (gConfigInterface.random_title_sequence) { - ft.Add(STR_TITLE_SEQUENCE_RANDOM); + ft.Add(STR_TITLE_SEQUENCE_RANDOM); } else { auto name = title_sequence_manager_get_name(title_get_config_sequence()); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(name); } @@ -2027,7 +2027,7 @@ private: DrawTextEllipsised(dpi, screenCoords, 277, STR_STRING, ft, { colours[1] }); } - OpenRCT2String AdvancedTooltip(rct_widgetindex widgetIndex, rct_string_id fallback) + OpenRCT2String AdvancedTooltip(rct_widgetindex widgetIndex, StringId fallback) { if (widgetIndex == WIDX_PATH_TO_RCT1_BUTTON) { @@ -2147,19 +2147,19 @@ private: return !rct1path.empty(); } - static constexpr rct_string_id AutosaveNames[] = { + static constexpr StringId AutosaveNames[] = { STR_SAVE_EVERY_MINUTE, STR_SAVE_EVERY_5MINUTES, STR_SAVE_EVERY_15MINUTES, STR_SAVE_EVERY_30MINUTES, STR_SAVE_EVERY_HOUR, STR_SAVE_NEVER, }; - static constexpr rct_string_id TitleMusicNames[] = { + static constexpr StringId TitleMusicNames[] = { STR_OPTIONS_MUSIC_VALUE_NONE, STR_ROLLERCOASTER_TYCOON_1_DROPDOWN, STR_ROLLERCOASTER_TYCOON_2_DROPDOWN, STR_OPTIONS_MUSIC_VALUE_RANDOM, }; - static constexpr rct_string_id FullscreenModeNames[] = { + static constexpr StringId FullscreenModeNames[] = { STR_OPTIONS_DISPLAY_WINDOWED, STR_OPTIONS_DISPLAY_FULLSCREEN, STR_OPTIONS_DISPLAY_FULLSCREEN_BORDERLESS, diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 0c5e05e8ff..748ca14fa7 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -34,7 +34,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_STRINGID; +static constexpr const StringId WINDOW_TITLE = STR_STRINGID; static constexpr const int32_t WH = 224; // clang-format off @@ -162,7 +162,7 @@ static std::array _pagedHoldDownWidgets = { }; struct WindowParkAward { - rct_string_id text; + StringId text; uint32_t sprite; }; @@ -402,7 +402,7 @@ private: auto parkName = park.Name.c_str(); auto ft = Formatter::Common(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(parkName); } @@ -511,7 +511,7 @@ private: auto parkName = park.Name.c_str(); auto ft = Formatter::Common(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(parkName); } widgets[WIDX_OPEN_OR_CLOSE].image = park_is_open() ? SPR_OPEN : SPR_CLOSED; @@ -599,7 +599,7 @@ private: // Draw park closed / open label auto ft = Formatter(); - ft.Add(park_is_open() ? STR_PARK_OPEN : STR_PARK_CLOSED); + ft.Add(park_is_open() ? STR_PARK_OPEN : STR_PARK_CLOSED); auto* labelWidget = &widgets[WIDX_STATUS]; DrawTextEllipsised( @@ -1067,7 +1067,7 @@ private: auto screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 7 }; auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(gScenarioDetails.c_str()); screenCoords.y += DrawTextWrapped(&dpi, screenCoords, 222, STR_BLACK_STRING, ft); screenCoords.y += 5; @@ -1080,13 +1080,13 @@ private: ft = Formatter(); if (gScenarioObjective.Type == OBJECTIVE_BUILD_THE_BEST) { - rct_string_id rideTypeString = STR_NONE; + StringId rideTypeString = STR_NONE; auto rideTypeId = gScenarioObjective.RideId; if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) { rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name; } - ft.Add(rideTypeString); + ft.Add(rideTypeString); } else { diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index 9b342cfb2d..0a5ad9c603 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -25,7 +25,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_SET_PATROL_AREA; +static constexpr const StringId WINDOW_TITLE = STR_SET_PATROL_AREA; static constexpr const int32_t WH = 54; static constexpr const int32_t WW = 104; diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 35d0fd6de9..da863136dd 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -332,7 +332,7 @@ void WindowPlayerOverviewPaint(rct_window* w, rct_drawpixelinfo* dpi) auto screenCoords = w->windowPos + ScreenCoordsXY{ 90, 24 }; auto ft = Formatter(); - ft.Add(STR_PING); + ft.Add(STR_PING); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); char ping[64]; snprintf(ping, 64, "%d ms", network_get_player_ping(player)); @@ -345,11 +345,11 @@ void WindowPlayerOverviewPaint(rct_window* w, rct_drawpixelinfo* dpi) ft = Formatter(); if (lastaction != -999) { - ft.Add(network_get_action_name_string_id(lastaction)); + ft.Add(network_get_action_name_string_id(lastaction)); } else { - ft.Add(STR_ACTION_NA); + ft.Add(STR_ACTION_NA); } DrawTextEllipsised(dpi, screenCoords, width, STR_LAST_ACTION_RAN, ft, { TextAlignment::CENTRE }); diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 53e25d92fd..2b4ff2a4e8 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -146,7 +146,7 @@ const int32_t window_research_tab_animation_loops[] = { 16, }; -static constexpr const rct_string_id ResearchStageNames[] = { +static constexpr const StringId ResearchStageNames[] = { STR_RESEARCH_STAGE_INITIAL_RESEARCH, STR_RESEARCH_STAGE_DESIGNING, STR_RESEARCH_STAGE_COMPLETING_DESIGN, @@ -272,62 +272,62 @@ void WindowResearchDevelopmentPagePaint(rct_window* w, rct_drawpixelinfo* dpi, r { // Research type auto ft = Formatter(); - ft.Add(STR_RESEARCH_UNKNOWN); + ft.Add(STR_RESEARCH_UNKNOWN); DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft); screenCoords.y += 25; // Progress ft = Formatter(); - ft.Add(STR_RESEARCH_COMPLETED_AL); + ft.Add(STR_RESEARCH_COMPLETED_AL); DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); screenCoords.y += 15; // Expected ft = Formatter(); - ft.Add(STR_RESEARCH_STAGE_UNKNOWN); + ft.Add(STR_RESEARCH_STAGE_UNKNOWN); DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); } else { // Research type auto ft = Formatter(); - rct_string_id label = STR_RESEARCH_TYPE_LABEL; + StringId label = STR_RESEARCH_TYPE_LABEL; if (gResearchProgressStage == RESEARCH_STAGE_INITIAL_RESEARCH) { - ft.Add(STR_RESEARCH_UNKNOWN); + ft.Add(STR_RESEARCH_UNKNOWN); } else if (gResearchProgressStage == RESEARCH_STAGE_DESIGNING) { - ft.Add(gResearchNextItem->GetCategoryName()); + ft.Add(gResearchNextItem->GetCategoryName()); } else if (gResearchNextItem->type == Research::EntryType::Ride) { const auto& rtd = GetRideTypeDescriptor(gResearchNextItem->baseRideType); if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) { - ft.Add(gResearchNextItem->GetName()); + ft.Add(gResearchNextItem->GetName()); } else if (gResearchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) { - ft.Add(rtd.Naming.Name); + ft.Add(rtd.Naming.Name); } else { - ft.Add(gResearchNextItem->GetName()); - ft.Add(rtd.Naming.Name); + ft.Add(gResearchNextItem->GetName()); + ft.Add(rtd.Naming.Name); label = STR_RESEARCH_TYPE_LABEL_VEHICLE; } } else { - ft.Add(gResearchNextItem->GetName()); + ft.Add(gResearchNextItem->GetName()); } DrawTextWrapped(dpi, screenCoords, 296, label, ft); screenCoords.y += 25; // Progress ft = Formatter(); - ft.Add(ResearchStageNames[gResearchProgressStage]); + ft.Add(ResearchStageNames[gResearchProgressStage]); DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); screenCoords.y += 15; @@ -336,13 +336,13 @@ void WindowResearchDevelopmentPagePaint(rct_window* w, rct_drawpixelinfo* dpi, r if (gResearchProgressStage != RESEARCH_STAGE_INITIAL_RESEARCH && gResearchExpectedDay != 255) { // TODO: Should probably use game date format setting - ft.Add(STR_RESEARCH_EXPECTED_FORMAT); - ft.Add(DateDayNames[gResearchExpectedDay]); - ft.Add(DateGameMonthNames[gResearchExpectedMonth]); + ft.Add(STR_RESEARCH_EXPECTED_FORMAT); + ft.Add(DateDayNames[gResearchExpectedDay]); + ft.Add(DateGameMonthNames[gResearchExpectedMonth]); } else { - ft.Add(STR_RESEARCH_STAGE_UNKNOWN); + ft.Add(STR_RESEARCH_STAGE_UNKNOWN); } DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); } @@ -352,12 +352,12 @@ void WindowResearchDevelopmentPagePaint(rct_window* w, rct_drawpixelinfo* dpi, r if (gResearchLastItem.has_value()) { - rct_string_id lastDevelopmentFormat = STR_EMPTY; + StringId lastDevelopmentFormat = STR_EMPTY; auto ft = Formatter(); if (gResearchLastItem->type == Research::EntryType::Scenery) { lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL; - ft.Add(gResearchLastItem->GetName()); + ft.Add(gResearchLastItem->GetName()); } else { @@ -365,16 +365,16 @@ void WindowResearchDevelopmentPagePaint(rct_window* w, rct_drawpixelinfo* dpi, r const auto& rtd = GetRideTypeDescriptor(gResearchLastItem->baseRideType); if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) { - ft.Add(gResearchLastItem->GetName()); + ft.Add(gResearchLastItem->GetName()); } else if (gResearchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) { - ft.Add(rtd.Naming.Name); + ft.Add(rtd.Naming.Name); } else { - ft.Add(gResearchLastItem->GetName()); - ft.Add(rtd.Naming.Name); + ft.Add(gResearchLastItem->GetName()); + ft.Add(rtd.Naming.Name); lastDevelopmentFormat = STR_RESEARCH_VEHICLE_LABEL; } } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 6f1c1c0e95..deea1a66ba 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -66,7 +66,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; -static constexpr const rct_string_id WINDOW_TITLE = STR_RIDE_WINDOW_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_RIDE_WINDOW_TITLE; static constexpr const int32_t WH = 207; static constexpr const int32_t WW = 316; @@ -445,7 +445,7 @@ static void WindowRideVehicleResize(rct_window* w); static void WindowRideVehicleMousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); static void WindowRideVehicleDropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); static void WindowRideVehicleUpdate(rct_window* w); -static OpenRCT2String WindowRideVehicleTooltip(rct_window* const w, const rct_widgetindex widgetIndex, rct_string_id fallback); +static OpenRCT2String WindowRideVehicleTooltip(rct_window* const w, const rct_widgetindex widgetIndex, StringId fallback); static void WindowRideVehicleInvalidate(rct_window* w); static void WindowRideVehiclePaint(rct_window* w, rct_drawpixelinfo* dpi); static void WindowRideVehicleScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); @@ -507,7 +507,7 @@ static void WindowRideGraphsMousedown(rct_window* w, rct_widgetindex widgetIndex static void WindowRideGraphsUpdate(rct_window* w); static void WindowRideGraphsScrollgetheight(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height); static void WindowRideGraphs15(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType); -static OpenRCT2String WindowRideGraphsTooltip(rct_window* w, const rct_widgetindex widgetIndex, const rct_string_id fallback); +static OpenRCT2String WindowRideGraphsTooltip(rct_window* w, const rct_widgetindex widgetIndex, const StringId fallback); static void WindowRideGraphsInvalidate(rct_window* w); static void WindowRideGraphsPaint(rct_window* w, rct_drawpixelinfo* dpi); static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); @@ -714,7 +714,7 @@ static constexpr const int32_t window_ride_tab_animation_frames[] = { static_assert(std::size(window_ride_tab_animation_frames) == WINDOW_RIDE_PAGE_COUNT); // clang-format off -static constexpr const rct_string_id RatingNames[] = { +static constexpr const StringId RatingNames[] = { STR_RATING_LOW, STR_RATING_MEDIUM, STR_RATING_HIGH, @@ -724,7 +724,7 @@ static constexpr const rct_string_id RatingNames[] = { }; // clang-format on -static constexpr const rct_string_id RideBreakdownReasonNames[] = { +static constexpr const StringId RideBreakdownReasonNames[] = { STR_RIDE_BREAKDOWN_SAFETY_CUT_OUT, // BREAKDOWN_SAFETY_CUT_OUT STR_RIDE_BREAKDOWN_RESTRAINTS_STUCK_CLOSED, // BREAKDOWN_RESTRAINTS_STUCK_CLOSED STR_RIDE_BREAKDOWN_RESTRAINTS_STUCK_OPEN, // BREAKDOWN_RESTRAINTS_STUCK_OPEN @@ -736,7 +736,7 @@ static constexpr const rct_string_id RideBreakdownReasonNames[] = { }; static_assert(std::size(RideBreakdownReasonNames) == BREAKDOWN_COUNT); -const rct_string_id ColourSchemeNames[] = { +const StringId ColourSchemeNames[] = { STR_MAIN_COLOUR_SCHEME, // RIDE_COLOUR_SCHEME_MAIN STR_ALTERNATIVE_COLOUR_SCHEME_1, // RIDE_COLOUR_SCHEME_ADDITIONAL_1 STR_ALTERNATIVE_COLOUR_SCHEME_2, // RIDE_COLOUR_SCHEME_ADDITIONAL_2 @@ -744,7 +744,7 @@ const rct_string_id ColourSchemeNames[] = { }; static_assert(std::size(ColourSchemeNames) == RIDE_COLOUR_SCHEME_COUNT); -static constexpr const rct_string_id VehicleLoadNames[] = { +static constexpr const StringId VehicleLoadNames[] = { STR_QUARTER_LOAD, // WAIT_FOR_LOAD_QUARTER STR_HALF_LOAD, // WAIT_FOR_LOAD_HALF STR_THREE_QUARTER_LOAD, // WAIT_FOR_LOAD_THREE_QUARTER @@ -753,14 +753,14 @@ static constexpr const rct_string_id VehicleLoadNames[] = { }; static_assert(std::size(VehicleLoadNames) == WAIT_FOR_LOAD_COUNT); -static constexpr const rct_string_id VehicleColourSchemeNames[] = { +static constexpr const StringId VehicleColourSchemeNames[] = { STR_ALL_VEHICLES_IN_SAME_COLOURS, // RIDE_COLOUR_SCHEME_MODE_ALL_SAME, STR_DIFFERENT_COLOURS_PER, // RIDE_COLOUR_SCHEME_MODE_DIFFERENT_PER_TRAIN, STR_DIFFERENT_COLOURS_PER_VEHICLE, // RIDE_COLOUR_SCHEME_MODE_DIFFERENT_PER_CAR, }; static_assert(std::size(VehicleColourSchemeNames) == RIDE_COLOUR_SCHEME_MODE_COUNT); -static constexpr const rct_string_id VehicleStatusNames[] = { +static constexpr const StringId VehicleStatusNames[] = { STR_MOVING_TO_END_OF, // Vehicle::Status::MovingToEndOfStation STR_WAITING_FOR_PASSENGERS_AT, // Vehicle::Status::WaitingForPassengers STR_WAITING_TO_DEPART, // Vehicle::Status::WaitingToDepart @@ -794,7 +794,7 @@ static constexpr const rct_string_id VehicleStatusNames[] = { STR_STOPPED_BY_BLOCK_BRAKES, // Vehicle::Status::StoppedByBlockBrakes }; -static constexpr const rct_string_id SingleSessionVehicleStatusNames[] = { +static constexpr const StringId SingleSessionVehicleStatusNames[] = { STR_STOPPING_0, // Vehicle::Status::MovingToEndOfStation STR_WAITING_FOR_PASSENGERS, // Vehicle::Status::WaitingForPassengers STR_WAITING_TO_START, // Vehicle::Status::WaitingToDepart @@ -806,7 +806,7 @@ static constexpr const rct_string_id SingleSessionVehicleStatusNames[] = { struct WindowRideMazeDesignOption { - rct_string_id text; + StringId text; uint32_t sprite; }; @@ -822,7 +822,7 @@ struct GraphsYAxis uint8_t interval; int8_t unit; int8_t unit_interval; - rct_string_id label; + StringId label; }; /** rct2: 0x0098DD98 */ @@ -840,7 +840,7 @@ static constexpr auto RIDE_G_FORCES_RED_LATERAL = FIXED_2DP(2, 80); struct RideTypeLabel { uint8_t ride_type_id; - rct_string_id label_id; + StringId label_id; const char* label_string; }; @@ -851,7 +851,7 @@ static std::vector RideDropdownData; struct VehicleTypeLabel { ObjectEntryIndex subtype_id; - rct_string_id label_id; + StringId label_id; const char* label_string; }; @@ -1824,7 +1824,7 @@ struct RideStatusDropdownInfo int32_t DefaultIndex = -1; }; -static void WindowRideSetDropdown(RideStatusDropdownInfo& info, RideStatus status, rct_string_id text) +static void WindowRideSetDropdown(RideStatusDropdownInfo& info, RideStatus status, StringId text) { if (info.Ride->SupportsStatus(status)) { @@ -1864,7 +1864,7 @@ static void WindowRideShowOpenDropdown(rct_window* w, rct_widget* widget) gDropdownDefaultIndex = info.DefaultIndex; } -static rct_string_id GetRideTypeNameForDropdown(uint8_t rideType) +static StringId GetRideTypeNameForDropdown(uint8_t rideType) { switch (rideType) { @@ -2421,7 +2421,7 @@ static void WindowRideMainInvalidate(rct_window* w) * * rct2: 0x006AF10A */ -static rct_string_id WindowRideGetStatusOverallView(rct_window* w, Formatter& ft) +static StringId WindowRideGetStatusOverallView(rct_window* w, Formatter& ft) { auto stringId = STR_NONE; auto ride = get_ride(w->rideId); @@ -2441,7 +2441,7 @@ static rct_string_id WindowRideGetStatusOverallView(rct_window* w, Formatter& ft * * rct2: 0x006AEFEF */ -static rct_string_id WindowRideGetStatusVehicle(rct_window* w, Formatter& ft) +static StringId WindowRideGetStatusVehicle(rct_window* w, Formatter& ft) { auto ride = get_ride(w->rideId); if (ride == nullptr) @@ -2460,7 +2460,7 @@ static rct_string_id WindowRideGetStatusVehicle(rct_window* w, Formatter& ft) { if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_BLOCK_BRAKES) && vehicle->velocity == 0) { - ft.Add(STR_STOPPED_BY_BLOCK_BRAKES); + ft.Add(STR_STOPPED_BY_BLOCK_BRAKES); return STR_BLACK_STRING; } } @@ -2476,11 +2476,11 @@ static rct_string_id WindowRideGetStatusVehicle(rct_window* w, Formatter& ft) stringId = SingleSessionVehicleStatusNames[static_cast(vehicle->status)]; } - ft.Add(stringId); + ft.Add(stringId); uint16_t speedInMph = (abs(vehicle->velocity) * 9) >> 18; ft.Add(speedInMph); const RideComponentName stationName = GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station); - ft.Add(ride->num_stations > 1 ? stationName.number : stationName.singular); + ft.Add(ride->num_stations > 1 ? stationName.number : stationName.singular); ft.Add(vehicle->current_station.ToUnderlying() + 1); return stringId != STR_CRASHING && stringId != STR_CRASHED_0 ? STR_BLACK_STRING : STR_RED_OUTLINED_STRING; } @@ -2489,7 +2489,7 @@ static rct_string_id WindowRideGetStatusVehicle(rct_window* w, Formatter& ft) * * rct2: 0x006AEF65 */ -static rct_string_id WindowRideGetStatusStation(rct_window* w, Formatter& ft) +static StringId WindowRideGetStatusStation(rct_window* w, Formatter& ft) { auto ride = get_ride(w->rideId); if (ride == nullptr) @@ -2502,7 +2502,7 @@ static rct_string_id WindowRideGetStatusStation(rct_window* w, Formatter& ft) } const auto& station = ride->GetStation(*stationIndex); - rct_string_id stringId = STR_EMPTY; + StringId stringId = STR_EMPTY; // Entrance / exit if (ride->status == RideStatus::Closed) { @@ -2526,12 +2526,12 @@ static rct_string_id WindowRideGetStatusStation(rct_window* w, Formatter& ft) else if (queueLength > 1) stringId = STR_QUEUE_PEOPLE; - ft.Add(stringId); + ft.Add(stringId); ft.Add(queueLength); } else { - ft.Add(stringId); + ft.Add(stringId); } return STR_BLACK_STRING; @@ -2541,7 +2541,7 @@ static rct_string_id WindowRideGetStatusStation(rct_window* w, Formatter& ft) * * rct2: 0x006AEE73 */ -static rct_string_id WindowRideGetStatus(rct_window* w, Formatter& ft) +static StringId WindowRideGetStatus(rct_window* w, Formatter& ft) { auto ride = get_ride(w->rideId); if (w->ride.view == 0) @@ -2582,18 +2582,18 @@ static void WindowRideMainPaint(rct_window* w, rct_drawpixelinfo* dpi) { if (w->ride.view > ride->num_vehicles) { - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).number); + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).number); ft.Add(w->ride.view - ride->num_vehicles); } else { - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number); + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number); ft.Add(w->ride.view); } } else { - ft.Add(STR_OVERALL_VIEW); + ft.Add(STR_OVERALL_VIEW); } widget = &window_ride_main_widgets[WIDX_VIEW]; @@ -2604,7 +2604,7 @@ static void WindowRideMainPaint(rct_window* w, rct_drawpixelinfo* dpi) // Status ft = Formatter(); widget = &window_ride_main_widgets[WIDX_STATUS]; - rct_string_id rideStatus = WindowRideGetStatus(w, ft); + StringId rideStatus = WindowRideGetStatus(w, ft); DrawTextEllipsised( dpi, w->windowPos + ScreenCoordsXY{ (widget->left + widget->right) / 2, widget->top }, widget->width(), rideStatus, ft, { TextAlignment::CENTRE }); @@ -2720,7 +2720,7 @@ static void WindowRideVehicleUpdate(rct_window* w) widget_invalidate(*w, WIDX_TAB_2); } -static OpenRCT2String WindowRideVehicleTooltip(rct_window* const w, const rct_widgetindex widgetIndex, rct_string_id fallback) +static OpenRCT2String WindowRideVehicleTooltip(rct_window* const w, const rct_widgetindex widgetIndex, StringId fallback) { auto ride = get_ride(w->rideId); if (ride == nullptr) @@ -2736,12 +2736,12 @@ static OpenRCT2String WindowRideVehicleTooltip(rct_window* const w, const rct_wi ft.Increment(12); RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle; - rct_string_id stringId = GetRideComponentName(vehicleType).count; + StringId stringId = GetRideComponentName(vehicleType).count; if (ride->max_trains > 1) { stringId = GetRideComponentName(vehicleType).count_plural; } - ft.Add(stringId); + ft.Add(stringId); ft.Add(ride->max_trains); return { fallback, ft }; } @@ -2757,12 +2757,12 @@ static OpenRCT2String WindowRideVehicleTooltip(rct_window* const w, const rct_wi ft.Increment(16); ft.Add(std::max(uint8_t(1), ride->MaxCarsPerTrain) - rideEntry->zero_cars); - rct_string_id stringId = GetRideComponentName(RideComponentType::Car).singular; + StringId stringId = GetRideComponentName(RideComponentType::Car).singular; if (ride->MaxCarsPerTrain - rideEntry->zero_cars > 1) { stringId = GetRideComponentName(RideComponentType::Car).plural; } - ft.Add(stringId); + ft.Add(stringId); return { fallback, ft }; } } @@ -2777,7 +2777,7 @@ static void WindowRideVehicleInvalidate(rct_window* w) { rct_widget* widgets; rct_ride_entry* rideEntry; - rct_string_id stringId; + StringId stringId; int32_t carsPerTrain; widgets = window_ride_page_widgets[w->page]; @@ -2840,7 +2840,7 @@ static void WindowRideVehicleInvalidate(rct_window* w) { stringId = GetRideComponentName(vehicleType).count_plural; } - ft.Add(stringId); + ft.Add(stringId); ft.Add(ride->num_vehicles); ft.Increment(8); @@ -2881,13 +2881,13 @@ static void WindowRideVehiclePaint(rct_window* w, rct_drawpixelinfo* dpi) // Description auto ft = Formatter(); - ft.Add(rideEntry->naming.Description); + ft.Add(rideEntry->naming.Description); screenCoords.y += DrawTextWrapped(dpi, screenCoords, 300, STR_BLACK_STRING, ft, { TextAlignment::LEFT }); screenCoords.y += 2; // Capacity ft = Formatter(); - ft.Add(rideEntry->capacity); + ft.Add(rideEntry->capacity); DrawTextBasic(dpi, screenCoords, STR_CAPACITY, ft); // Excitement Factor @@ -3457,7 +3457,7 @@ static void WindowRideOperatingTextinput(rct_window* w, rct_widgetindex widgetIn static void WindowRideOperatingInvalidate(rct_window* w) { rct_widget* widgets; - rct_string_id format, caption, tooltip; + StringId format, caption, tooltip; widgets = window_ride_page_widgets[w->page]; if (w->widgets != widgets) @@ -3577,9 +3577,9 @@ static void WindowRideOperatingInvalidate(rct_window* w) ft.Rewind(); ft.Increment(10); - ft.Add(STR_FORMAT_SECONDS); + ft.Add(STR_FORMAT_SECONDS); ft.Add(ride->min_waiting_time); - ft.Add(STR_FORMAT_SECONDS); + ft.Add(STR_FORMAT_SECONDS); ft.Add(ride->max_waiting_time); if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD) @@ -4135,7 +4135,7 @@ static void WindowRideMaintenancePaint(rct_window* w, rct_drawpixelinfo* dpi) screenCoords.y += 26; // Last inspection - rct_string_id stringId; + StringId stringId; if (ride->last_inspection <= 1) stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTE; else if (ride->last_inspection <= 240) @@ -4154,7 +4154,7 @@ static void WindowRideMaintenancePaint(rct_window* w, rct_drawpixelinfo* dpi) stringId = (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) ? STR_CURRENT_BREAKDOWN : STR_LAST_BREAKDOWN; ft = Formatter(); - ft.Add(RideBreakdownReasonNames[ride->breakdown_reason]); + ft.Add(RideBreakdownReasonNames[ride->breakdown_reason]); DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += 12; @@ -4341,7 +4341,7 @@ static void WindowRideColourMousedown(rct_window* w, rct_widgetindex widgetIndex { VehicleColour vehicleColour; int32_t i, numItems; - rct_string_id stringId; + StringId stringId; auto ride = get_ride(w->rideId); if (ride == nullptr) @@ -4815,9 +4815,9 @@ static void WindowRideColourInvalidate(rct_window* w) } ft.Rewind(); ft.Increment(6); - ft.Add(VehicleColourSchemeNames[vehicleColourSchemeType]); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).singular); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised); + ft.Add(VehicleColourSchemeNames[vehicleColourSchemeType]); + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).singular); + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised); ft.Add(w->vehicleIndex + 1); // Vehicle index @@ -4849,7 +4849,7 @@ static void WindowRideColourInvalidate(rct_window* w) ft.Rewind(); ft.Increment(14); - ft.Add(ColourSchemeNames[colourScheme]); + ft.Add(ColourSchemeNames[colourScheme]); WindowRideAnchorBorderWidgets(w); window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); @@ -5209,7 +5209,7 @@ static void WindowRideMusicInvalidate(rct_window* w) ride->FormatNameTo(ft); // Set selected music - rct_string_id musicName = STR_NONE; + StringId musicName = STR_NONE; auto& objManager = GetContext()->GetObjectManager(); auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, ride->music)); if (musicObj != nullptr) @@ -5251,7 +5251,7 @@ static void WindowRideMusicPaint(rct_window* w, rct_drawpixelinfo* dpi) #pragma region Measurements -static rct_string_id GetRatingName(ride_rating rating) +static StringId GetRatingName(ride_rating rating) { int32_t index = std::clamp(rating >> 8, 0, static_cast(std::size(RatingNames)) - 1); return RatingNames[index]; @@ -5647,11 +5647,11 @@ static void WindowRideMeasurementsPaint(rct_window* w, rct_drawpixelinfo* dpi) if (ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED) { // Excitement - rct_string_id ratingName = GetRatingName(ride->excitement); + StringId ratingName = GetRatingName(ride->excitement); auto ft = Formatter(); ft.Add(ride->excitement); - ft.Add(ratingName); - rct_string_id stringId = !ride_has_ratings(ride) ? STR_EXCITEMENT_RATING_NOT_YET_AVAILABLE : STR_EXCITEMENT_RATING; + ft.Add(ratingName); + StringId stringId = !ride_has_ratings(ride) ? STR_EXCITEMENT_RATING_NOT_YET_AVAILABLE : STR_EXCITEMENT_RATING; DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; @@ -5659,7 +5659,7 @@ static void WindowRideMeasurementsPaint(rct_window* w, rct_drawpixelinfo* dpi) ratingName = GetRatingName(ride->intensity); ft = Formatter(); ft.Add(ride->intensity); - ft.Add(ratingName); + ft.Add(ratingName); stringId = STR_INTENSITY_RATING; if (!ride_has_ratings(ride)) @@ -5674,7 +5674,7 @@ static void WindowRideMeasurementsPaint(rct_window* w, rct_drawpixelinfo* dpi) ratingName = GetRatingName(ride->nausea); ft = Formatter(); ft.Add(ride->nausea); - ft.Add(ratingName); + ft.Add(ratingName); stringId = !ride_has_ratings(ride) ? STR_NAUSEA_RATING_NOT_YET_AVAILABLE : STR_NAUSEA_RATING; DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += 2 * LIST_ROW_HEIGHT; @@ -5756,14 +5756,14 @@ static void WindowRideMeasurementsPaint(rct_window* w, rct_drawpixelinfo* dpi) if (length != 0) { length >>= 16; - ft.Add(STR_RIDE_LENGTH_ENTRY_WITH_SEPARATOR); + ft.Add(STR_RIDE_LENGTH_ENTRY_WITH_SEPARATOR); ft.Add(length & 0xFFFF); numLengths++; } } if (numLengths == 0) { - ft.Add(STR_RIDE_LENGTH_ENTRY); + ft.Add(STR_RIDE_LENGTH_ENTRY); ft.Add(0); numLengths++; } @@ -5773,7 +5773,7 @@ static void WindowRideMeasurementsPaint(rct_window* w, rct_drawpixelinfo* dpi) // therefore we set the last entry to use the no-separator format now, post-format ft.Rewind(); ft.Increment((numLengths - 1) * 4); - ft.Add(STR_RIDE_LENGTH_ENTRY); + ft.Add(STR_RIDE_LENGTH_ENTRY); } ft.Rewind(); ft.Increment(numLengths * 4); @@ -6011,7 +6011,7 @@ static void WindowRideGraphs15(rct_window* w, int32_t scrollIndex, int32_t scrol * * rct2: 0x006AEA05 */ -static OpenRCT2String WindowRideGraphsTooltip(rct_window* w, const rct_widgetindex widgetIndex, const rct_string_id fallback) +static OpenRCT2String WindowRideGraphsTooltip(rct_window* w, const rct_widgetindex widgetIndex, const StringId fallback) { if (widgetIndex == WIDX_GRAPH) { @@ -6023,7 +6023,7 @@ static OpenRCT2String WindowRideGraphsTooltip(rct_window* w, const rct_widgetind { auto ft = Formatter(); ft.Increment(2); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number); + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number); ft.Add(measurement->vehicle_index + 1); return { fallback, ft }; } @@ -6159,7 +6159,7 @@ static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i // Horizontal grid lines int32_t listType = w->list_information_type & 0xFF; int16_t yUnit = window_graphs_y_axi[listType].unit; - rct_string_id stringID = window_graphs_y_axi[listType].label; + StringId stringID = window_graphs_y_axi[listType].label; int16_t yUnitInterval = window_graphs_y_axi[listType].unit_interval; int16_t yInterval = window_graphs_y_axi[listType].interval; @@ -6721,7 +6721,7 @@ static void WindowRideIncomeInvalidate(rct_window* w) */ static void WindowRideIncomePaint(rct_window* w, rct_drawpixelinfo* dpi) { - rct_string_id stringId; + StringId stringId; money64 profit; ShopItem primaryItem, secondaryItem; @@ -6950,7 +6950,7 @@ static void WindowRideCustomerPaint(rct_window* w, rct_drawpixelinfo* dpi) { ShopItem shopItem; int16_t popularity, satisfaction, queueTime; - rct_string_id stringId; + StringId stringId; WindowDrawWidgets(*w, dpi); WindowRideDrawTabImages(dpi, w); @@ -7026,7 +7026,7 @@ static void WindowRideCustomerPaint(rct_window* w, rct_drawpixelinfo* dpi) if (shopItem != ShopItem::None) { ft = Formatter(); - ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); + ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); ft.Add(ride->no_primary_items_sold); DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); screenCoords.y += LIST_ROW_HEIGHT; @@ -7038,7 +7038,7 @@ static void WindowRideCustomerPaint(rct_window* w, rct_drawpixelinfo* dpi) if (shopItem != ShopItem::None) { ft = Formatter(); - ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); + ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); ft.Add(ride->no_secondary_items_sold); DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); screenCoords.y += LIST_ROW_HEIGHT; diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 5fe9691576..e34a4b06a1 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -42,7 +42,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE; static constexpr const int32_t WH = 394; static constexpr const int32_t WW = 166; static constexpr const uint16_t ARROW_PULSE_DURATION = 200; @@ -151,10 +151,10 @@ static ScreenCoordsXY _trackPlaceShiftStart; static int32_t _trackPlaceShiftZ; static int32_t _trackPlaceZ; static money32 _trackPlaceCost; -static rct_string_id _trackPlaceErrorMessage; +static StringId _trackPlaceErrorMessage; static bool _autoRotatingShop; -static constexpr const rct_string_id RideConstructionSeatAngleRotationStrings[] = { +static constexpr const StringId RideConstructionSeatAngleRotationStrings[] = { STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_180, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_135, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_90, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_45, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_0, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_45, @@ -1430,7 +1430,7 @@ public: return; } - rct_string_id stringId = STR_RIDE_CONSTRUCTION_SPECIAL; + StringId stringId = STR_RIDE_CONSTRUCTION_SPECIAL; if (_currentTrackCurve & RideConstructionSpecialPieceSelected) { const auto& ted = GetTrackElementDescriptor(_currentTrackCurve & ~RideConstructionSpecialPieceSelected); @@ -2236,7 +2236,7 @@ private: if (res.Error != GameActions::Status::Ok) { _trackPlaceCost = MONEY32_UNDEFINED; - _trackPlaceErrorMessage = std::get(res.ErrorMessage); + _trackPlaceErrorMessage = std::get(res.ErrorMessage); } else { @@ -2492,7 +2492,7 @@ private: track_type_t trackPiece = _currentPossibleRideConfigurations[i]; const auto& ted = GetTrackElementDescriptor(trackPiece); - rct_string_id trackPieceStringId = ted.Description; + StringId trackPieceStringId = ted.Description; if (trackPieceStringId == STR_RAPIDS) { auto currentRide = get_ride(_currentRideIndex); @@ -3489,7 +3489,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) else { _trackPlaceCost = MONEY32_UNDEFINED; - _trackPlaceErrorMessage = std::get(mazeSetTrackResult.ErrorMessage); + _trackPlaceErrorMessage = std::get(mazeSetTrackResult.ErrorMessage); } gDisableErrorWindowSound = false; @@ -3497,7 +3497,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) if (mazeSetTrackResult.Error != GameActions::Status::Ok) { _rideConstructionState = RideConstructionState::Place; - rct_string_id errorText = std::get(mazeSetTrackResult.ErrorMessage); + StringId errorText = std::get(mazeSetTrackResult.ErrorMessage); z -= 8; if (errorText == STR_NOT_ENOUGH_CASH_REQUIRES || errorText == STR_CAN_ONLY_BUILD_THIS_UNDERWATER || errorText == STR_CAN_ONLY_BUILD_THIS_ON_WATER || errorText == STR_RIDE_CANT_BUILD_THIS_UNDERWATER @@ -3547,7 +3547,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) if (_trackPlaceCost == MONEY32_UNDEFINED) { - rct_string_id errorText = _trackPlaceErrorMessage; + StringId errorText = _trackPlaceErrorMessage; z -= 8; if (errorText == STR_NOT_ENOUGH_CASH_REQUIRES || errorText == STR_CAN_ONLY_BUILD_THIS_UNDERWATER || errorText == STR_CAN_ONLY_BUILD_THIS_ON_WATER || errorText == STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index a3cfa5c31f..496a358cff 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -26,7 +26,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_NONE; +static constexpr const StringId WINDOW_TITLE = STR_NONE; static constexpr const int32_t WH = 240; static constexpr const int32_t WW = 340; @@ -99,7 +99,7 @@ enum DROPDOWN_LIST_COUNT, }; -static constexpr const rct_string_id ride_info_type_string_mapping[DROPDOWN_LIST_COUNT] = { +static constexpr const StringId ride_info_type_string_mapping[DROPDOWN_LIST_COUNT] = { STR_STATUS, STR_POPULARITY, STR_SATISFACTION, @@ -120,7 +120,7 @@ static constexpr const rct_string_id ride_info_type_string_mapping[DROPDOWN_LIST STR_RIDE_LIST_NAUSEA, }; -static constexpr const rct_string_id ride_list_statusbar_count_strings[PAGE_COUNT] = { +static constexpr const StringId ride_list_statusbar_count_strings[PAGE_COUNT] = { STR_NUMBER_RIDES, STR_NUMBER_SHOPS_AND_STALLS, STR_NUMBER_RESTROOMS_AND_INFORMATION_KIOSKS, @@ -147,7 +147,7 @@ static constexpr const bool ride_info_type_money_mapping[DROPDOWN_LIST_COUNT] = false, // Nausea }; -static constexpr const rct_string_id page_names[] = { +static constexpr const StringId page_names[] = { STR_RIDES, STR_SHOPS_AND_STALLS, STR_RESTROOMS_AND_INFORMATION_KIOSKS, @@ -536,7 +536,7 @@ public: auto y = 0; for (size_t i = 0; i < _rideList.size(); i++) { - rct_string_id format = (_quickDemolishMode ? STR_RED_STRINGID : STR_BLACK_STRING); + StringId format = (_quickDemolishMode ? STR_RED_STRINGID : STR_BLACK_STRING); if (i == static_cast(selected_list_item)) { // Background highlight @@ -558,7 +558,7 @@ public: ft = Formatter(); ft.Increment(2); auto formatSecondaryEnabled = true; - rct_string_id formatSecondary = 0; + StringId formatSecondary = 0; switch (_windowRideListInformationType) { case INFORMATION_TYPE_STATUS: @@ -727,7 +727,7 @@ public: if (formatSecondaryEnabled) { ft.Rewind(); - ft.Add(formatSecondary); + ft.Add(formatSecondary); } DrawTextEllipsised(&dpi, { 160, y - 1 }, 157, format, ft); y += SCROLLABLE_ROW_HEIGHT; diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index b16acdda8b..15eb97fedd 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -60,7 +60,7 @@ static rct_widget window_quit_prompt_widgets[] = { WIDGETS_END, }; -static constexpr const rct_string_id window_save_prompt_labels[][2] = { +static constexpr const StringId window_save_prompt_labels[][2] = { { STR_LOAD_GAME_PROMPT_TITLE, STR_SAVE_BEFORE_LOADING }, { STR_QUIT_GAME_PROMPT_TITLE, STR_SAVE_BEFORE_QUITTING }, { STR_QUIT_GAME_2_PROMPT_TITLE, STR_SAVE_BEFORE_QUITTING_2 }, @@ -87,7 +87,7 @@ static rct_window_event_list window_save_prompt_events([](auto& events) rct_window* WindowSavePromptOpen() { int32_t width, height; - rct_string_id stringId; + StringId stringId; rct_window* window; PromptMode prompt_mode; rct_widget* widgets; diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 41b89ee23b..d81c9095d7 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -26,7 +26,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_SELECT_SCENARIO; +static constexpr const StringId WINDOW_TITLE = STR_SELECT_SCENARIO; static constexpr const int32_t WW = 734; static constexpr const int32_t WH = 384; static constexpr const int32_t SidebarWidth = 180; @@ -47,7 +47,7 @@ struct ScenarioListItem { struct { - rct_string_id string_id; + StringId string_id; } heading; struct { @@ -90,7 +90,7 @@ static rct_widget window_scenarioselect_widgets[] = { WIDGETS_END, }; -static constexpr const rct_string_id ScenarioOriginStringIds[] = { +static constexpr const StringId ScenarioOriginStringIds[] = { STR_SCENARIO_CATEGORY_RCT1, STR_SCENARIO_CATEGORY_RCT1_AA, STR_SCENARIO_CATEGORY_RCT1_LL, @@ -133,7 +133,7 @@ static rct_window_event_list window_scenarioselect_events([](auto& events) // clang-format on static void DrawCategoryHeading( - rct_window* w, rct_drawpixelinfo* dpi, int32_t left, int32_t right, int32_t y, rct_string_id stringId); + rct_window* w, rct_drawpixelinfo* dpi, int32_t left, int32_t right, int32_t y, StringId stringId); static void InitialiseListItems(rct_window* w); static bool IsScenarioVisible(rct_window* w, const scenario_index_entry* scenario); static bool IsLockingEnabled(rct_window* w); @@ -455,11 +455,11 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi) auto ft = Formatter(); if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor) { - ft.Add(ScenarioOriginStringIds[i]); + ft.Add(ScenarioOriginStringIds[i]); } else { // old-style - ft.Add(ScenarioCategoryStringIds[i]); + ft.Add(ScenarioCategoryStringIds[i]); } ScreenCoordsXY stringCoords(widget->midX() + w->windowPos.x, widget->midY() + w->windowPos.y - 3); @@ -501,7 +501,7 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi) + ScreenCoordsXY{ window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4, window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5 }; auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(scenario->name); DrawTextEllipsised( dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); @@ -509,22 +509,22 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi) // Scenario details ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(scenario->details); screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_BLACK_STRING, ft) + 5; // Scenario objective ft = Formatter(); - ft.Add(ObjectiveNames[scenario->objective_type]); + ft.Add(ObjectiveNames[scenario->objective_type]); if (scenario->objective_type == OBJECTIVE_BUILD_THE_BEST) { - rct_string_id rideTypeString = STR_NONE; + StringId rideTypeString = STR_NONE; auto rideTypeId = scenario->objective_arg_3; if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) { rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name; } - ft.Add(rideTypeString); + ft.Add(rideTypeString); } else { @@ -547,7 +547,7 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi) completedByName = scenario->highscore->name; } ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(completedByName); ft.Add(scenario->highscore->company_value); screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, ft); @@ -559,8 +559,8 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp uint8_t paletteIndex = ColourMapA[w->colours[1]].mid_light; gfx_clear(dpi, paletteIndex); - rct_string_id highlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID; - rct_string_id unhighlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_BLACK_STRING; + StringId highlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID; + StringId unhighlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_BLACK_STRING; const auto& listWidget = w->widgets[WIDX_SCENARIOLIST]; int32_t listWidth = listWidget.width() - 12; @@ -604,10 +604,10 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp // Draw scenario name char buffer[64]; safe_strcpy(buffer, scenario->name, sizeof(buffer)); - rct_string_id format = isDisabled ? static_cast(STR_STRINGID) - : (isHighlighted ? highlighted_format : unhighlighted_format); + StringId format = isDisabled ? static_cast(STR_STRINGID) + : (isHighlighted ? highlighted_format : unhighlighted_format); auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(buffer); colour_t colour = isDisabled ? w->colours[1] | COLOUR_FLAG_INSET : COLOUR_BLACK; FontSpriteBase fontSpriteBase = isDisabled ? FontSpriteBase::MEDIUM_DARK : FontSpriteBase::MEDIUM; @@ -631,8 +631,8 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp } safe_strcpy(buffer, completedByName, 64); ft = Formatter(); - ft.Add(STR_COMPLETED_BY); - ft.Add(STR_STRING); + ft.Add(STR_COMPLETED_BY); + ft.Add(STR_STRING); ft.Add(buffer); DrawTextBasic( dpi, { scrollCentre, y + scenarioTitleHeight + 1 }, format, ft, @@ -647,7 +647,7 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp } static void DrawCategoryHeading( - rct_window* w, rct_drawpixelinfo* dpi, int32_t left, int32_t right, int32_t y, rct_string_id stringId) + rct_window* w, rct_drawpixelinfo* dpi, int32_t left, int32_t right, int32_t y, StringId stringId) { colour_t baseColour = w->colours[1]; colour_t lightColour = ColourMapA[baseColour].lighter; @@ -707,7 +707,7 @@ static void InitialiseListItems(rct_window* w) continue; // Category heading - rct_string_id headingStringId = STR_NONE; + StringId headingStringId = STR_NONE; if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor) { if (w->selected_tab != static_cast(ScenarioSource::Real) && currentHeading != scenario->category) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index a0cd653652..29e546ee78 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -27,7 +27,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_NONE; +static constexpr const StringId WINDOW_TITLE = STR_NONE; constexpr int32_t WINDOW_SCENERY_MIN_WIDTH = 634; constexpr int32_t WINDOW_SCENERY_MIN_HEIGHT = 180; constexpr int32_t SCENERY_BUTTON_WIDTH = 66; @@ -459,7 +459,7 @@ public: } } - OpenRCT2String OnTooltip(const rct_widgetindex widgetIndex, const rct_string_id fallback) override + OpenRCT2String OnTooltip(const rct_widgetindex widgetIndex, const StringId fallback) override { if (widgetIndex >= WIDX_SCENERY_TAB_1) { @@ -470,7 +470,7 @@ public: if (tabInfo.IsMisc()) { auto ft = Formatter(); - ft.Add(STR_MISCELLANEOUS); + ft.Add(STR_MISCELLANEOUS); return { fallback, ft }; } @@ -478,7 +478,7 @@ public: if (sceneryEntry != nullptr) { auto ft = Formatter(); - ft.Add(sceneryEntry->name); + ft.Add(sceneryEntry->name); return { fallback, ft }; } } @@ -489,7 +489,7 @@ public: void OnPrepareDraw() override { // Set the window title - rct_string_id titleStringId = STR_MISCELLANEOUS; + StringId titleStringId = STR_MISCELLANEOUS; const auto tabIndex = _activeTabIndex; if (tabIndex < _tabEntries.size()) { @@ -680,7 +680,7 @@ public: } auto ft = Formatter(); - ft.Add(name); + ft.Add(name); DrawTextEllipsised(&dpi, { windowPos.x + 3, windowPos.y + height - 13 }, width - 19, STR_BLACK_STRING, ft); } @@ -1107,9 +1107,9 @@ private: } } - std::pair GetNameAndPrice(ScenerySelection selectedScenery) + std::pair GetNameAndPrice(ScenerySelection selectedScenery) { - rct_string_id name = STR_UNKNOWN_OBJECT_TYPE; + StringId name = STR_UNKNOWN_OBJECT_TYPE; money32 price = MONEY32_UNDEFINED; if (selectedScenery.IsUndefined() && gSceneryPlaceCost != MONEY32_UNDEFINED) { diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 893b1f5c9e..022739defb 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -37,9 +37,9 @@ static char _playerName[32 + 1]; static ServerList _serverList; -static std::future, rct_string_id>> _fetchFuture; +static std::future, StringId>> _fetchFuture; static uint32_t _numPlayersOnline = 0; -static rct_string_id _statusText = STR_SERVER_LIST_CONNECTING; +static StringId _statusText = STR_SERVER_LIST_CONNECTING; enum { @@ -82,7 +82,7 @@ static void WindowServerListScrollGetsize(rct_window* w, int32_t scrollIndex, in static void WindowServerListScrollMousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); static void WindowServerListScrollMouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); static void WindowServerListTextinput(rct_window* w, rct_widgetindex widgetIndex, char* text); -static OpenRCT2String WindowServerListTooltip(rct_window* const w, const rct_widgetindex widgetIndex, rct_string_id fallback); +static OpenRCT2String WindowServerListTooltip(rct_window* const w, const rct_widgetindex widgetIndex, StringId fallback); static void WindowServerListInvalidate(rct_window* w); static void WindowServerListPaint(rct_window* w, rct_drawpixelinfo* dpi); static void WindowServerListScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); @@ -296,7 +296,7 @@ static void WindowServerListScrollMouseover(rct_window* w, int32_t scrollIndex, w->selected_list_item = itemIndex; _showNetworkVersionTooltip = showNetworkVersionTooltip; - listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : STR_NONE; + listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : STR_NONE; WindowTooltipClose(); w->Invalidate(); @@ -343,7 +343,7 @@ static void WindowServerListTextinput(rct_window* w, rct_widgetindex widgetIndex } } -static OpenRCT2String WindowServerListTooltip(rct_window* const w, const rct_widgetindex widgetIndex, rct_string_id fallback) +static OpenRCT2String WindowServerListTooltip(rct_window* const w, const rct_widgetindex widgetIndex, StringId fallback) { auto ft = Formatter(); ft.Add(_version.c_str()); diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 1ea67532d2..cc3dc7a36d 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -19,7 +19,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::Ui; -static constexpr const rct_string_id WINDOW_TITLE = STR_SHORTCUTS_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_SHORTCUTS_TITLE; static constexpr const int32_t WW = 420; static constexpr const int32_t WH = 280; @@ -47,7 +47,7 @@ static rct_widget window_shortcut_widgets[] = { }; // clang-format on -static constexpr const rct_string_id CHANGE_WINDOW_TITLE = STR_SHORTCUT_CHANGE_TITLE; +static constexpr const StringId CHANGE_WINDOW_TITLE = STR_SHORTCUT_CHANGE_TITLE; static constexpr const int32_t CHANGE_WW = 250; static constexpr const int32_t CHANGE_WH = 80; @@ -68,7 +68,7 @@ class ChangeShortcutWindow final : public Window { private: std::string _shortcutId; - rct_string_id _shortcutLocalisedName{}; + StringId _shortcutLocalisedName{}; std::string _shortcutCustomName; public: @@ -127,11 +127,11 @@ public: auto ft = Formatter(); if (_shortcutCustomName.empty()) { - ft.Add(_shortcutLocalisedName); + ft.Add(_shortcutLocalisedName); } else { - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(_shortcutCustomName.c_str()); } DrawTextWrapped(&dpi, stringCoords, 242, STR_SHORTCUT_CHANGE_PROMPT, ft, { TextAlignment::CENTRE }); @@ -159,7 +159,7 @@ private: struct ShortcutStringPair { std::string ShortcutId; - rct_string_id StringId = STR_NONE; + StringId StringId = STR_NONE; std::string CustomString; std::string Binding; }; @@ -521,14 +521,14 @@ private: auto bindingOffset = (scrollWidth * 2) / 3; auto ft = Formatter(); - ft.Add(STR_SHORTCUT_ENTRY_FORMAT); + ft.Add(STR_SHORTCUT_ENTRY_FORMAT); if (shortcut.CustomString.empty()) { - ft.Add(shortcut.StringId); + ft.Add(shortcut.StringId); } else { - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(shortcut.CustomString.c_str()); } DrawTextEllipsised(&dpi, { 0, y - 1 }, bindingOffset, format, ft); @@ -536,7 +536,7 @@ private: if (!shortcut.Binding.empty()) { ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(shortcut.Binding.c_str()); DrawTextEllipsised(&dpi, { bindingOffset, y - 1 }, 150, format, ft); } diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index a88bf948bd..55e670663b 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -25,7 +25,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_SIGN; +static constexpr const StringId WINDOW_TITLE = STR_SIGN; static constexpr const int32_t WW = 113; static constexpr const int32_t WH = 96; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 53e57d1f0d..eab9ddab77 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -34,7 +34,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_STRINGID; +static constexpr const StringId WINDOW_TITLE = STR_STRINGID; static constexpr const int32_t WW = 190; static constexpr const int32_t WH = 180; diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index 4a128405d2..afbdee4aee 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -18,7 +18,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_SACK_STAFF; +static constexpr const StringId WINDOW_TITLE = STR_SACK_STAFF; static constexpr const int32_t WW = 200; static constexpr const int32_t WH = 100; diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 9205d00145..8711df5857 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -60,7 +60,7 @@ enum WindowStaffListWidgetIdx WIDX_STAFF_LIST_MAP, }; -static constexpr const rct_string_id WINDOW_TITLE = STR_STAFF; +static constexpr const StringId WINDOW_TITLE = STR_STAFF; static constexpr const int32_t WW = 320; static constexpr const int32_t WH = 270; constexpr int32_t MAX_WW = 500; @@ -89,9 +89,9 @@ class StaffListWindow final : public Window private: struct StaffNamingConvention { - rct_string_id Plural; - rct_string_id Singular; - rct_string_id ActionHire; + StringId Plural; + StringId Singular; + StringId ActionHire; }; std::vector _staffList; @@ -300,7 +300,7 @@ public: auto ft = Formatter(); ft.Add(_staffList.size()); - ft.Add(staffTypeStringId); + ft.Add(staffTypeStringId); DrawTextBasic( &dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_STAFF_LIST_LIST].bottom + 2 }, STR_STAFF_LIST_COUNTER, ft); @@ -460,7 +460,7 @@ public: else { auto ft = Formatter(); - ft.Add(GetStaffNamingConvention(GetSelectedStaffType()).Plural); + ft.Add(GetStaffNamingConvention(GetSelectedStaffType()).Plural); context_show_error(STR_NO_THING_IN_PARK_YET, STR_NONE, ft); } } diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index af6222100e..7f88c61d63 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -44,10 +44,10 @@ private: widget_identifier _parentWidget{}; std::string _title; - rct_string_id _titleStringId = STR_NONE; + StringId _titleStringId = STR_NONE; std::string _description; - rct_string_id _descriptionStringId = STR_NONE; + StringId _descriptionStringId = STR_NONE; Formatter _descriptionArgs; std::function _callback; @@ -90,7 +90,7 @@ public: } } - void SetTitle(rct_string_id title, rct_string_id description, const Formatter& decriptionArgs) + void SetTitle(StringId title, StringId description, const Formatter& decriptionArgs) { _titleStringId = title; _descriptionStringId = description; @@ -371,8 +371,8 @@ private: }; void WindowTextInputRawOpen( - rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, - const Formatter& descriptionArgs, const_utf8string existing_text, int32_t maxLength) + rct_window* call_w, rct_widgetindex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, + const_utf8string existing_text, int32_t maxLength) { window_close_by_class(WC_TEXTINPUT); @@ -401,8 +401,8 @@ void WindowTextInputOpen( } void WindowTextInputOpen( - rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, - const Formatter& descriptionArgs, rct_string_id existing_text, uintptr_t existing_args, int32_t maxLength) + rct_window* call_w, rct_widgetindex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, + StringId existing_text, uintptr_t existing_args, int32_t maxLength) { auto existingText = format_string(existing_text, &existing_args); WindowTextInputRawOpen(call_w, call_widget, title, description, descriptionArgs, existingText.c_str(), maxLength); diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 7f1bdf4f00..dbdebc3364 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -95,7 +95,7 @@ enum WindowThemesWidgetIdx WIDX_THEMES_RCT1_BOTTOM_TOOLBAR }; -static constexpr const rct_string_id WINDOW_TITLE = STR_THEMES_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_THEMES_TITLE; static constexpr const int32_t WW = 320; static constexpr const int32_t WH = 107; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 8ac98e42c3..1522f45e69 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -38,19 +38,19 @@ #include #include -static constexpr const rct_string_id EntranceTypeStringIds[] = { +static constexpr const StringId EntranceTypeStringIds[] = { STR_TILE_INSPECTOR_ENTRANCE_TYPE_RIDE_ENTRANCE, STR_TILE_INSPECTOR_ENTRANCE_TYPE_RIDE_EXIT, STR_TILE_INSPECTOR_ENTRANCE_TYPE_PARK_ENTRANC, }; -static constexpr const rct_string_id ParkEntrancePartStringIds[] = { +static constexpr const StringId ParkEntrancePartStringIds[] = { STR_TILE_INSPECTOR_ENTRANCE_MIDDLE, STR_TILE_INSPECTOR_ENTRANCE_LEFT, STR_TILE_INSPECTOR_ENTRANCE_RIGHT, }; -static constexpr const rct_string_id WallSlopeStringIds[] = { +static constexpr const StringId WallSlopeStringIds[] = { STR_TILE_INSPECTOR_WALL_FLAT, STR_TILE_INSPECTOR_WALL_SLOPED_LEFT, STR_TILE_INSPECTOR_WALL_SLOPED_RIGHT, @@ -179,7 +179,7 @@ static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_X_DECREASE == WIDX_SPINNER_X_DECRE static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_Y_INCREASE == WIDX_SPINNER_Y_INCREASE); static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_Y_DECREASE == WIDX_SPINNER_Y_DECREASE); -static constexpr const rct_string_id WINDOW_TITLE = STR_TILE_INSPECTOR_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_TILE_INSPECTOR_TITLE; // Window sizes static constexpr const int32_t WW = 400; @@ -404,11 +404,11 @@ struct TileInspectorGroupboxSettings int16_t details_top_offset, details_bottom_offset; int16_t properties_top_offset, properties_bottom_offset; // String to be displayed in the details groupbox - rct_string_id string_id; + StringId string_id; }; static constexpr TileInspectorGroupboxSettings MakeGroupboxSettings( - int16_t detailsHeight, int16_t propertiesHeight, rct_string_id stringId) + int16_t detailsHeight, int16_t propertiesHeight, StringId stringId) { TileInspectorGroupboxSettings settings{}; decltype(settings.properties_bottom_offset) offsetSum = 0; @@ -1762,30 +1762,30 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) { // Details // Terrain texture name - rct_string_id terrainNameId = STR_EMPTY; + StringId terrainNameId = STR_EMPTY; auto surfaceStyle = tileElement->AsSurface()->GetSurfaceStyleObject(); if (surfaceStyle != nullptr) { terrainNameId = surfaceStyle->NameStringId; } auto ft = Formatter(); - ft.Add(terrainNameId); + ft.Add(terrainNameId); DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { w->colours[1] }); // Edge texture name - rct_string_id terrainEdgeNameId = STR_EMPTY; + StringId terrainEdgeNameId = STR_EMPTY; auto edgeStyle = tileElement->AsSurface()->GetEdgeStyleObject(); if (edgeStyle != nullptr) { terrainEdgeNameId = edgeStyle->NameStringId; } ft = Formatter(); - ft.Add(terrainEdgeNameId); + ft.Add(terrainEdgeNameId); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, ft, { w->colours[1] }); // Land ownership - rct_string_id landOwnership; + StringId landOwnership; if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_OWNED) landOwnership = STR_LAND_OWNED; else if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_AVAILABLE) @@ -1797,7 +1797,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) else landOwnership = STR_TILE_INSPECTOR_LAND_NOT_OWNED_AND_NOT_AVAILABLE; ft = Formatter(); - ft.Add(landOwnership); + ft.Add(landOwnership); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, ft, { w->colours[1] }); @@ -1838,7 +1838,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) if (surfaceObj != nullptr) { auto ft = Formatter(); - ft.Add(surfaceObj->NameStringId); + ft.Add(surfaceObj->NameStringId); DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_FOOTPATH_SURFACE_NAME, ft, { COLOUR_WHITE }); } @@ -1847,7 +1847,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) if (railingsObj != nullptr) { auto ft = Formatter(); - ft.Add(railingsObj->NameStringId); + ft.Add(railingsObj->NameStringId); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_FOOTPATH_RAILINGS_NAME, ft, { COLOUR_WHITE }); @@ -1858,7 +1858,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) // Legacy path name auto footpathEntry = reinterpret_cast(footpathObj->GetLegacyData()); auto ft = Formatter(); - ft.Add(footpathEntry->string_idx); + ft.Add(footpathEntry->string_idx); DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE }); } @@ -1867,11 +1867,10 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) { const auto pathAdditionType = tileElement->AsPath()->GetAdditionEntryIndex(); const auto* pathBitEntry = get_footpath_item_entry(pathAdditionType); - rct_string_id additionNameId = pathBitEntry != nullptr - ? pathBitEntry->name - : static_cast(STR_UNKNOWN_OBJECT_TYPE); + StringId additionNameId = pathBitEntry != nullptr ? pathBitEntry->name + : static_cast(STR_UNKNOWN_OBJECT_TYPE); auto ft = Formatter(); - ft.Add(additionNameId); + ft.Add(additionNameId); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, ft, { COLOUR_WHITE }); @@ -1925,7 +1924,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) // Ride type. Individual pieces may be of a different ride type from the ride it belongs to. const auto& rtd = GetRideTypeDescriptor(trackElement->GetRideType()); ft = Formatter(); - ft.Add(rtd.Naming.Name); + ft.Add(rtd.Naming.Name); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, { w->colours[1] }); @@ -1943,7 +1942,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) { auto stationIndex = trackElement->GetStationIndex(); ft = Formatter(); - ft.Add(STR_COMMA16); + ft.Add(STR_COMMA16); ft.Add(stationIndex.ToUnderlying()); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { w->colours[1] }); @@ -1952,14 +1951,14 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) { const char* stationNone = "-"; ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(stationNone); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { w->colours[1] }); } ft = Formatter(); - ft.Add(ColourSchemeNames[trackElement->GetColourScheme()]); + ft.Add(ColourSchemeNames[trackElement->GetColourScheme()]); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, ft, { w->colours[1] }); @@ -1989,14 +1988,14 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) if (sceneryEntry != nullptr && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE))) { int16_t quadrant = tileElement->AsSmallScenery()->GetSceneryQuadrant(); - static constexpr rct_string_id _quadrantStringIdx[] = { + static constexpr StringId _quadrantStringIdx[] = { STR_TILE_INSPECTOR_SCENERY_QUADRANT_SW, STR_TILE_INSPECTOR_SCENERY_QUADRANT_NW, STR_TILE_INSPECTOR_SCENERY_QUADRANT_NE, STR_TILE_INSPECTOR_SCENERY_QUADRANT_SE, }; ft = Formatter(); - ft.Add(_quadrantStringIdx[quadrant]); + ft.Add(_quadrantStringIdx[quadrant]); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, ft, { w->colours[1] }); @@ -2036,14 +2035,14 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) // Details // Entrance type auto ft = Formatter(); - ft.Add(EntranceTypeStringIds[tileElement->AsEntrance()->GetEntranceType()]); + ft.Add(EntranceTypeStringIds[tileElement->AsEntrance()->GetEntranceType()]); DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, ft, { w->colours[1] }); if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) { // TODO: Make this work with Left/Right park entrance parts ft = Formatter(); - ft.Add(park_entrance_get_index({ windowTileInspectorToolMap, tileElement->GetBaseZ() })); + ft.Add(park_entrance_get_index({ windowTileInspectorToolMap, tileElement->GetBaseZ() })); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, { w->colours[1] }); @@ -2072,7 +2071,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) { // Entrance part ft = Formatter(); - ft.Add(ParkEntrancePartStringIds[tileElement->AsEntrance()->GetSequenceIndex()]); + ft.Add(ParkEntrancePartStringIds[tileElement->AsEntrance()->GetSequenceIndex()]); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, ft, { w->colours[1] }); } @@ -2087,7 +2086,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi) // Station index auto stationIndex = tileElement->AsEntrance()->GetStationIndex(); ft = Formatter(); - ft.Add(STR_COMMA16); + ft.Add(STR_COMMA16); ft.Add(stationIndex.ToUnderlying()); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { w->colours[1] }); @@ -2303,9 +2302,9 @@ static void WindowTileInspectorScrollpaint(rct_window* w, rct_drawpixelinfo* dpi gfx_fill_rect(dpi, fillRectangle, ColourMapA[w->colours[1]].light | 0x1000000); } - const rct_string_id stringFormat = (selectedRow || hoveredRow) ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID; + const StringId stringFormat = (selectedRow || hoveredRow) ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID; auto checkboxFormatter = Formatter(); - checkboxFormatter.Add(STR_STRING); + checkboxFormatter.Add(STR_STRING); checkboxFormatter.Add(CheckBoxMarkString); // Draw checkbox and check if visible @@ -2313,7 +2312,7 @@ static void WindowTileInspectorScrollpaint(rct_window* w, rct_drawpixelinfo* dpi if (!tileElement->IsInvisible()) { auto eyeFormatter = Formatter(); - eyeFormatter.Add(STR_STRING); + eyeFormatter.Add(STR_STRING); eyeFormatter.Add(EyeString); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 2, 1 }, stringFormat, eyeFormatter); } @@ -2372,25 +2371,25 @@ static void WindowTileInspectorScrollpaint(rct_window* w, rct_drawpixelinfo* dpi // Element name auto ft = Formatter(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(typeName); DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ TypeColumnXY.x, 0 }, TypeColumnSize.width, stringFormat, ft); // Base height ft = Formatter(); - ft.Add(STR_FORMAT_INTEGER); + ft.Add(STR_FORMAT_INTEGER); ft.Add(tileElement->base_height); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ BaseHeightColumnXY.x, 0 }, stringFormat, ft); // Clearance height ft = Formatter(); - ft.Add(STR_FORMAT_INTEGER); + ft.Add(STR_FORMAT_INTEGER); ft.Add(clearanceHeight); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ ClearanceHeightColumnXY.x, 0 }, stringFormat, ft); // Direction ft = Formatter(); - ft.Add(STR_FORMAT_INTEGER); + ft.Add(STR_FORMAT_INTEGER); ft.Add(tileElement->GetDirection()); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ DirectionColumnXY.x, 0 }, stringFormat, ft); diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index f8e1be61fb..fe072996d1 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1898,7 +1898,7 @@ static void WindowTopToolbarSceneryToolDown(const ScreenCoordsXY& windowPos, rct break; } - if (const auto* message = std::get_if(&res.ErrorMessage)) + if (const auto* message = std::get_if(&res.ErrorMessage)) { if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) { @@ -1952,7 +1952,7 @@ static void WindowTopToolbarSceneryToolDown(const ScreenCoordsXY& windowPos, rct break; } - if (const auto* message = std::get_if(&res.ErrorMessage)) + if (const auto* message = std::get_if(&res.ErrorMessage)) { if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) { diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 69e6230f32..cb92587d10 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -17,7 +17,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_STRING; +static constexpr const StringId WINDOW_TITLE = STR_STRING; static constexpr const int32_t WH = 44; static constexpr const int32_t WW = 250; static constexpr const int32_t WH_DELETE_PROMPT = 74; diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 04d4503b20..2a99e2348a 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -36,7 +36,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; -static constexpr const rct_string_id WINDOW_TITLE = STR_STRING; +static constexpr const StringId WINDOW_TITLE = STR_STRING; static constexpr const int32_t WH = 124; static constexpr const int32_t WW = 200; constexpr int16_t TRACK_MINI_PREVIEW_WIDTH = 168; diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index f4c46cf9f7..76bed16968 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -27,7 +27,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_SELECT_DESIGN; +static constexpr const StringId WINDOW_TITLE = STR_SELECT_DESIGN; static constexpr const int32_t WH = 441; static constexpr const int32_t WW = 600; static constexpr const int32_t DEBUG_PATH_HEIGHT = 12; @@ -361,7 +361,7 @@ public: void OnPrepareDraw() override { - rct_string_id stringId = STR_NONE; + StringId stringId = STR_NONE; rct_ride_entry* entry = get_ride_entry(_window_track_list_item.EntryIndex); if (entry != nullptr) @@ -370,7 +370,7 @@ public: stringId = rideName.Name; } - Formatter::Common().Add(stringId); + Formatter::Common().Add(stringId); if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { window_track_list_widgets[WIDX_TITLE].text = STR_TRACK_DESIGNS; @@ -580,7 +580,7 @@ public: // Ride length ft = Formatter(); - ft.Add(STR_RIDE_LENGTH_ENTRY); + ft.Add(STR_RIDE_LENGTH_ENTRY); ft.Add(_loadedTrackDesign->ride_length); DrawTextEllipsised(&dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); screenPos.y += LIST_ROW_HEIGHT; @@ -683,7 +683,7 @@ public: else { // Build custom track item - rct_string_id stringId; + StringId stringId; if (listIndex == static_cast(selected_list_item)) { // Highlight @@ -698,7 +698,7 @@ public: } auto ft = Formatter(); - ft.Add(STR_BUILD_CUSTOM_DESIGN); + ft.Add(STR_BUILD_CUSTOM_DESIGN); DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); screenCoords.y += SCROLLABLE_ROW_HEIGHT; listIndex++; @@ -708,7 +708,7 @@ public: { if (screenCoords.y + SCROLLABLE_ROW_HEIGHT >= dpi.y && screenCoords.y < dpi.y + dpi.height) { - rct_string_id stringId; + StringId stringId; if (listIndex == static_cast(selected_list_item)) { // Highlight @@ -724,7 +724,7 @@ public: // Draw track name auto ft = Formatter(); - ft.Add(STR_TRACK_LIST_NAME_FORMAT); + ft.Add(STR_TRACK_LIST_NAME_FORMAT); ft.Add(_trackDesigns[i].name.c_str()); DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); } diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index d52ad0e64b..ece3aad09e 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -54,7 +54,7 @@ enum WINDOW_TRANSPARENCY_WIDGET_IDX #pragma region MEASUREMENTS -static constexpr const rct_string_id WINDOW_TITLE = STR_TRANSPARENCY_OPTIONS_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_TRANSPARENCY_OPTIONS_TITLE; static constexpr const int32_t WW = 204; static constexpr const int32_t WH = 57; diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index efb39dc375..3fc58a6569 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -44,7 +44,7 @@ enum class DisplayType { #pragma region Widgets -static constexpr const rct_string_id WINDOW_TITLE = STR_VIEW_CLIPPING_TITLE; +static constexpr const StringId WINDOW_TITLE = STR_VIEW_CLIPPING_TITLE; static constexpr const int32_t WW = 180; static constexpr const int32_t WH = 155; diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 411b8f8418..de2af8d829 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -32,7 +32,7 @@ enum WindowViewportWidgetIdx #pragma region MEASUREMENTS -static constexpr const rct_string_id WINDOW_TITLE = STR_VIEWPORT_NO; +static constexpr const StringId WINDOW_TITLE = STR_VIEWPORT_NO; static constexpr const int32_t WW = 200; static constexpr const int32_t WH = 200; diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 931c735957..0270681430 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -17,7 +17,7 @@ #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_WATER; +static constexpr const StringId WINDOW_TITLE = STR_WATER; static constexpr const int32_t WH = 77; static constexpr const int32_t WW = 76; diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 729682b0f6..b11efd69a0 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -102,7 +102,7 @@ rct_window* WindowStaffFirePromptOpen(Peep* peep); rct_window* WindowScenarioselectOpen(scenarioselect_callback callback, bool titleEditor); rct_window* WindowScenarioselectOpen(std::function callback, bool titleEditor, bool disableLocking); -rct_window* WindowErrorOpen(rct_string_id title, rct_string_id message, const class Formatter& formatter); +rct_window* WindowErrorOpen(StringId title, StringId message, const class Formatter& formatter); rct_window* WindowErrorOpen(std::string_view title, std::string_view message); struct TrackDesign; rct_window* WindowLoadsaveOpen( @@ -151,11 +151,11 @@ void WindowNetworkStatusClose(); void WindowTextInputKey(rct_window* w, char keychar); void WindowTextInputOpen( - rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, - const Formatter& descriptionArgs, rct_string_id existing_text, uintptr_t existing_args, int32_t maxLength); + rct_window* call_w, rct_widgetindex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, + StringId existing_text, uintptr_t existing_args, int32_t maxLength); void WindowTextInputRawOpen( - rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, - const Formatter& descriptionArgs, const_utf8string existing_text, int32_t maxLength); + rct_window* call_w, rct_widgetindex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, + const_utf8string existing_text, int32_t maxLength); void WindowTextInputOpen( std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 706750c735..4bc6e7eef9 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -1478,7 +1478,7 @@ void context_force_close_window_by_class(rct_windowclass windowClass) windowManager->ForceClose(windowClass); } -rct_window* context_show_error(rct_string_id title, rct_string_id message, const Formatter& args) +rct_window* context_show_error(StringId title, StringId message, const Formatter& args) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); return windowManager->ShowError(title, message, args); diff --git a/src/openrct2/Context.h b/src/openrct2/Context.h index de3e2a6493..cf841f102f 100644 --- a/src/openrct2/Context.h +++ b/src/openrct2/Context.h @@ -211,7 +211,7 @@ void context_set_cursor_trap(bool value); rct_window* context_open_window(rct_windowclass wc); rct_window* context_open_detail_window(uint8_t type, int32_t id); rct_window* context_open_window_view(uint8_t view); -rct_window* context_show_error(rct_string_id title, rct_string_id message, const class Formatter& args); +rct_window* context_show_error(StringId title, StringId message, const class Formatter& args); rct_window* context_open_intent(Intent* intent); void context_broadcast_intent(Intent* intent); void context_force_close_window_by_class(rct_windowclass wc); diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index dfe19d2c22..4c7939756d 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -469,7 +469,7 @@ namespace Editor * * rct2: 0x006AB9B8 */ - std::pair CheckObjectSelection() + std::pair CheckObjectSelection() { bool isTrackDesignerManager = gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER); diff --git a/src/openrct2/Editor.h b/src/openrct2/Editor.h index 90b32d3d85..d9d230c5f2 100644 --- a/src/openrct2/Editor.h +++ b/src/openrct2/Editor.h @@ -23,7 +23,7 @@ namespace Editor bool LoadLandscape(const utf8* path); ResultWithMessage CheckPark(); - std::pair CheckObjectSelection(); + std::pair CheckObjectSelection(); void OpenWindowsForCurrentStep(); diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 1906b10533..ad871a3c98 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -33,7 +33,7 @@ #include #include -std::optional _gSceneryGroupPartialSelectError; +std::optional _gSceneryGroupPartialSelectError; std::vector _objectSelectionFlags; int32_t _numSelectedObjectsForType[EnumValue(ObjectType::Count)]; static int32_t _numAvailableObjectsForType[EnumValue(ObjectType::Count)]; @@ -50,7 +50,7 @@ static void ReplaceSelectedWaterPalette(const ObjectRepositoryItem* item); * optional / required dependants of an * object. */ -static constexpr ResultWithMessage ObjectSelectionError(bool isMasterObject, rct_string_id message) +static constexpr ResultWithMessage ObjectSelectionError(bool isMasterObject, StringId message) { if (!isMasterObject) reset_selected_object_count_and_size(); diff --git a/src/openrct2/EditorObjectSelectionSession.h b/src/openrct2/EditorObjectSelectionSession.h index 62b232bf11..bdc5dc9635 100644 --- a/src/openrct2/EditorObjectSelectionSession.h +++ b/src/openrct2/EditorObjectSelectionSession.h @@ -25,7 +25,7 @@ enum EDITOR_INPUT_FLAGS INPUT_FLAG_EDITOR_OBJECT_ALWAYS_REQUIRED = (1 << 3) }; -extern std::optional _gSceneryGroupPartialSelectError; +extern std::optional _gSceneryGroupPartialSelectError; extern std::vector _objectSelectionFlags; extern int32_t _numSelectedObjectsForType[EnumValue(ObjectType::Count)]; diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index bee1db52d0..5b70d80b3e 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -67,7 +67,7 @@ GameActions::Result ClearAction::QueryExecute(bool executing) const auto noValidTiles = true; auto error = GameActions::Status::Ok; - rct_string_id errorMessage = STR_NONE; + StringId errorMessage = STR_NONE; money32 totalCost = 0; auto validRange = ClampRangeWithinMap(_range); diff --git a/src/openrct2/actions/GameActionResult.cpp b/src/openrct2/actions/GameActionResult.cpp index 3659a6b772..4d119c992d 100644 --- a/src/openrct2/actions/GameActionResult.cpp +++ b/src/openrct2/actions/GameActionResult.cpp @@ -4,7 +4,7 @@ namespace GameActions { - Result::Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args /*= nullptr*/) + Result::Result(GameActions::Status error, StringId title, StringId message, uint8_t* args /*= nullptr*/) : Error(error) , ErrorTitle(title) , ErrorMessage(message) @@ -23,7 +23,7 @@ namespace GameActions { return str; } - std::string operator()(const rct_string_id strId) const + std::string operator()(const StringId strId) const { return format_string(strId, ErrorMessageArgs); } diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h index 1dce6e8b78..9a3dd98b0d 100644 --- a/src/openrct2/actions/GameActionResult.h +++ b/src/openrct2/actions/GameActionResult.h @@ -61,7 +61,7 @@ namespace GameActions class Result final { public: - using StringVariant = std::variant; + using StringVariant = std::variant; GameActions::Status Error = GameActions::Status::Ok; StringVariant ErrorTitle = STR_NONE; @@ -81,7 +81,7 @@ namespace GameActions #endif Result() = default; - Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args = nullptr); + Result(GameActions::Status error, StringId title, StringId message, uint8_t* args = nullptr); std::string GetErrorTitle() const; std::string GetErrorMessage() const; diff --git a/src/openrct2/actions/LandBuyRightsAction.h b/src/openrct2/actions/LandBuyRightsAction.h index 28d5857ec3..3eae10abae 100644 --- a/src/openrct2/actions/LandBuyRightsAction.h +++ b/src/openrct2/actions/LandBuyRightsAction.h @@ -24,7 +24,7 @@ private: MapRange _range; LandBuyRightSetting _setting{ LandBuyRightSetting::Count }; - constexpr static rct_string_id _ErrorTitles[] = { + constexpr static StringId _ErrorTitles[] = { STR_CANT_BUY_LAND, STR_CANT_BUY_CONSTRUCTION_RIGHTS_HERE, }; diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index d238b89a5a..8b7bcbfc66 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -52,7 +52,7 @@ GameActions::Result LandSetHeightAction::Query() const return GameActions::Result(GameActions::Status::Disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY, STR_NONE); } - rct_string_id errorTitle = CheckParameters(); + StringId errorTitle = CheckParameters(); if (errorTitle != STR_NONE) { return GameActions::Result(GameActions::Status::Disallowed, errorTitle, STR_NONE); @@ -168,7 +168,7 @@ GameActions::Result LandSetHeightAction::Execute() const return res; } -rct_string_id LandSetHeightAction::CheckParameters() const +StringId LandSetHeightAction::CheckParameters() const { if (!LocationValid(_coords)) { @@ -261,7 +261,7 @@ void LandSetHeightAction::SmallSceneryRemoval() const } while (!(tileElement++)->IsLastForTile()); } -rct_string_id LandSetHeightAction::CheckRideSupports() const +StringId LandSetHeightAction::CheckRideSupports() const { for (auto* trackElement : TileElementsView(_coords)) { diff --git a/src/openrct2/actions/LandSetHeightAction.h b/src/openrct2/actions/LandSetHeightAction.h index 9fbbe58dea..7dba07f930 100644 --- a/src/openrct2/actions/LandSetHeightAction.h +++ b/src/openrct2/actions/LandSetHeightAction.h @@ -29,11 +29,11 @@ public: GameActions::Result Execute() const override; private: - rct_string_id CheckParameters() const; + StringId CheckParameters() const; TileElement* CheckTreeObstructions() const; money32 GetSmallSceneryRemovalCost() const; void SmallSceneryRemoval() const; - rct_string_id CheckRideSupports() const; + StringId CheckRideSupports() const; TileElement* CheckFloatingStructures(TileElement* surfaceElement, uint8_t zCorner) const; money32 GetSurfaceHeightChangeCost(SurfaceElement* surfaceElement) const; void SetSurfaceHeight(TileElement* surfaceElement) const; diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index a434d7c6db..0b11c57ae0 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -608,8 +608,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const } default: log_error("Invalid map selection %u", _selectionType); - return GameActions::Result( - GameActions::Status::InvalidParameters, std::get(res.ErrorTitle), STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, std::get(res.ErrorTitle), STR_NONE); } // switch selectionType // Raise / lower the land tool selection area diff --git a/src/openrct2/actions/LandSmoothAction.h b/src/openrct2/actions/LandSmoothAction.h index 406da35a5a..c13ce82891 100644 --- a/src/openrct2/actions/LandSmoothAction.h +++ b/src/openrct2/actions/LandSmoothAction.h @@ -19,7 +19,7 @@ private: uint8_t _selectionType{}; bool _isLowering{}; - constexpr static rct_string_id _ErrorTitles[] = { + constexpr static StringId _ErrorTitles[] = { STR_CANT_LOWER_LAND_HERE, STR_CANT_RAISE_LAND_HERE, }; diff --git a/src/openrct2/actions/ParkSetParameterAction.h b/src/openrct2/actions/ParkSetParameterAction.h index e0902a7241..cf7aef16c3 100644 --- a/src/openrct2/actions/ParkSetParameterAction.h +++ b/src/openrct2/actions/ParkSetParameterAction.h @@ -25,7 +25,7 @@ private: ParkParameter _parameter{ ParkParameter::Count }; uint64_t _value{}; - constexpr static rct_string_id _ErrorTitles[] = { + constexpr static StringId _ErrorTitles[] = { STR_CANT_CLOSE_PARK, STR_CANT_OPEN_PARK, STR_NONE, diff --git a/src/openrct2/actions/ResultWithMessage.h b/src/openrct2/actions/ResultWithMessage.h index eb1b38bd31..873d7439a5 100644 --- a/src/openrct2/actions/ResultWithMessage.h +++ b/src/openrct2/actions/ResultWithMessage.h @@ -15,5 +15,5 @@ struct ResultWithMessage { bool Successful{}; - rct_string_id Message = STR_NONE; + StringId Message = STR_NONE; }; diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 7a8627cf66..d630414c4a 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -273,7 +273,7 @@ bool RideSetSettingAction::ride_is_valid_operation_option(Ride* ride) const return _value >= minValue && _value <= maxValue; } -rct_string_id RideSetSettingAction::GetOperationErrorMessage(Ride* ride) const +StringId RideSetSettingAction::GetOperationErrorMessage(Ride* ride) const { switch (ride->mode) { diff --git a/src/openrct2/actions/RideSetSettingAction.h b/src/openrct2/actions/RideSetSettingAction.h index fe8c9c49ad..d2356a2e79 100644 --- a/src/openrct2/actions/RideSetSettingAction.h +++ b/src/openrct2/actions/RideSetSettingAction.h @@ -50,5 +50,5 @@ private: bool ride_is_valid_lift_hill_speed(Ride* ride) const; bool ride_is_valid_num_circuits() const; bool ride_is_valid_operation_option(Ride* ride) const; - rct_string_id GetOperationErrorMessage(Ride* ride) const; + StringId GetOperationErrorMessage(Ride* ride) const; }; diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 60c9bd6822..2f7985354c 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -22,7 +22,7 @@ #include "../ui/WindowManager.h" #include "../world/Park.h" -static rct_string_id _StatusErrorTitles[] = { +static StringId _StatusErrorTitles[] = { STR_CANT_CLOSE, STR_CANT_OPEN, STR_CANT_TEST, diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index d146d4d2d3..dbaa4d0407 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -25,7 +25,7 @@ #include "../util/Util.h" #include "../world/Park.h" -constexpr static rct_string_id SetVehicleTypeErrorTitle[] = { +constexpr static StringId SetVehicleTypeErrorTitle[] = { STR_RIDE_SET_VEHICLE_SET_NUM_TRAINS_FAIL, STR_RIDE_SET_VEHICLE_SET_NUM_CARS_PER_TRAIN_FAIL, STR_RIDE_SET_VEHICLE_TYPE_FAIL, diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index ba00851208..39b3d6f6d1 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -45,7 +45,7 @@ GameActions::Result WaterSetHeightAction::Query() const return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); } - rct_string_id errorMsg = CheckParameters(); + StringId errorMsg = CheckParameters(); if (errorMsg != STR_NONE) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, errorMsg); @@ -131,7 +131,7 @@ GameActions::Result WaterSetHeightAction::Execute() const return res; } -rct_string_id WaterSetHeightAction::CheckParameters() const +StringId WaterSetHeightAction::CheckParameters() const { auto mapSizeMax = GetMapSizeMaxXY(); if (_coords.x > mapSizeMax.x || _coords.y > mapSizeMax.y) diff --git a/src/openrct2/actions/WaterSetHeightAction.h b/src/openrct2/actions/WaterSetHeightAction.h index dae310ee31..14f39556b5 100644 --- a/src/openrct2/actions/WaterSetHeightAction.h +++ b/src/openrct2/actions/WaterSetHeightAction.h @@ -28,5 +28,5 @@ public: GameActions::Result Execute() const override; private: - rct_string_id CheckParameters() const; + StringId CheckParameters() const; }; diff --git a/src/openrct2/common.h b/src/openrct2/common.h index d22eb49625..26b8616526 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -133,7 +133,7 @@ constexpr money16 ToMoney16(money64 value) } using EMPTY_ARGS_VOID_POINTER = void(); -using rct_string_id = uint16_t; +using StringId = uint16_t; #define SafeFree(x) \ do \ diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 5ab3b1decd..be171d123e 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -270,7 +270,7 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase * Draws text that is left aligned and vertically centred. */ void gfx_draw_string_left_centred( - rct_drawpixelinfo* dpi, rct_string_id format, void* args, colour_t colour, const ScreenCoordsXY& coords) + rct_drawpixelinfo* dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords) { char* buffer = gCommonStringFormatBuffer; format_string(buffer, 256, format, args); @@ -429,7 +429,7 @@ int32_t string_get_height_raw(std::string_view text, FontSpriteBase fontBase) * ticks : ebp >> 16 */ void DrawNewsTicker( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, rct_string_id format, void* args, + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, void* args, int32_t ticks) { int32_t numLines, lineHeight, lineY; diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 898aaff453..a1c74e2007 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -551,11 +551,11 @@ void gfx_draw_string_no_formatting( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint); void gfx_draw_string_left_centred( - rct_drawpixelinfo* dpi, rct_string_id format, void* args, colour_t colour, const ScreenCoordsXY& coords); + rct_drawpixelinfo* dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords); void draw_string_centred_raw( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, char* text, FontSpriteBase fontSpriteBase); void DrawNewsTicker( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, rct_string_id format, void* args, + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, void* args, int32_t ticks); void gfx_draw_string_with_y_offsets( rct_drawpixelinfo* dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets, @@ -579,8 +579,7 @@ void scrolling_text_invalidate(); class Formatter; int32_t scrolling_text_setup( - struct paint_session& session, rct_string_id stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, - colour_t colour); + struct paint_session& session, StringId stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour); rct_size16 FASTCALL gfx_get_sprite_size(uint32_t image_id); size_t g1_calculate_data_size(const rct_g1_element* g1); diff --git a/src/openrct2/drawing/NewDrawing.cpp b/src/openrct2/drawing/NewDrawing.cpp index 1d65d3e303..e1f3234d75 100644 --- a/src/openrct2/drawing/NewDrawing.cpp +++ b/src/openrct2/drawing/NewDrawing.cpp @@ -28,7 +28,7 @@ using namespace OpenRCT2::Drawing; using namespace OpenRCT2::Paint; using namespace OpenRCT2::Ui; -rct_string_id DrawingEngineStringIds[] = { +StringId DrawingEngineStringIds[] = { STR_DRAWING_ENGINE_SOFTWARE, STR_DRAWING_ENGINE_SOFTWARE_WITH_HARDWARE_DISPLAY, STR_DRAWING_ENGINE_OPENGL, diff --git a/src/openrct2/drawing/NewDrawing.h b/src/openrct2/drawing/NewDrawing.h index 80039156b5..d7da628876 100644 --- a/src/openrct2/drawing/NewDrawing.h +++ b/src/openrct2/drawing/NewDrawing.h @@ -15,7 +15,7 @@ struct rct_drawpixelinfo; struct GamePalette; enum class DrawingEngine : int32_t; -extern rct_string_id DrawingEngineStringIds[3]; +extern StringId DrawingEngineStringIds[3]; DrawingEngine drawing_engine_get_type(); bool drawing_engine_requires_new_window(DrawingEngine srcEngine, DrawingEngine dstEngine); diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 5f43ab3f86..2c830eba9d 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -28,7 +28,7 @@ using namespace OpenRCT2; struct rct_draw_scroll_text { - rct_string_id string_id; + StringId string_id; uint8_t string_args[32]; colour_t colour; uint16_t position; @@ -134,7 +134,7 @@ static uint8_t* font_sprite_get_codepoint_bitmap(int32_t codepoint) } static int32_t scrolling_text_get_matching_or_oldest( - rct_string_id stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour) + StringId stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour) { uint32_t oldestId = 0xFFFFFFFF; int32_t scrollIndex = -1; @@ -1447,7 +1447,7 @@ void scrolling_text_invalidate() } int32_t scrolling_text_setup( - paint_session& session, rct_string_id stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour) + paint_session& session, StringId stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour) { std::scoped_lock lock(_scrollingTextMutex); diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index 52cfc25599..01e7a8a03d 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -17,7 +17,7 @@ static void DrawText( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting = false); static void DrawText( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, rct_string_id format, const void* args); + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, StringId format, const void* args); class StaticLayout { @@ -117,14 +117,14 @@ static void DrawText( } static void DrawText( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, rct_string_id format, const void* args) + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, StringId format, const void* args) { utf8 buffer[512]; format_string(buffer, sizeof(buffer), format, args); DrawText(dpi, coords, paint, buffer); } -void DrawTextBasic(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format) +void DrawTextBasic(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, StringId format) { Formatter ft{}; TextPaint textPaint{}; @@ -132,12 +132,12 @@ void DrawTextBasic(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_str } void DrawTextBasic( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const Formatter& ft, TextPaint textPaint) + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, StringId format, const Formatter& ft, TextPaint textPaint) { DrawText(dpi, coords, textPaint, format, ft.Data()); } -void DrawTextEllipsised(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format) +void DrawTextEllipsised(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format) { Formatter ft{}; TextPaint textPaint{}; @@ -145,7 +145,7 @@ void DrawTextEllipsised(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, in } void DrawTextEllipsised( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft, + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint) { utf8 buffer[512]; @@ -166,7 +166,7 @@ void gfx_draw_string_no_formatting( DrawText(dpi, coords, textPaint, buffer, true); } -int32_t DrawTextWrapped(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format) +int32_t DrawTextWrapped(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format) { Formatter ft{}; TextPaint textPaint{}; @@ -174,7 +174,7 @@ int32_t DrawTextWrapped(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, in } int32_t DrawTextWrapped( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft, + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint) { const void* args = ft.Data(); diff --git a/src/openrct2/drawing/Text.h b/src/openrct2/drawing/Text.h index 6737540b36..55ea8be079 100644 --- a/src/openrct2/drawing/Text.h +++ b/src/openrct2/drawing/Text.h @@ -121,15 +121,15 @@ struct TextPaint } }; -void DrawTextBasic(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format); -void DrawTextEllipsised(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format); -int32_t DrawTextWrapped(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format); +void DrawTextBasic(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, StringId format); +void DrawTextEllipsised(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format); +int32_t DrawTextWrapped(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format); void DrawTextBasic( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const Formatter& ft, TextPaint textPaint = {}); + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, StringId format, const Formatter& ft, TextPaint textPaint = {}); void DrawTextEllipsised( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft, + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint = {}); int32_t DrawTextWrapped( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft, + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint = {}); diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 8abfcf5efe..66ebab750e 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1651,7 +1651,7 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price) { auto ft = Formatter(); FormatNameTo(ft); - ft.Add(GetShopItemDescriptor(shopItem).Naming.Indefinite); + ft.Add(GetShopItemDescriptor(shopItem).Naming.Indefinite); if (gConfigNotifications.guest_bought_item) { News::AddItemToQueue(News::ItemType::PeepOnRide, STR_PEEP_TRACKING_NOTIFICATION_BOUGHT_X, sprite_index, ft); @@ -3849,7 +3849,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride) FormatNameTo(ft); ride->FormatNameTo(ft); - rct_string_id msg_string; + StringId msg_string; if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE)) msg_string = STR_PEEP_TRACKING_PEEP_IS_IN_X; else @@ -6803,7 +6803,7 @@ bool Guest::HeadingForRideOrParkExit() const */ void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft) { - ft.Add(PeepThoughts[EnumValue(thought->type)]); + ft.Add(PeepThoughts[EnumValue(thought->type)]); PeepThoughtToActionFlag flags = PeepThoughtToActionMap[EnumValue(thought->type)].flags; if (flags & PEEP_THOUGHT_ACTION_FLAG_RIDE) @@ -6815,16 +6815,16 @@ void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft) } else { - ft.Add(STR_NONE); + ft.Add(STR_NONE); } } else if (flags & PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_SINGULAR) { - ft.Add(GetShopItemDescriptor(thought->shopItem).Naming.Singular); + ft.Add(GetShopItemDescriptor(thought->shopItem).Naming.Singular); } else if (flags & PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_INDEFINITE) { - ft.Add(GetShopItemDescriptor(thought->shopItem).Naming.Indefinite); + ft.Add(GetShopItemDescriptor(thought->shopItem).Naming.Indefinite); } } diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index 24ce4bb753..c248222522 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -113,7 +113,7 @@ void Litter::RemoveAt(const CoordsXYZ& litterPos) } } -static const rct_string_id litterNames[12] = { +static const StringId litterNames[12] = { STR_LITTER_VOMIT, STR_LITTER_VOMIT, STR_SHOP_ITEM_SINGULAR_EMPTY_CAN, @@ -128,7 +128,7 @@ static const rct_string_id litterNames[12] = { STR_SHOP_ITEM_SINGULAR_EMPTY_BOWL_BLUE, }; -rct_string_id Litter::GetName() const +StringId Litter::GetName() const { if (EnumValue(SubType) >= std::size(litterNames)) return STR_NONE; diff --git a/src/openrct2/entity/Litter.h b/src/openrct2/entity/Litter.h index 0c9e791b15..bced01ca1b 100644 --- a/src/openrct2/entity/Litter.h +++ b/src/openrct2/entity/Litter.h @@ -40,7 +40,7 @@ struct Litter : EntityBase static void Create(const CoordsXYZD& litterPos, Type type); static void RemoveAt(const CoordsXYZ& litterPos); void Serialise(DataSerialiser& stream); - rct_string_id GetName() const; + StringId GetName() const; uint32_t GetAge() const; void Paint(paint_session& session, int32_t imageDirection) const; }; diff --git a/src/openrct2/entity/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp index 3e6f3cf36d..0c4cb55586 100644 --- a/src/openrct2/entity/MoneyEffect.cpp +++ b/src/openrct2/entity/MoneyEffect.cpp @@ -140,11 +140,11 @@ void MoneyEffect::Update() EntityRemove(this); } -std::pair MoneyEffect::GetStringId() const +std::pair MoneyEffect::GetStringId() const { - rct_string_id spentStringId = Vertical ? STR_MONEY_EFFECT_SPEND_HIGHP : STR_MONEY_EFFECT_SPEND; - rct_string_id receiveStringId = Vertical ? STR_MONEY_EFFECT_RECEIVE_HIGHP : STR_MONEY_EFFECT_RECEIVE; - rct_string_id stringId = receiveStringId; + StringId spentStringId = Vertical ? STR_MONEY_EFFECT_SPEND_HIGHP : STR_MONEY_EFFECT_SPEND; + StringId receiveStringId = Vertical ? STR_MONEY_EFFECT_RECEIVE_HIGHP : STR_MONEY_EFFECT_RECEIVE; + StringId stringId = receiveStringId; money64 outValue = Value; if (Value < 0) { diff --git a/src/openrct2/entity/MoneyEffect.h b/src/openrct2/entity/MoneyEffect.h index dacef7dbd0..d093deb95f 100644 --- a/src/openrct2/entity/MoneyEffect.h +++ b/src/openrct2/entity/MoneyEffect.h @@ -30,7 +30,7 @@ struct MoneyEffect : EntityBase static void CreateAt(money64 value, const CoordsXYZ& effectPos, bool vertical); static void Create(money64 value, const CoordsXYZ& loc); void Update(); - std::pair GetStringId() const; + std::pair GetStringId() const; void Serialise(DataSerialiser& stream); void Paint(paint_session& session, int32_t imageDirection) const; }; diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 4e58e6f4da..775317158e 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -619,7 +619,7 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply) if (auto res = MapCanConstructAt({ destination, destination.z, destination.z + (1 * 8) }, { 0b1111, 0 }); res.Error != GameActions::Status::Ok) { - const auto stringId = std::get(res.ErrorMessage); + const auto stringId = std::get(res.ErrorMessage); if (stringId != STR_RAISE_OR_LOWER_LAND_FIRST && stringId != STR_FOOTPATH_IN_THE_WAY) { return GameActions::Result( @@ -1345,10 +1345,10 @@ void Peep::FormatActionTo(Formatter& ft) const switch (State) { case PeepState::Falling: - ft.Add(Action == PeepActionType::Drowning ? STR_DROWNING : STR_WALKING); + ft.Add(Action == PeepActionType::Drowning ? STR_DROWNING : STR_WALKING); break; case PeepState::One: - ft.Add(STR_WALKING); + ft.Add(STR_WALKING); break; case PeepState::OnRide: case PeepState::LeavingRide: @@ -1357,19 +1357,18 @@ void Peep::FormatActionTo(Formatter& ft) const auto ride = get_ride(CurrentRide); if (ride != nullptr) { - ft.Add( - ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE); + ft.Add(ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE); ride->FormatNameTo(ft); } else { - ft.Add(STR_ON_RIDE).Add(STR_NONE); + ft.Add(STR_ON_RIDE).Add(STR_NONE); } break; } case PeepState::Buying: { - ft.Add(STR_AT_RIDE); + ft.Add(STR_AT_RIDE); auto ride = get_ride(CurrentRide); if (ride != nullptr) { @@ -1377,7 +1376,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(STR_NONE); } break; } @@ -1392,13 +1391,13 @@ void Peep::FormatActionTo(Formatter& ft) const auto ride = get_ride(guest->GuestHeadingToRideId); if (ride != nullptr) { - ft.Add(STR_HEADING_FOR); + ft.Add(STR_HEADING_FOR); ride->FormatNameTo(ft); } } else { - ft.Add((PeepFlags & PEEP_FLAGS_LEAVING_PARK) ? STR_LEAVING_PARK : STR_WALKING); + ft.Add((PeepFlags & PEEP_FLAGS_LEAVING_PARK) ? STR_LEAVING_PARK : STR_WALKING); } } break; @@ -1409,13 +1408,13 @@ void Peep::FormatActionTo(Formatter& ft) const auto ride = get_ride(CurrentRide); if (ride != nullptr) { - ft.Add(STR_QUEUING_FOR); + ft.Add(STR_QUEUING_FOR); ride->FormatNameTo(ft); } break; } case PeepState::Sitting: - ft.Add(STR_SITTING); + ft.Add(STR_SITTING); break; case PeepState::Watching: if (!CurrentRide.IsNull()) @@ -1423,47 +1422,47 @@ void Peep::FormatActionTo(Formatter& ft) const auto ride = get_ride(CurrentRide); if (ride != nullptr) { - ft.Add((StandingFlags & 0x1) ? STR_WATCHING_CONSTRUCTION_OF : STR_WATCHING_RIDE); + ft.Add((StandingFlags & 0x1) ? STR_WATCHING_CONSTRUCTION_OF : STR_WATCHING_RIDE); ride->FormatNameTo(ft); } } else { - ft.Add((StandingFlags & 0x1) ? STR_WATCHING_NEW_RIDE_BEING_CONSTRUCTED : STR_LOOKING_AT_SCENERY); + ft.Add((StandingFlags & 0x1) ? STR_WATCHING_NEW_RIDE_BEING_CONSTRUCTED : STR_LOOKING_AT_SCENERY); } break; case PeepState::Picked: - ft.Add(STR_SELECT_LOCATION); + ft.Add(STR_SELECT_LOCATION); break; case PeepState::Patrolling: case PeepState::EnteringPark: case PeepState::LeavingPark: - ft.Add(STR_WALKING); + ft.Add(STR_WALKING); break; case PeepState::Mowing: - ft.Add(STR_MOWING_GRASS); + ft.Add(STR_MOWING_GRASS); break; case PeepState::Sweeping: - ft.Add(STR_SWEEPING_FOOTPATH); + ft.Add(STR_SWEEPING_FOOTPATH); break; case PeepState::Watering: - ft.Add(STR_WATERING_GARDENS); + ft.Add(STR_WATERING_GARDENS); break; case PeepState::EmptyingBin: - ft.Add(STR_EMPTYING_LITTER_BIN); + ft.Add(STR_EMPTYING_LITTER_BIN); break; case PeepState::Answering: if (SubState == 0) { - ft.Add(STR_WALKING); + ft.Add(STR_WALKING); } else if (SubState == 1) { - ft.Add(STR_ANSWERING_RADIO_CALL); + ft.Add(STR_ANSWERING_RADIO_CALL); } else { - ft.Add(STR_RESPONDING_TO_RIDE_BREAKDOWN_CALL); + ft.Add(STR_RESPONDING_TO_RIDE_BREAKDOWN_CALL); auto ride = get_ride(CurrentRide); if (ride != nullptr) { @@ -1471,13 +1470,13 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(STR_NONE); } } break; case PeepState::Fixing: { - ft.Add(STR_FIXING_RIDE); + ft.Add(STR_FIXING_RIDE); auto ride = get_ride(CurrentRide); if (ride != nullptr) { @@ -1485,13 +1484,13 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(STR_NONE); } break; } case PeepState::HeadingToInspection: { - ft.Add(STR_HEADING_TO_RIDE_FOR_INSPECTION); + ft.Add(STR_HEADING_TO_RIDE_FOR_INSPECTION); auto ride = get_ride(CurrentRide); if (ride != nullptr) { @@ -1499,13 +1498,13 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(STR_NONE); } break; } case PeepState::Inspecting: { - ft.Add(STR_INSPECTING_RIDE); + ft.Add(STR_INSPECTING_RIDE); auto ride = get_ride(CurrentRide); if (ride != nullptr) { @@ -1513,14 +1512,14 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(STR_NONE); } break; } } } -static constexpr const rct_string_id _staffNames[] = { +static constexpr const StringId _staffNames[] = { STR_HANDYMAN_X, STR_MECHANIC_X, STR_SECURITY_GUARD_X, @@ -1540,22 +1539,22 @@ void Peep::FormatNameTo(Formatter& ft) const staffNameIndex = 0; } - ft.Add(_staffNames[staffNameIndex]); + ft.Add(_staffNames[staffNameIndex]); ft.Add(Id); } else if (gParkFlags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES) { auto realNameStringId = get_real_name_string_id_from_id(Id); - ft.Add(realNameStringId); + ft.Add(realNameStringId); } else { - ft.Add(STR_GUEST_X).Add(Id); + ft.Add(STR_GUEST_X).Add(Id); } } else { - ft.Add(STR_STRING).Add(Name); + ft.Add(STR_STRING).Add(Name); } } @@ -1608,14 +1607,14 @@ void peep_set_map_tooltip(Peep* peep) auto* guest = peep->As(); if (guest != nullptr) { - ft.Add((peep->PeepFlags & PEEP_FLAGS_TRACKING) ? STR_TRACKED_GUEST_MAP_TIP : STR_GUEST_MAP_TIP); + ft.Add((peep->PeepFlags & PEEP_FLAGS_TRACKING) ? STR_TRACKED_GUEST_MAP_TIP : STR_GUEST_MAP_TIP); ft.Add(get_peep_face_sprite_small(guest)); guest->FormatNameTo(ft); guest->FormatActionTo(ft); } else { - ft.Add(STR_STAFF_MAP_TIP); + ft.Add(STR_STAFF_MAP_TIP); peep->FormatNameTo(ft); peep->FormatActionTo(ft); } @@ -2309,9 +2308,8 @@ static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords) auto ft = Formatter(); guest->FormatNameTo(ft); ride->FormatNameTo(ft); - rct_string_id string_id = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) - ? STR_PEEP_TRACKING_PEEP_IS_IN_X - : STR_PEEP_TRACKING_PEEP_IS_ON_X; + StringId string_id = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_PEEP_TRACKING_PEEP_IS_IN_X + : STR_PEEP_TRACKING_PEEP_IS_ON_X; if (gConfigNotifications.guest_used_facility) { News::AddItemToQueue(News::ItemType::PeepOnRide, string_id, guest->sprite_index, ft); @@ -2513,7 +2511,7 @@ int32_t Peep::GetZOnSlope(int32_t tile_x, int32_t tile_y) return NextLoc.z + map_height_from_slope({ tile_x, tile_y }, slope, GetNextIsSloped()); } -rct_string_id get_real_name_string_id_from_id(uint32_t id) +StringId get_real_name_string_id_from_id(uint32_t id) { // Generate a name_string_idx from the peep Id using bit twiddling uint16_t ax = static_cast(id + 0xF0B); diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index cedab9a448..362a8d633f 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -477,7 +477,7 @@ int32_t peep_compare(const EntityId sprite_index_a, const EntityId sprite_index_ void peep_update_names(bool realNames); -rct_string_id get_real_name_string_id_from_id(uint32_t id); +StringId get_real_name_string_id_from_id(uint32_t id); inline const rct_peep_animation& GetPeepAnimation( PeepSpriteType spriteType, PeepActionSpriteType actionSpriteType = PeepActionSpriteType::None) diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 7d34236353..2f4367080e 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -47,7 +47,7 @@ #include // clang-format off -const rct_string_id StaffCostumeNames[] = { +const StringId StaffCostumeNames[] = { STR_STAFF_OPTION_COSTUME_PANDA, STR_STAFF_OPTION_COSTUME_TIGER, STR_STAFF_OPTION_COSTUME_ELEPHANT, diff --git a/src/openrct2/entity/Staff.h b/src/openrct2/entity/Staff.h index 9b852a0c44..ecbf4eb6d3 100644 --- a/src/openrct2/entity/Staff.h +++ b/src/openrct2/entity/Staff.h @@ -141,7 +141,7 @@ enum class EntertainerCostume : uint8_t Count }; -extern const rct_string_id StaffCostumeNames[static_cast(EntertainerCostume::Count)]; +extern const StringId StaffCostumeNames[static_cast(EntertainerCostume::Count)]; extern colour_t gStaffHandymanColour; extern colour_t gStaffMechanicColour; diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 771b591f89..1f9ce4ac20 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -166,7 +166,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) for (int32_t i = 0; i < static_cast(RideMode::Count); i++) { char mode_name[128] = { 0 }; - rct_string_id mode_string_id = RideModeNames[i]; + StringId mode_string_id = RideModeNames[i]; format_string(mode_name, 128, mode_string_id, nullptr); console.WriteFormatLine("%02d - %s", i, mode_name); } @@ -467,7 +467,7 @@ static int32_t cc_staff(InteractiveConsole& console, const arguments_t& argv) for (int32_t i = 0; i < static_cast(EntertainerCostume::Count); i++) { char costume_name[128] = { 0 }; - rct_string_id costume = StaffCostumeNames[i]; + StringId costume = StaffCostumeNames[i]; format_string(costume_name, 128, STR_DROPDOWN_MENU_LABEL, &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. diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 6ab9a35bb8..c6d832cf4f 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -377,7 +377,7 @@ void screenshot_giant() // Show user that screenshot saved successfully const auto filename = Path::GetFileName(path.value()); Formatter ft; - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(filename.c_str()); context_show_error(STR_SCREENSHOT_SAVED_AS, STR_NONE, ft); } diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index fa2f8ba252..1ff0fbc7bc 100644 --- a/src/openrct2/interface/Widget.h +++ b/src/openrct2/interface/Widget.h @@ -64,7 +64,7 @@ constexpr const ScreenSize TAB_SIZE = { 31, 27 }; constexpr rct_widget MakeWidget( const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, - uint32_t content = 0xFFFFFFFF, rct_string_id tooltip = STR_NONE) + uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) { rct_widget out = {}; out.left = origin.x; @@ -81,12 +81,12 @@ constexpr rct_widget MakeWidget( constexpr rct_widget MakeRemapWidget( const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, - uint32_t content = 0xFFFFFFFF, rct_string_id tooltip = STR_NONE) + uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) { return MakeWidget(origin, size, type, colour, IMAGE_TYPE_REMAP | content, tooltip); } -constexpr rct_widget MakeTab(const ScreenCoordsXY& origin, rct_string_id tooltip = STR_NONE) +constexpr rct_widget MakeTab(const ScreenCoordsXY& origin, StringId tooltip = STR_NONE) { const ScreenSize size = TAB_SIZE; const WindowWidgetType type = WindowWidgetType::Tab; @@ -101,7 +101,7 @@ constexpr rct_widget MakeTab(const ScreenCoordsXY& origin, rct_string_id tooltip constexpr rct_widget MakeSpinnerDecreaseWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = 0xFFFFFFFF, rct_string_id tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) { const int16_t xPos = origin.x + size.width - 26; const int16_t yPos = origin.y + 1; @@ -113,7 +113,7 @@ constexpr rct_widget MakeSpinnerDecreaseWidget( constexpr rct_widget MakeSpinnerIncreaseWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = 0xFFFFFFFF, rct_string_id tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) { const int16_t xPos = origin.x + size.width - 13; const int16_t yPos = origin.y + 1; @@ -127,14 +127,14 @@ constexpr rct_widget MakeSpinnerIncreaseWidget( constexpr rct_widget MakeDropdownBoxWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = 0xFFFFFFFF, rct_string_id tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) { return MakeWidget(origin, size, type, colour, content); } constexpr rct_widget MakeDropdownButtonWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = 0xFFFFFFFF, rct_string_id tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) { const int16_t xPos = origin.x + size.width - 11; const int16_t yPos = origin.y + 1; diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index b5975f91af..13ca017ae8 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -1596,7 +1596,7 @@ void window_event_unknown_15_call(rct_window* w, int32_t scrollIndex, int32_t sc w->event_handlers->unknown_15(w, scrollIndex, scrollAreaType); } -OpenRCT2String window_event_tooltip_call(rct_window* w, const rct_widgetindex widgetIndex, const rct_string_id fallback) +OpenRCT2String window_event_tooltip_call(rct_window* w, const rct_widgetindex widgetIndex, const StringId fallback) { if (w->event_handlers == nullptr) { @@ -1968,7 +1968,7 @@ void textinput_cancel() } void window_start_textbox( - rct_window& call_w, rct_widgetindex call_widget, rct_string_id existing_text, char* existing_args, int32_t maxLength) + rct_window& call_w, rct_widgetindex call_widget, StringId existing_text, char* existing_args, int32_t maxLength) { if (gUsingWidgetTextBox) window_cancel_textbox(); diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index a6bd3b2583..a25a0c8600 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -96,11 +96,11 @@ struct rct_widget union { // 0x0A uint32_t image; - rct_string_id text; + StringId text; uint32_t content; utf8* string; }; - rct_string_id tooltip; // 0x0E + StringId tooltip; // 0x0E // New properties WidgetFlags flags{}; @@ -248,7 +248,7 @@ struct rct_window_event_list void (*text_input)(struct rct_window*, rct_widgetindex, char*){}; void (*viewport_rotate)(struct rct_window*){}; void (*unknown_15)(struct rct_window*, int32_t, int32_t){}; - OpenRCT2String (*tooltip)(struct rct_window*, const rct_widgetindex, const rct_string_id){}; + OpenRCT2String (*tooltip)(struct rct_window*, const rct_widgetindex, const StringId){}; void (*cursor)(struct rct_window*, rct_widgetindex, const ScreenCoordsXY&, CursorID*){}; void (*moved)(struct rct_window*, const ScreenCoordsXY&){}; void (*invalidate)(struct rct_window*){}; @@ -780,7 +780,7 @@ void window_event_scroll_mouseover_call(rct_window* w, int32_t scrollIndex, cons void window_event_textinput_call(rct_window* w, rct_widgetindex widgetIndex, char* text); void window_event_viewport_rotate_call(rct_window* w); void window_event_unknown_15_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType); -OpenRCT2String window_event_tooltip_call(rct_window* w, const rct_widgetindex widgetIndex, const rct_string_id fallback); +OpenRCT2String window_event_tooltip_call(rct_window* w, const rct_widgetindex widgetIndex, const StringId fallback); CursorID window_event_cursor_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); void window_event_moved_call(rct_window* w, const ScreenCoordsXY& screenCoords); void window_event_invalidate_call(rct_window* w); @@ -794,7 +794,7 @@ void window_move_and_snap(rct_window& w, ScreenCoordsXY newWindowCoords, int32_t int32_t window_can_resize(const rct_window& w); void window_start_textbox( - rct_window& call_w, rct_widgetindex call_widget, rct_string_id existing_text, char* existing_args, int32_t maxLength); + rct_window& call_w, rct_widgetindex call_widget, StringId existing_text, char* existing_args, int32_t maxLength); void window_cancel_textbox(); void window_update_textbox_caret(); void window_update_textbox(); diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 6b79a3b493..6b44597588 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -134,7 +134,7 @@ struct rct_window virtual void OnDrawWidget(rct_widgetindex widgetIndex, rct_drawpixelinfo& dpi) { } - virtual OpenRCT2String OnTooltip(rct_widgetindex widgetIndex, rct_string_id fallback) + virtual OpenRCT2String OnTooltip(rct_widgetindex widgetIndex, StringId fallback) { return { fallback, {} }; } diff --git a/src/openrct2/localisation/Currency.h b/src/openrct2/localisation/Currency.h index acd3e7160b..4b3a29c7dc 100644 --- a/src/openrct2/localisation/Currency.h +++ b/src/openrct2/localisation/Currency.h @@ -57,7 +57,7 @@ struct currency_descriptor utf8 symbol_unicode[CURRENCY_SYMBOL_MAX_SIZE]; CurrencyAffix affix_ascii; char symbol_ascii[CURRENCY_SYMBOL_MAX_SIZE]; - rct_string_id stringId; + StringId stringId; }; // List of currency formats diff --git a/src/openrct2/localisation/Date.h b/src/openrct2/localisation/Date.h index b9099e218d..ab8803888b 100644 --- a/src/openrct2/localisation/Date.h +++ b/src/openrct2/localisation/Date.h @@ -44,8 +44,8 @@ struct openrct2_timeofday }; extern const int16_t days_in_month[MONTH_COUNT]; -extern const rct_string_id DateFormatStringIds[]; -extern const rct_string_id DateFormatStringFormatIds[]; +extern const StringId DateFormatStringIds[]; +extern const StringId DateFormatStringFormatIds[]; extern uint16_t gDateMonthTicks; extern int32_t gDateMonthsElapsed; diff --git a/src/openrct2/localisation/Formatter.h b/src/openrct2/localisation/Formatter.h index 51073d3fd5..17c5a35a9c 100644 --- a/src/openrct2/localisation/Formatter.h +++ b/src/openrct2/localisation/Formatter.h @@ -93,7 +93,7 @@ public: std::is_same_v, money64> || std::is_same_v, RideId> || std::is_same_v, EntityId> || - std::is_same_v, rct_string_id> || + std::is_same_v, StringId> || std::is_same_v, uint16_t> || std::is_same_v, uint32_t> || std::is_same_v, utf8*> || @@ -126,6 +126,6 @@ public: struct OpenRCT2String { - rct_string_id str; + StringId str; Formatter args; }; diff --git a/src/openrct2/localisation/Formatting.cpp b/src/openrct2/localisation/Formatting.cpp index 51973c7acc..c9f1e49629 100644 --- a/src/openrct2/localisation/Formatting.cpp +++ b/src/openrct2/localisation/Formatting.cpp @@ -280,7 +280,7 @@ namespace OpenRCT2 return sz != nullptr ? sz : std::string_view(); } - void FormatRealName(FormatBuffer& ss, rct_string_id id) + void FormatRealName(FormatBuffer& ss, StringId id) { if (IsRealNameStringId(id)) { @@ -438,7 +438,7 @@ namespace OpenRCT2 template static void FormatMinutesSeconds(FormatBuffer& ss, T value) { - static constexpr const rct_string_id Formats[][2] = { + static constexpr const StringId Formats[][2] = { { STR_DURATION_SEC, STR_DURATION_SECS }, { STR_DURATION_MIN_SEC, STR_DURATION_MIN_SECS }, { STR_DURATION_MINS_SEC, STR_DURATION_MINS_SECS }, @@ -460,7 +460,7 @@ namespace OpenRCT2 template static void FormatHoursMinutes(FormatBuffer& ss, T value) { - static constexpr const rct_string_id Formats[][2] = { + static constexpr const StringId Formats[][2] = { { STR_REALTIME_MIN, STR_REALTIME_MINS }, { STR_REALTIME_HOUR_MIN, STR_REALTIME_HOUR_MINS }, { STR_REALTIME_HOURS_MIN, STR_REALTIME_HOURS_MINS }, @@ -622,12 +622,12 @@ namespace OpenRCT2 template void FormatArgument(FormatBuffer&, FormatToken, const char*); template void FormatArgument(FormatBuffer&, FormatToken, std::string_view); - bool IsRealNameStringId(rct_string_id id) + bool IsRealNameStringId(StringId id) { return id >= REAL_NAME_START && id <= REAL_NAME_END; } - FmtString GetFmtStringById(rct_string_id id) + FmtString GetFmtStringById(StringId id) { auto fmtc = language_get_string(id); return FmtString(fmtc); @@ -687,7 +687,7 @@ namespace OpenRCT2 if (argIndex < args.size()) { const auto& arg = args[argIndex++]; - std::optional stringId; + std::optional stringId; if (auto value16 = std::get_if(&arg)) { stringId = *value16; @@ -784,7 +784,7 @@ namespace OpenRCT2 break; case FormatToken::StringId: { - auto stringId = ReadFromArgs(args); + auto stringId = ReadFromArgs(args); anyArgs.push_back(stringId); BuildAnyArgListFromLegacyArgBuffer(GetFmtStringById(stringId), anyArgs, args); break; @@ -807,7 +807,7 @@ namespace OpenRCT2 } } - size_t FormatStringLegacy(char* buffer, size_t bufferLen, rct_string_id id, const void* args) + size_t FormatStringLegacy(char* buffer, size_t bufferLen, StringId id, const void* args) { thread_local std::vector anyArgs; anyArgs.clear(); @@ -833,7 +833,7 @@ namespace OpenRCT2 } // namespace OpenRCT2 -void format_string(utf8* dest, size_t size, rct_string_id format, const void* args) +void format_string(utf8* dest, size_t size, StringId format, const void* args) { OpenRCT2::FormatStringLegacy(dest, size, format, args); } diff --git a/src/openrct2/localisation/Formatting.h b/src/openrct2/localisation/Formatting.h index e67c2cf9df..d9067db3d2 100644 --- a/src/openrct2/localisation/Formatting.h +++ b/src/openrct2/localisation/Formatting.h @@ -200,9 +200,9 @@ namespace OpenRCT2 template void FormatArgument(FormatBuffer& ss, FormatToken token, T arg); - bool IsRealNameStringId(rct_string_id id); - void FormatRealName(FormatBuffer& ss, rct_string_id id); - FmtString GetFmtStringById(rct_string_id id); + bool IsRealNameStringId(StringId id); + void FormatRealName(FormatBuffer& ss, StringId id); + FmtString GetFmtStringById(StringId id); FormatBuffer& GetThreadFormatStream(); size_t CopyStringStreamToBuffer(char* buffer, size_t bufferLen, FormatBuffer& ss); @@ -237,7 +237,7 @@ namespace OpenRCT2 { if constexpr (std::is_integral()) { - auto stringId = static_cast(arg0); + auto stringId = static_cast(arg0); if (IsRealNameStringId(stringId)) { FormatRealName(ss, stringId); @@ -284,19 +284,19 @@ namespace OpenRCT2 return CopyStringStreamToBuffer(buffer, bufferLen, ss); } - template static void FormatStringId(FormatBuffer& ss, rct_string_id id, TArgs&&... argN) + template static void FormatStringId(FormatBuffer& ss, StringId id, TArgs&&... argN) { auto fmt = GetFmtStringById(id); FormatString(ss, fmt, argN...); } - template std::string FormatStringId(rct_string_id id, TArgs&&... argN) + template std::string FormatStringId(StringId id, TArgs&&... argN) { auto fmt = GetFmtStringById(id); return FormatString(fmt, argN...); } - template size_t FormatStringId(char* buffer, size_t bufferLen, rct_string_id id, TArgs&&... argN) + template size_t FormatStringId(char* buffer, size_t bufferLen, StringId id, TArgs&&... argN) { auto& ss = GetThreadFormatStream(); FormatStringId(ss, id, argN...); @@ -305,5 +305,5 @@ namespace OpenRCT2 std::string FormatStringAny(const FmtString& fmt, const std::vector& args); size_t FormatStringAny(char* buffer, size_t bufferLen, const FmtString& fmt, const std::vector& args); - size_t FormatStringLegacy(char* buffer, size_t bufferLen, rct_string_id id, const void* args); + size_t FormatStringLegacy(char* buffer, size_t bufferLen, StringId id, const void* args); } // namespace OpenRCT2 diff --git a/src/openrct2/localisation/Language.cpp b/src/openrct2/localisation/Language.cpp index ed3aa5c9cf..5c4711ae4e 100644 --- a/src/openrct2/localisation/Language.cpp +++ b/src/openrct2/localisation/Language.cpp @@ -66,7 +66,7 @@ uint8_t language_get_id_from_locale(const char* locale) return LANGUAGE_UNDEFINED; } -const char* language_get_string(rct_string_id id) +const char* language_get_string(StringId id) { const auto& localisationService = OpenRCT2::GetContext()->GetLocalisationService(); return localisationService.GetString(id); @@ -90,7 +90,7 @@ bool language_open(int32_t id) } } -bool language_get_localised_scenario_strings(const utf8* scenarioFilename, rct_string_id* outStringIds) +bool language_get_localised_scenario_strings(const utf8* scenarioFilename, StringId* outStringIds) { const auto& localisationService = OpenRCT2::GetContext()->GetLocalisationService(); auto result = localisationService.GetLocalisedScenarioStrings(scenarioFilename); @@ -100,13 +100,13 @@ bool language_get_localised_scenario_strings(const utf8* scenarioFilename, rct_s return outStringIds[0] != STR_NONE || outStringIds[1] != STR_NONE || outStringIds[2] != STR_NONE; } -void language_free_object_string(rct_string_id stringId) +void language_free_object_string(StringId stringId) { auto& localisationService = OpenRCT2::GetContext()->GetLocalisationService(); localisationService.FreeObjectString(stringId); } -rct_string_id language_allocate_object_string(const std::string& target) +StringId language_allocate_object_string(const std::string& target) { auto& localisationService = OpenRCT2::GetContext()->GetLocalisationService(); return localisationService.AllocateObjectString(target); diff --git a/src/openrct2/localisation/Language.h b/src/openrct2/localisation/Language.h index f29eb2911a..cc4eb36b72 100644 --- a/src/openrct2/localisation/Language.h +++ b/src/openrct2/localisation/Language.h @@ -93,7 +93,7 @@ constexpr const char* CheckBoxMarkString = u8"✓"; constexpr const char* EyeString = u8"👁"; uint8_t language_get_id_from_locale(const char* locale); -const char* language_get_string(rct_string_id id); +const char* language_get_string(StringId id); bool language_open(int32_t id); uint32_t utf8_get_next(const utf8* char_ptr, const utf8** nextchar_ptr); @@ -103,9 +103,9 @@ int32_t utf8_get_codepoint_length(char32_t codepoint); int32_t utf8_length(const utf8* text); std::string rct2_to_utf8(std::string_view src, RCT2LanguageId languageId); -bool language_get_localised_scenario_strings(const utf8* scenarioFilename, rct_string_id* outStringIds); -void language_free_object_string(rct_string_id stringId); -rct_string_id language_allocate_object_string(const std::string& target); +bool language_get_localised_scenario_strings(const utf8* scenarioFilename, StringId* outStringIds); +void language_free_object_string(StringId stringId); +StringId language_allocate_object_string(const std::string& target); constexpr utf8* utf8_write_codepoint(utf8* dst, uint32_t codepoint) { diff --git a/src/openrct2/localisation/LanguagePack.cpp b/src/openrct2/localisation/LanguagePack.cpp index 350f92bb3a..5c0525c39f 100644 --- a/src/openrct2/localisation/LanguagePack.cpp +++ b/src/openrct2/localisation/LanguagePack.cpp @@ -29,10 +29,10 @@ constexpr uint64_t MAX_LANGUAGE_SIZE = 64 * 1024 * 1024; constexpr uint64_t MAX_OBJECT_OVERRIDES = 4096; constexpr uint64_t MAX_SCENARIO_OVERRIDES = 4096; -constexpr rct_string_id ObjectOverrideBase = 0x6000; +constexpr StringId ObjectOverrideBase = 0x6000; constexpr int32_t ObjectOverrideMaxStringCount = 3; -constexpr rct_string_id ScenarioOverrideBase = 0x7000; +constexpr StringId ScenarioOverrideBase = 0x7000; constexpr int32_t ScenarioOverrideMaxStringCount = 3; struct ObjectOverride @@ -129,7 +129,7 @@ public: return static_cast(_strings.size()); } - void RemoveString(rct_string_id stringId) override + void RemoveString(StringId stringId) override { if (_strings.size() > static_cast(stringId)) { @@ -137,7 +137,7 @@ public: } } - void SetString(rct_string_id stringId, const std::string& str) override + void SetString(StringId stringId, const std::string& str) override { if (_strings.size() > static_cast(stringId)) { @@ -145,7 +145,7 @@ public: } } - const utf8* GetString(rct_string_id stringId) const override + const utf8* GetString(StringId stringId) const override { if (stringId >= ScenarioOverrideBase) { @@ -185,7 +185,7 @@ public: return nullptr; } - rct_string_id GetObjectOverrideStringId(std::string_view legacyIdentifier, uint8_t index) override + StringId GetObjectOverrideStringId(std::string_view legacyIdentifier, uint8_t index) override { Guard::Assert(index < ObjectOverrideMaxStringCount); @@ -206,7 +206,7 @@ public: return STR_NONE; } - rct_string_id GetScenarioOverrideStringId(const utf8* scenarioFilename, uint8_t index) override + StringId GetScenarioOverrideStringId(const utf8* scenarioFilename, uint8_t index) override { Guard::ArgumentNotNull(scenarioFilename); Guard::Assert(index < ScenarioOverrideMaxStringCount); diff --git a/src/openrct2/localisation/LanguagePack.h b/src/openrct2/localisation/LanguagePack.h index 7ec527e426..3a3a823f0c 100644 --- a/src/openrct2/localisation/LanguagePack.h +++ b/src/openrct2/localisation/LanguagePack.h @@ -23,11 +23,11 @@ struct ILanguagePack virtual uint16_t GetId() const abstract; virtual uint32_t GetCount() const abstract; - virtual void RemoveString(rct_string_id stringId) abstract; - virtual void SetString(rct_string_id stringId, const std::string& str) abstract; - virtual const utf8* GetString(rct_string_id stringId) const abstract; - virtual rct_string_id GetObjectOverrideStringId(std::string_view legacyIdentifier, uint8_t index) abstract; - virtual rct_string_id GetScenarioOverrideStringId(const utf8* scenarioFilename, uint8_t index) abstract; + virtual void RemoveString(StringId stringId) abstract; + virtual void SetString(StringId stringId, const std::string& str) abstract; + virtual const utf8* GetString(StringId stringId) const abstract; + virtual StringId GetObjectOverrideStringId(std::string_view legacyIdentifier, uint8_t index) abstract; + virtual StringId GetScenarioOverrideStringId(const utf8* scenarioFilename, uint8_t index) abstract; }; namespace LanguagePackFactory diff --git a/src/openrct2/localisation/Localisation.Date.cpp b/src/openrct2/localisation/Localisation.Date.cpp index bc0a1ef363..9c364782c3 100644 --- a/src/openrct2/localisation/Localisation.Date.cpp +++ b/src/openrct2/localisation/Localisation.Date.cpp @@ -24,14 +24,14 @@ const int16_t days_in_month[MONTH_COUNT] = { 31, 30, 31, 30, 31, 31, 30, 31, }; -const rct_string_id DateFormatStringIds[] = { +const StringId DateFormatStringIds[] = { STR_DATE_FORMAT_DAY_MONTH_YEAR, STR_DATE_FORMAT_MONTH_DAY_YEAR, STR_DATE_FORMAT_YEAR_MONTH_DAY, STR_DATE_FORMAT_YEAR_DAY_MONTH, }; -const rct_string_id DateFormatStringFormatIds[] = { +const StringId DateFormatStringFormatIds[] = { STR_DATE_FORMAT_DMY, STR_DATE_FORMAT_MDY, STR_DATE_FORMAT_YMD, diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index b998039c61..83b9652215 100644 --- a/src/openrct2/localisation/Localisation.cpp +++ b/src/openrct2/localisation/Localisation.cpp @@ -45,7 +45,7 @@ bool gDebugStringFormatting = false; #endif // clang-format off -const rct_string_id SpeedNames[] = { +const StringId SpeedNames[] = { STR_SPEED_NORMAL, STR_SPEED_QUICK, STR_SPEED_FAST, @@ -53,7 +53,7 @@ const rct_string_id SpeedNames[] = { STR_SPEED_HYPER, }; -const rct_string_id ObjectiveNames[] = { +const StringId ObjectiveNames[] = { STR_OBJECTIVE_NONE, STR_OBJECTIVE_GUESTS_BY, STR_OBJECTIVE_PARK_VALUE_BY, @@ -68,14 +68,14 @@ const rct_string_id ObjectiveNames[] = { STR_OBJECTIVE_MONTHLY_FOOD_INCOME, }; -const rct_string_id ResearchFundingLevelNames[] = { +const StringId ResearchFundingLevelNames[] = { STR_RESEARCH_FUNDING_NONE, STR_RESEARCH_FUNDING_MINIMUM, STR_RESEARCH_FUNDING_NORMAL, STR_RESEARCH_FUNDING_MAXIMUM, }; -const rct_string_id MarketingCampaignNames[ADVERTISING_CAMPAIGN_COUNT][3] = { +const StringId MarketingCampaignNames[ADVERTISING_CAMPAIGN_COUNT][3] = { { STR_MARKETING_VOUCHERS_FOR_FREE_ENTRY_TO_THE_PARK, STR_VOUCHERS_FOR_FREE_ENTRY_TO, STR_MARKETING_FINISHED_FREE_ENTRY }, // ADVERTISING_CAMPAIGN_PARK_ENTRY_FREE, { STR_MARKETING_VOUCHERS_FOR_FREE_RIDES_ON_A_PARTICULAR_RIDE, STR_VOUCHERS_FOR_FREE_RIDE_ON, STR_MARKETING_FINISHED_FREE_RIDES }, // ADVERTISING_CAMPAIGN_RIDE_FREE, { STR_MARKETING_VOUCHERS_FOR_HALF_PRICE_ENTRY_TO_THE_PARK, STR_VOUCHERS_FOR_HALF_PRICE_ENTRY_TO, STR_MARKETING_FINISHED_HALF_PRICE_ENTRY }, // ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE, @@ -84,7 +84,7 @@ const rct_string_id MarketingCampaignNames[ADVERTISING_CAMPAIGN_COUNT][3] = { { STR_MARKETING_ADVERTISING_CAMPAIGN_FOR_A_PARTICULAR_RIDE, STR_ADVERTISING_CAMPAIGN_FOR_2, STR_MARKETING_FINISHED_RIDE_ADS }, // ADVERTISING_CAMPAIGN_RIDE, }; -const rct_string_id RideInspectionIntervalNames[] = { +const StringId RideInspectionIntervalNames[] = { STR_EVERY_10_MINUTES, STR_EVERY_20_MINUTES, STR_EVERY_30_MINUTES, @@ -94,7 +94,7 @@ const rct_string_id RideInspectionIntervalNames[] = { STR_NEVER, }; -const rct_string_id PeepThoughts[] = { +const StringId PeepThoughts[] = { STR_PEEP_THOUGHT_TYPE_CANT_AFFORD_0, STR_PEEP_THOUGHT_TYPE_SPENT_MONEY, STR_PEEP_THOUGHT_TYPE_SICK, @@ -271,7 +271,7 @@ const rct_string_id PeepThoughts[] = { STR_PEEP_THOUGHT_TYPE_HERE_WE_ARE, }; -const rct_string_id DateDayNames[] = { +const StringId DateDayNames[] = { STR_DATE_DAY_1, STR_DATE_DAY_2, STR_DATE_DAY_3, @@ -305,7 +305,7 @@ const rct_string_id DateDayNames[] = { STR_DATE_DAY_31, }; -const rct_string_id DateGameMonthNames[MONTH_COUNT] = { +const StringId DateGameMonthNames[MONTH_COUNT] = { STR_MONTH_MARCH, STR_MONTH_APRIL, STR_MONTH_MAY, @@ -316,7 +316,7 @@ const rct_string_id DateGameMonthNames[MONTH_COUNT] = { STR_MONTH_OCTOBER, }; -const rct_string_id DateGameShortMonthNames[MONTH_COUNT] = { +const StringId DateGameShortMonthNames[MONTH_COUNT] = { STR_MONTH_SHORT_MAR, STR_MONTH_SHORT_APR, STR_MONTH_SHORT_MAY, @@ -328,7 +328,7 @@ const rct_string_id DateGameShortMonthNames[MONTH_COUNT] = { }; // clang-format on -std::string format_string(rct_string_id format, const void* args) +std::string format_string(StringId format, const void* args) { std::string buffer(256, 0); size_t len{}; @@ -361,7 +361,7 @@ std::string format_string(rct_string_id format, const void* args) * format (ax) * args (ecx) */ -void format_string_to_upper(utf8* dest, size_t size, rct_string_id format, const void* args) +void format_string_to_upper(utf8* dest, size_t size, StringId format, const void* args) { #ifdef DEBUG if (gDebugStringFormatting) diff --git a/src/openrct2/localisation/Localisation.h b/src/openrct2/localisation/Localisation.h index b31df20aa7..89f43e8834 100644 --- a/src/openrct2/localisation/Localisation.h +++ b/src/openrct2/localisation/Localisation.h @@ -18,9 +18,9 @@ #include -std::string format_string(rct_string_id format, const void* args); -void format_string(char* dest, size_t size, rct_string_id format, const void* args); -void format_string_to_upper(char* dest, size_t size, rct_string_id format, const void* args); +std::string format_string(StringId format, const void* args); +void format_string(char* dest, size_t size, StringId format, const void* args); +void format_string_to_upper(char* dest, size_t size, StringId format, const void* args); void generate_string_file(); /** @@ -41,7 +41,7 @@ size_t get_string_size(const utf8* text); money32 string_to_money(const char* string_to_monetise); void money_to_string(money32 amount, char* buffer_to_put_value_to, size_t buffer_len, bool forceDecimals); -bool is_user_string_id(rct_string_id stringId); +bool is_user_string_id(StringId stringId); #define MAX_USER_STRINGS 1024 #define USER_STRING_MAX_LENGTH 32 @@ -58,12 +58,12 @@ extern const char* real_names[1024]; extern thread_local char gCommonStringFormatBuffer[512]; extern bool gDebugStringFormatting; -extern const rct_string_id SpeedNames[5]; -extern const rct_string_id ObjectiveNames[12]; -extern const rct_string_id ResearchFundingLevelNames[4]; -extern const rct_string_id MarketingCampaignNames[ADVERTISING_CAMPAIGN_COUNT][3]; -extern const rct_string_id RideInspectionIntervalNames[]; -extern const rct_string_id PeepThoughts[174]; -extern const rct_string_id DateDayNames[31]; -extern const rct_string_id DateGameMonthNames[MONTH_COUNT]; -extern const rct_string_id DateGameShortMonthNames[MONTH_COUNT]; +extern const StringId SpeedNames[5]; +extern const StringId ObjectiveNames[12]; +extern const StringId ResearchFundingLevelNames[4]; +extern const StringId MarketingCampaignNames[ADVERTISING_CAMPAIGN_COUNT][3]; +extern const StringId RideInspectionIntervalNames[]; +extern const StringId PeepThoughts[174]; +extern const StringId DateDayNames[31]; +extern const StringId DateGameMonthNames[MONTH_COUNT]; +extern const StringId DateGameShortMonthNames[MONTH_COUNT]; diff --git a/src/openrct2/localisation/LocalisationService.cpp b/src/openrct2/localisation/LocalisationService.cpp index 58f57ba9d3..a115ca22ae 100644 --- a/src/openrct2/localisation/LocalisationService.cpp +++ b/src/openrct2/localisation/LocalisationService.cpp @@ -29,8 +29,7 @@ static constexpr uint16_t MAX_OBJECT_CACHED_STRINGS = 0x5000 - BASE_OBJECT_STRIN LocalisationService::LocalisationService(const std::shared_ptr& env) : _env(env) { - for (rct_string_id stringId = BASE_OBJECT_STRING_ID + MAX_OBJECT_CACHED_STRINGS; stringId >= BASE_OBJECT_STRING_ID; - stringId--) + for (StringId stringId = BASE_OBJECT_STRING_ID + MAX_OBJECT_CACHED_STRINGS; stringId >= BASE_OBJECT_STRING_ID; stringId--) { _availableObjectStringIds.push(stringId); } @@ -39,7 +38,7 @@ LocalisationService::LocalisationService(const std::shared_ptr LocalisationService::GetLocalisedScenarioStrings( +std::tuple LocalisationService::GetLocalisedScenarioStrings( const std::string& scenarioFilename) const { auto result0 = _languageCurrent->GetScenarioOverrideStringId(scenarioFilename.c_str(), 0); @@ -126,7 +125,7 @@ std::tuple LocalisationService::Get return std::make_tuple(result0, result1, result2); } -rct_string_id LocalisationService::GetObjectOverrideStringId(std::string_view legacyIdentifier, uint8_t index) const +StringId LocalisationService::GetObjectOverrideStringId(std::string_view legacyIdentifier, uint8_t index) const { if (_languageCurrent == nullptr) { @@ -135,7 +134,7 @@ rct_string_id LocalisationService::GetObjectOverrideStringId(std::string_view le return _languageCurrent->GetObjectOverrideStringId(legacyIdentifier, index); } -rct_string_id LocalisationService::AllocateObjectString(const std::string& target) +StringId LocalisationService::AllocateObjectString(const std::string& target) { if (_availableObjectStringIds.empty()) { @@ -155,7 +154,7 @@ rct_string_id LocalisationService::AllocateObjectString(const std::string& targe return stringId; } -void LocalisationService::FreeObjectString(rct_string_id stringId) +void LocalisationService::FreeObjectString(StringId stringId) { if (stringId != STR_EMPTY) { diff --git a/src/openrct2/localisation/LocalisationService.h b/src/openrct2/localisation/LocalisationService.h index 565a7e2fb2..bdf02de993 100644 --- a/src/openrct2/localisation/LocalisationService.h +++ b/src/openrct2/localisation/LocalisationService.h @@ -36,7 +36,7 @@ namespace OpenRCT2::Localisation bool _useTrueTypeFont{}; std::unique_ptr _languageFallback; std::unique_ptr _languageCurrent; - std::stack _availableObjectStringIds; + std::stack _availableObjectStringIds; std::vector _objectStrings; public: @@ -56,16 +56,15 @@ namespace OpenRCT2::Localisation LocalisationService(const std::shared_ptr& env); ~LocalisationService(); - const char* GetString(rct_string_id id) const; - std::tuple GetLocalisedScenarioStrings( - const std::string& scenarioFilename) const; - rct_string_id GetObjectOverrideStringId(std::string_view legacyIdentifier, uint8_t index) const; + const char* GetString(StringId id) const; + std::tuple GetLocalisedScenarioStrings(const std::string& scenarioFilename) const; + StringId GetObjectOverrideStringId(std::string_view legacyIdentifier, uint8_t index) const; std::string GetLanguagePath(uint32_t languageId) const; void OpenLanguage(int32_t id); void CloseLanguages(); - rct_string_id AllocateObjectString(const std::string& target); - void FreeObjectString(rct_string_id stringId); + StringId AllocateObjectString(const std::string& target); + void FreeObjectString(StringId stringId); }; } // namespace OpenRCT2::Localisation diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index a79fea4916..3c7fe97cae 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -11,8 +11,8 @@ #include "../common.h" -constexpr const rct_string_id STR_NONE = 0xFFFF; -constexpr const rct_string_id STR_VIEWPORT = 0xFFFE; +constexpr const StringId STR_NONE = 0xFFFF; +constexpr const StringId STR_VIEWPORT = 0xFFFE; enum : uint16_t { diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index 3c68697490..cdce1a502a 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -46,7 +46,7 @@ static constexpr const uint8_t AwardPositiveMap[] = { POSITIVE, // AwardType::BestGentleRides }; -static constexpr const rct_string_id AwardNewsStrings[] = { +static constexpr const StringId AwardNewsStrings[] = { STR_NEWS_ITEM_AWARD_MOST_UNTIDY, STR_NEWS_ITEM_MOST_TIDY, STR_NEWS_ITEM_BEST_ROLLERCOASTERS, diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index e9622111f5..8bb235ae1f 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -85,7 +85,7 @@ static void marketing_raise_finished_notification(const MarketingCampaign& campa } else if (campaign.Type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) { - ft.Add(GetShopItemDescriptor(campaign.ShopItemType).Naming.Plural); + ft.Add(GetShopItemDescriptor(campaign.ShopItemType).Naming.Plural); } News::AddItemToQueue(News::ItemType::Money, MarketingCampaignNames[campaign.Type][2], 0, ft); diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index b6f0db5e83..c9ad1a7134 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -305,7 +305,7 @@ News::Item* News::ItemQueues::FirstOpenOrNewSlot() * * rct2: 0x0066DF55 */ -News::Item* News::AddItemToQueue(News::ItemType type, rct_string_id string_id, uint32_t assoc, const Formatter& formatter) +News::Item* News::AddItemToQueue(News::ItemType type, StringId string_id, uint32_t assoc, const Formatter& formatter) { utf8 buffer[256]; @@ -315,7 +315,7 @@ News::Item* News::AddItemToQueue(News::ItemType type, rct_string_id string_id, u } // TODO: Use variant for assoc, requires strong type for each possible input. -News::Item* News::AddItemToQueue(ItemType type, rct_string_id string_id, EntityId assoc, const Formatter& formatter) +News::Item* News::AddItemToQueue(ItemType type, StringId string_id, EntityId assoc, const Formatter& formatter) { return AddItemToQueue(type, string_id, assoc.ToUnderlying(), formatter); } diff --git a/src/openrct2/management/NewsItem.h b/src/openrct2/management/NewsItem.h index 9ffdb2e131..b871150e42 100644 --- a/src/openrct2/management/NewsItem.h +++ b/src/openrct2/management/NewsItem.h @@ -292,8 +292,8 @@ namespace News std::optional GetSubjectLocation(News::ItemType type, int32_t subject); - News::Item* AddItemToQueue(News::ItemType type, rct_string_id string_id, uint32_t assoc, const Formatter& formatter); - News::Item* AddItemToQueue(News::ItemType type, rct_string_id string_id, EntityId assoc, const Formatter& formatter); + News::Item* AddItemToQueue(News::ItemType type, StringId string_id, uint32_t assoc, const Formatter& formatter); + News::Item* AddItemToQueue(News::ItemType type, StringId string_id, EntityId assoc, const Formatter& formatter); News::Item* AddItemToQueue(News::ItemType type, const utf8* text, uint32_t assoc); bool CheckIfItemRequiresAssoc(News::ItemType type); diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 280232bd25..552eb24cbb 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -211,7 +211,7 @@ void research_finish_item(ResearchItem* researchItem) base_ride_type = ride_entry_get_first_non_null_ride_type(rideEntry); } - rct_string_id availabilityString; + StringId availabilityString; ride_type_set_invented(base_ride_type); ride_entry_set_invented(rideEntryIndex); @@ -257,7 +257,7 @@ void research_finish_item(ResearchItem* researchItem) { RideNaming naming = get_ride_naming(base_ride_type, rideEntry); availabilityString = STR_NEWS_ITEM_RESEARCH_NEW_RIDE_AVAILABLE; - ft.Add(naming.Name); + ft.Add(naming.Name); } // If the vehicle should not be listed separately and it isn't the first to be invented for its ride group, // report it as a new vehicle for the existing ride group. @@ -266,8 +266,8 @@ void research_finish_item(ResearchItem* researchItem) availabilityString = STR_NEWS_ITEM_RESEARCH_NEW_VEHICLE_AVAILABLE; RideNaming baseRideNaming = get_ride_naming(base_ride_type, rideEntry); - ft.Add(baseRideNaming.Name); - ft.Add(rideEntry->naming.Name); + ft.Add(baseRideNaming.Name); + ft.Add(rideEntry->naming.Name); } if (!gSilentResearch) @@ -290,7 +290,7 @@ void research_finish_item(ResearchItem* researchItem) scenery_group_set_invented(researchItem->entryIndex); Formatter ft; - ft.Add(sceneryGroupEntry->name); + ft.Add(sceneryGroupEntry->name); if (!gSilentResearch) { @@ -702,7 +702,7 @@ void set_every_ride_entry_not_invented() * * rct2: 0x0068563D */ -rct_string_id ResearchItem::GetName() const +StringId ResearchItem::GetName() const { if (type == Research::EntryType::Ride) { @@ -905,7 +905,7 @@ bool ResearchItem::Exists() const } // clang-format off -static constexpr const rct_string_id _editorInventionsResearchCategories[] = { +static constexpr const StringId _editorInventionsResearchCategories[] = { STR_RESEARCH_NEW_TRANSPORT_RIDES, STR_RESEARCH_NEW_GENTLE_RIDES, STR_RESEARCH_NEW_ROLLER_COASTERS, @@ -916,7 +916,7 @@ static constexpr const rct_string_id _editorInventionsResearchCategories[] = { }; // clang-format on -rct_string_id ResearchItem::GetCategoryInventionString() const +StringId ResearchItem::GetCategoryInventionString() const { const auto categoryValue = EnumValue(category); Guard::Assert(categoryValue <= 6, "Unsupported category invention string"); @@ -924,7 +924,7 @@ rct_string_id ResearchItem::GetCategoryInventionString() const } // clang-format off -static constexpr const rct_string_id _researchCategoryNames[] = { +static constexpr const StringId _researchCategoryNames[] = { STR_RESEARCH_CATEGORY_TRANSPORT, STR_RESEARCH_CATEGORY_GENTLE, STR_RESEARCH_CATEGORY_ROLLERCOASTER, @@ -935,7 +935,7 @@ static constexpr const rct_string_id _researchCategoryNames[] = { }; // clang-format on -rct_string_id ResearchItem::GetCategoryName() const +StringId ResearchItem::GetCategoryName() const { const auto categoryValue = EnumValue(category); Guard::Assert(categoryValue <= 6, "Unsupported category name"); diff --git a/src/openrct2/management/Research.h b/src/openrct2/management/Research.h index df78517a66..f29b11583e 100644 --- a/src/openrct2/management/Research.h +++ b/src/openrct2/management/Research.h @@ -65,9 +65,9 @@ struct ResearchItem void SetNull(); bool Exists() const; bool IsAlwaysResearched() const; - rct_string_id GetName() const; - rct_string_id GetCategoryInventionString() const; - rct_string_id GetCategoryName() const; + StringId GetName() const; + StringId GetCategoryInventionString() const; + StringId GetCategoryName() const; ResearchItem() = default; constexpr ResearchItem(uint32_t _rawValue, ResearchCategory _category, uint8_t _flags) diff --git a/src/openrct2/network/NetworkAction.h b/src/openrct2/network/NetworkAction.h index 49e63339e7..fb0088f230 100644 --- a/src/openrct2/network/NetworkAction.h +++ b/src/openrct2/network/NetworkAction.h @@ -48,7 +48,7 @@ enum class NetworkPermission : uint32_t class NetworkAction final { public: - rct_string_id Name; + StringId Name; std::string PermissionName; std::vector Commands; }; diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 6b18940b7c..934f20348a 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -1598,7 +1598,7 @@ void NetworkBase::Server_Send_GAMEINFO(NetworkConnection& connection) connection.QueuePacket(std::move(packet)); } -void NetworkBase::Server_Send_SHOWERROR(NetworkConnection& connection, rct_string_id title, rct_string_id message) +void NetworkBase::Server_Send_SHOWERROR(NetworkConnection& connection, StringId title, StringId message) { NetworkPacket packet(NetworkCommand::ShowError); packet << title << message; @@ -3045,7 +3045,7 @@ void NetworkBase::Server_Handle_GAMEINFO(NetworkConnection& connection, [[maybe_ void NetworkBase::Client_Handle_SHOWERROR([[maybe_unused]] NetworkConnection& connection, NetworkPacket& packet) { - rct_string_id title, message; + StringId title, message; packet >> title >> message; context_show_error(title, message, {}); } @@ -3650,7 +3650,7 @@ int32_t network_get_num_actions() return static_cast(NetworkActions::Actions.size()); } -rct_string_id network_get_action_name_string_id(uint32_t index) +StringId network_get_action_name_string_id(uint32_t index) { if (index < NetworkActions::Actions.size()) { @@ -4076,7 +4076,7 @@ int32_t network_get_num_actions() { return 0; } -rct_string_id network_get_action_name_string_id(uint32_t index) +StringId network_get_action_name_string_id(uint32_t index) { return -1; } diff --git a/src/openrct2/network/NetworkBase.h b/src/openrct2/network/NetworkBase.h index 55db7ff0fc..ffc5790a13 100644 --- a/src/openrct2/network/NetworkBase.h +++ b/src/openrct2/network/NetworkBase.h @@ -93,7 +93,7 @@ public: // Server void Server_Send_PINGLIST(); void Server_Send_SETDISCONNECTMSG(NetworkConnection& connection, const char* msg); void Server_Send_GAMEINFO(NetworkConnection& connection); - void Server_Send_SHOWERROR(NetworkConnection& connection, rct_string_id title, rct_string_id message); + void Server_Send_SHOWERROR(NetworkConnection& connection, StringId title, StringId message); void Server_Send_GROUPLIST(NetworkConnection& connection); void Server_Send_EVENT_PLAYER_JOINED(const char* playerName); void Server_Send_EVENT_PLAYER_DISCONNECTED(const char* playerName, const char* reason); diff --git a/src/openrct2/network/NetworkConnection.cpp b/src/openrct2/network/NetworkConnection.cpp index 286ac7439f..104efcdaeb 100644 --- a/src/openrct2/network/NetworkConnection.cpp +++ b/src/openrct2/network/NetworkConnection.cpp @@ -195,7 +195,7 @@ void NetworkConnection::SetLastDisconnectReason(std::string_view src) _lastDisconnectReason = src; } -void NetworkConnection::SetLastDisconnectReason(const rct_string_id string_id, void* args) +void NetworkConnection::SetLastDisconnectReason(const StringId string_id, void* args) { char buffer[NETWORK_DISCONNECT_REASON_BUFFER_SIZE]; format_string(buffer, NETWORK_DISCONNECT_REASON_BUFFER_SIZE, string_id, args); diff --git a/src/openrct2/network/NetworkConnection.h b/src/openrct2/network/NetworkConnection.h index 52d89a8e6d..4cebf2530d 100644 --- a/src/openrct2/network/NetworkConnection.h +++ b/src/openrct2/network/NetworkConnection.h @@ -59,7 +59,7 @@ public: const utf8* GetLastDisconnectReason() const noexcept; void SetLastDisconnectReason(std::string_view src); - void SetLastDisconnectReason(const rct_string_id string_id, void* args = nullptr); + void SetLastDisconnectReason(const StringId string_id, void* args = nullptr); private: std::deque _outboundPackets; diff --git a/src/openrct2/network/ServerList.h b/src/openrct2/network/ServerList.h index 4350192e0c..be30ffe15a 100644 --- a/src/openrct2/network/ServerList.h +++ b/src/openrct2/network/ServerList.h @@ -73,9 +73,9 @@ public: class MasterServerException : public std::exception { public: - rct_string_id StatusText; + StringId StatusText; - MasterServerException(rct_string_id statusText) + MasterServerException(StringId statusText) : StatusText(statusText) { } diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 46960cc449..851fcfa84e 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -85,7 +85,7 @@ void network_set_player_group(uint32_t index, uint32_t groupindex); [[nodiscard]] GameActions::Result network_kick_player(NetworkPlayerId_t playerId, bool isExecuting); [[nodiscard]] uint8_t network_get_default_group(); [[nodiscard]] int32_t network_get_num_actions(); -[[nodiscard]] rct_string_id network_get_action_name_string_id(uint32_t index); +[[nodiscard]] StringId network_get_action_name_string_id(uint32_t index); [[nodiscard]] int32_t network_can_perform_action(uint32_t groupindex, NetworkPermission index); [[nodiscard]] int32_t network_can_perform_command(uint32_t groupindex, int32_t index); void network_set_pickup_peep(uint8_t playerid, Peep* peep); diff --git a/src/openrct2/object/FootpathRailingsObject.h b/src/openrct2/object/FootpathRailingsObject.h index 15bc15edd0..87c5e8efe2 100644 --- a/src/openrct2/object/FootpathRailingsObject.h +++ b/src/openrct2/object/FootpathRailingsObject.h @@ -15,7 +15,7 @@ class FootpathRailingsObject final : public Object { public: - rct_string_id NameStringId{}; + StringId NameStringId{}; uint32_t PreviewImageId{}; uint32_t BridgeImageId{}; uint32_t RailingsImageId{}; diff --git a/src/openrct2/object/FootpathSurfaceObject.h b/src/openrct2/object/FootpathSurfaceObject.h index b6c3e7cfa2..19d62f3d9d 100644 --- a/src/openrct2/object/FootpathSurfaceObject.h +++ b/src/openrct2/object/FootpathSurfaceObject.h @@ -15,7 +15,7 @@ class FootpathSurfaceObject final : public Object { public: - rct_string_id NameStringId{}; + StringId NameStringId{}; uint32_t PreviewImageId{}; uint32_t BaseImageId{}; uint8_t Flags{}; diff --git a/src/openrct2/object/MusicObject.h b/src/openrct2/object/MusicObject.h index 4341c83a2e..363acbd24e 100644 --- a/src/openrct2/object/MusicObject.h +++ b/src/openrct2/object/MusicObject.h @@ -48,7 +48,7 @@ private: MusicNiceFactor _niceFactor; public: - rct_string_id NameStringId{}; + StringId NameStringId{}; void ReadJson(IReadObjectContext* context, json_t& root) override; void Load() override; diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index eb29846779..f6bff8670d 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -260,7 +260,7 @@ public: return objects; } - static rct_string_id GetObjectSourceGameString(const ObjectSourceGame sourceGame) + static StringId GetObjectSourceGameString(const ObjectSourceGame sourceGame) { switch (sourceGame) { @@ -771,7 +771,7 @@ void object_manager_unload_all_objects() objectManager.UnloadAllTransient(); } -rct_string_id object_manager_get_source_game_string(const ObjectSourceGame sourceGame) +StringId object_manager_get_source_game_string(const ObjectSourceGame sourceGame) { return ObjectManager::GetObjectSourceGameString(sourceGame); } diff --git a/src/openrct2/object/ObjectManager.h b/src/openrct2/object/ObjectManager.h index cc31e2c11a..d6975ac8b4 100644 --- a/src/openrct2/object/ObjectManager.h +++ b/src/openrct2/object/ObjectManager.h @@ -55,4 +55,4 @@ struct IObjectManager Object* object_manager_load_object(const rct_object_entry* entry); void object_manager_unload_objects(const std::vector& entries); void object_manager_unload_all_objects(); -[[nodiscard]] rct_string_id object_manager_get_source_game_string(const ObjectSourceGame sourceGame); +[[nodiscard]] StringId object_manager_get_source_game_string(const ObjectSourceGame sourceGame); diff --git a/src/openrct2/object/ObjectRepository.cpp b/src/openrct2/object/ObjectRepository.cpp index afac70f22f..b0726a2896 100644 --- a/src/openrct2/object/ObjectRepository.cpp +++ b/src/openrct2/object/ObjectRepository.cpp @@ -685,7 +685,7 @@ std::unique_ptr object_repository_load_object(const rct_object_entry* ob void scenario_translate(scenario_index_entry* scenarioEntry) { - rct_string_id localisedStringIds[3]; + StringId localisedStringIds[3]; if (language_get_localised_scenario_strings(scenarioEntry->name, localisedStringIds)) { if (localisedStringIds[0] != STR_NONE) diff --git a/src/openrct2/object/StationObject.h b/src/openrct2/object/StationObject.h index a335e918ea..37e6f4d80e 100644 --- a/src/openrct2/object/StationObject.h +++ b/src/openrct2/object/StationObject.h @@ -24,7 +24,7 @@ namespace STATION_OBJECT_FLAGS class StationObject final : public Object { public: - rct_string_id NameStringId{}; + StringId NameStringId{}; ImageIndex BaseImageId = ImageIndexUndefined; ImageIndex ShelterImageId = ImageIndexUndefined; uint32_t Flags{}; diff --git a/src/openrct2/object/TerrainEdgeObject.h b/src/openrct2/object/TerrainEdgeObject.h index 7ab3914337..e47a685980 100644 --- a/src/openrct2/object/TerrainEdgeObject.h +++ b/src/openrct2/object/TerrainEdgeObject.h @@ -15,7 +15,7 @@ class TerrainEdgeObject final : public Object { private: public: - rct_string_id NameStringId{}; + StringId NameStringId{}; uint32_t IconImageId{}; uint32_t BaseImageId{}; bool HasDoors{}; diff --git a/src/openrct2/object/TerrainSurfaceObject.h b/src/openrct2/object/TerrainSurfaceObject.h index c20df180d2..c86b253b9f 100644 --- a/src/openrct2/object/TerrainSurfaceObject.h +++ b/src/openrct2/object/TerrainSurfaceObject.h @@ -37,7 +37,7 @@ private: static constexpr auto NUM_IMAGES_IN_ENTRY = 19; public: - rct_string_id NameStringId{}; + StringId NameStringId{}; uint32_t IconImageId{}; uint32_t PatternBaseImageId{}; uint32_t EntryBaseImageId{}; diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 7a9eb3694f..13fe176342 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -894,7 +894,7 @@ bool PaintAttachToPreviousPS(paint_session& session, ImageId image_id, int32_t x * @param rotation (ebp) */ void PaintFloatingMoneyEffect( - paint_session& session, money64 amount, rct_string_id string_id, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, + paint_session& session, money64 amount, StringId string_id, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, uint32_t rotation) { auto* ps = session.AllocateStringPaintEntry(); diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 1fe7b571dd..93c130c825 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -64,7 +64,7 @@ struct paint_struct struct paint_string_struct { - rct_string_id string_id; + StringId string_id; paint_string_struct* next; int32_t x; int32_t y; @@ -327,7 +327,7 @@ bool PaintAttachToPreviousAttach(paint_session& session, ImageId imageId, int32_ bool PaintAttachToPreviousPS(paint_session& session, ImageId image_id, int32_t x, int32_t y); bool PaintAttachToPreviousPS(paint_session& session, uint32_t image_id, int32_t x, int32_t y); void PaintFloatingMoneyEffect( - paint_session& session, money64 amount, rct_string_id string_id, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, + paint_session& session, money64 amount, StringId string_id, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, uint32_t rotation); paint_session* PaintSessionAlloc(rct_drawpixelinfo* dpi, uint32_t viewFlags); diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 08f1fa9a09..fe8c5c212e 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -50,14 +50,14 @@ static void PaintRideEntranceExitScrollingText( return; auto ft = Formatter(); - ft.Add(STR_RIDE_ENTRANCE_NAME); + ft.Add(STR_RIDE_ENTRANCE_NAME); if (ride->status == RideStatus::Open && !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) { ride->FormatNameTo(ft); } else { - ft.Add(STR_RIDE_ENTRANCE_CLOSED); + ft.Add(STR_RIDE_ENTRANCE_CLOSED); } char text[256]; @@ -222,12 +222,12 @@ static void PaintParkEntranceScrollingText( { const auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); auto name = park.Name.c_str(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(name); } else { - ft.Add(STR_BANNER_TEXT_CLOSED); + ft.Add(STR_BANNER_TEXT_CLOSED); ft.Add(0); } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 8b0da3332d..93a25762c2 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -449,12 +449,12 @@ static void sub_6A4101( if (ride->status == RideStatus::Open && !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) { - ft.Add(STR_RIDE_ENTRANCE_NAME); + ft.Add(STR_RIDE_ENTRANCE_NAME); ride->FormatNameTo(ft); } else { - ft.Add(STR_RIDE_ENTRANCE_CLOSED); + ft.Add(STR_RIDE_ENTRANCE_CLOSED); } if (gConfigGeneral.upper_case_banners) { diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index 6048d3f9eb..f8591c5b12 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -287,8 +287,8 @@ namespace RCT1 struct UnkEntity : RCT12SpriteBase { - uint8_t pad_1F[3]; // 0x1f - rct_string_id name_string_idx; // 0x22 + uint8_t pad_1F[3]; // 0x1f + StringId name_string_idx; // 0x22 uint16_t var_24; uint16_t frame; // 0x26 uint8_t var_28[3]; @@ -439,16 +439,16 @@ namespace RCT1 struct Peep : RCT12SpriteBase { uint8_t pad_1F[3]; - rct_string_id name_string_idx; // 0x22 - uint16_t next_x; // 0x24 - uint16_t next_y; // 0x26 - uint8_t next_z; // 0x28 - uint8_t next_flags; // 0x29 - uint8_t outside_of_park; // 0x2A - uint8_t state; // 0x2B - uint8_t sub_state; // 0x2C - PeepSpriteType sprite_type; // 0x2D - uint8_t type; // 0x2E + StringId name_string_idx; // 0x22 + uint16_t next_x; // 0x24 + uint16_t next_y; // 0x26 + uint8_t next_z; // 0x28 + uint8_t next_flags; // 0x29 + uint8_t outside_of_park; // 0x2A + uint8_t state; // 0x2B + uint8_t sub_state; // 0x2C + PeepSpriteType sprite_type; // 0x2D + uint8_t type; // 0x2E union { uint8_t staff_type; // 0x2F diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 56e47890ee..f87a499025 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -243,7 +243,7 @@ namespace RCT1 String::Set(dst->internal_name, sizeof(dst->internal_name), desc.title); - rct_string_id localisedStringIds[3]; + StringId localisedStringIds[3]; if (language_get_localised_scenario_strings(desc.title, localisedStringIds)) { if (localisedStringIds[0] != STR_NONE) @@ -2101,7 +2101,7 @@ namespace RCT1 void ImportParkName() { std::string parkName = std::string(_s4.scenario_name); - if (is_user_string_id(static_cast(_s4.park_name_string_index))) + if (is_user_string_id(static_cast(_s4.park_name_string_index))) { std::string userString = GetUserString(_s4.park_name_string_index); if (!userString.empty()) @@ -2299,7 +2299,7 @@ namespace RCT1 source_desc sourceDesc; if (ScenarioSources::TryGetById(scNumber, &sourceDesc)) { - rct_string_id localisedStringIds[3]; + StringId localisedStringIds[3]; if (language_get_localised_scenario_strings(sourceDesc.title, localisedStringIds)) { if (localisedStringIds[0] != STR_NONE) @@ -2465,7 +2465,7 @@ namespace RCT1 return _s4.research_items; } - std::string GetUserString(rct_string_id stringId) + std::string GetUserString(StringId stringId) { const auto originalString = _s4.string_table[(stringId - USER_STRING_START) % 1024]; auto originalStringView = std::string_view( diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index ff9e70e53e..e371eb4708 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -444,7 +444,7 @@ uint8_t RCT12BannerElement::GetAllowedEdges() const return AllowedEdges & 0b00001111; } -bool is_user_string_id(rct_string_id stringId) +bool is_user_string_id(StringId stringId) { return stringId >= 0x8000 && stringId < 0x9000; } diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 726f6cfdb7..bae74abc8d 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -798,8 +798,8 @@ assert_struct_size(RCT12RideMeasurement, 0x4B0C); struct RCT12Banner { RCT12ObjectEntryIndex type; - uint8_t flags; // 0x01 - rct_string_id string_idx; // 0x02 + uint8_t flags; // 0x01 + StringId string_idx; // 0x02 union { uint8_t colour; // 0x04 diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index a82bc7556c..f16ebd04ff 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -25,7 +25,7 @@ enum class EditorStep : uint8_t; namespace RCT2 { - constexpr const rct_string_id RCT2_RIDE_STRING_START = 2; + constexpr const StringId RCT2_RIDE_STRING_START = 2; // clang-format off constexpr const uint16_t RCT2_OBJECT_ENTRY_COUNT = @@ -80,15 +80,15 @@ namespace RCT2 rct_vehicle_colour vehicle_colours[Limits::MaxTrainsPerRide]; // 0x006 uint8_t pad_046[0x03]; // 0x046, Used to be track colours in RCT1 without expansions // 0 = closed, 1 = open, 2 = test - uint8_t status; // 0x049 - rct_string_id name; // 0x04A + uint8_t status; // 0x049 + StringId name; // 0x04A union { uint32_t name_arguments; // 0x04C struct { - rct_string_id name_arguments_type_name; // 0x04C - uint16_t name_arguments_number; // 0x04E + StringId name_arguments_type_name; // 0x04C + uint16_t name_arguments_number; // 0x04E }; }; RCT12xy8 overall_view; // 0x050 @@ -552,16 +552,16 @@ namespace RCT2 struct Peep : RCT12SpriteBase { uint8_t pad_1F[0x22 - 0x1F]; - rct_string_id name_string_idx; // 0x22 - uint16_t next_x; // 0x24 - uint16_t next_y; // 0x26 - uint8_t next_z; // 0x28 - uint8_t next_flags; // 0x29 - uint8_t outside_of_park; // 0x2A - uint8_t state; // 0x2B - uint8_t sub_state; // 0x2C - uint8_t sprite_type; // 0x2D - uint8_t peep_type; // 0x2E + StringId name_string_idx; // 0x22 + uint16_t next_x; // 0x24 + uint16_t next_y; // 0x26 + uint8_t next_z; // 0x28 + uint8_t next_flags; // 0x29 + uint8_t outside_of_park; // 0x2A + uint8_t state; // 0x2B + uint8_t sub_state; // 0x2C + uint8_t sprite_type; // 0x2D + uint8_t peep_type; // 0x2E union { uint8_t staff_type; // 0x2F @@ -838,7 +838,7 @@ namespace RCT2 Entity sprites[Limits::MaxEntities]; uint16_t sprite_lists_head[static_cast(EntityListId::Count)]; uint16_t sprite_lists_count[static_cast(EntityListId::Count)]; - rct_string_id park_name; + StringId park_name; uint8_t pad_013573D6[2]; uint32_t park_name_args; money32 initial_cash; @@ -1024,9 +1024,9 @@ namespace RCT2 struct StexEntry { - rct_string_id scenario_name; // 0x00 - rct_string_id park_name; // 0x02 - rct_string_id details; // 0x04 + StringId scenario_name; // 0x00 + StringId park_name; // 0x02 + StringId details; // 0x04 uint8_t var_06; }; assert_struct_size(StexEntry, 7); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 808d2aaec9..5c165a33d8 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1747,7 +1747,7 @@ namespace RCT2 void ImportEntity(const RCT12SpriteBase& src); - std::string GetUserString(rct_string_id stringId) + std::string GetUserString(StringId stringId) { const auto originalString = _s6.custom_strings[(stringId - USER_STRING_START) % 1024]; auto originalStringView = std::string_view( @@ -2235,7 +2235,7 @@ std::unique_ptr ParkImporter::CreateS6(IObjectRepository& objectR return std::make_unique(objectRepository); } -static void show_error(uint8_t errorType, rct_string_id errorStringId) +static void show_error(uint8_t errorType, StringId errorStringId) { if (errorType == ERROR_TYPE_GENERIC) { diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 091a8460c7..efb3a789cb 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -98,7 +98,7 @@ static std::vector _rides; struct StationIndexWithMessage { ::StationIndex StationIndex; - rct_string_id Message = STR_NONE; + StringId Message = STR_NONE; }; // Static function declarations @@ -782,11 +782,11 @@ void Ride::FormatStatusTo(Formatter& ft) const { if (lifecycle_flags & RIDE_LIFECYCLE_CRASHED) { - ft.Add(STR_CRASHED); + ft.Add(STR_CRASHED); } else if (lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) { - ft.Add(STR_BROKEN_DOWN); + ft.Add(STR_BROKEN_DOWN); } else if (status == RideStatus::Closed) { @@ -794,49 +794,49 @@ void Ride::FormatStatusTo(Formatter& ft) const { if (num_riders != 0) { - ft.Add(num_riders == 1 ? STR_CLOSED_WITH_PERSON : STR_CLOSED_WITH_PEOPLE); + ft.Add(num_riders == 1 ? STR_CLOSED_WITH_PERSON : STR_CLOSED_WITH_PEOPLE); ft.Add(num_riders); } else { - ft.Add(STR_CLOSED); + ft.Add(STR_CLOSED); } } else { - ft.Add(STR_CLOSED); + ft.Add(STR_CLOSED); } } else if (status == RideStatus::Simulating) { - ft.Add(STR_SIMULATING); + ft.Add(STR_SIMULATING); } else if (status == RideStatus::Testing) { - ft.Add(STR_TEST_RUN); + ft.Add(STR_TEST_RUN); } else if (mode == RideMode::Race && !(lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) && !race_winner.IsNull()) { auto peep = GetEntity(race_winner); if (peep != nullptr) { - ft.Add(STR_RACE_WON_BY); + ft.Add(STR_RACE_WON_BY); peep->FormatNameTo(ft); } else { - ft.Add(STR_RACE_WON_BY); - ft.Add(STR_NONE); + ft.Add(STR_RACE_WON_BY); + ft.Add(STR_NONE); } } else if (!GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) { - ft.Add(num_riders == 1 ? STR_PERSON_ON_RIDE : STR_PEOPLE_ON_RIDE); + ft.Add(num_riders == 1 ? STR_PERSON_ON_RIDE : STR_PEOPLE_ON_RIDE); ft.Add(num_riders); } else { - ft.Add(STR_OPEN); + ft.Add(STR_OPEN); } } @@ -2113,8 +2113,8 @@ std::pair Ride::GetMeasurement() } auto ft = Formatter(); - ft.Add(GetRideComponentName(GetRideTypeDescriptor().NameConvention.vehicle).singular); - ft.Add(GetRideComponentName(GetRideTypeDescriptor().NameConvention.station).singular); + ft.Add(GetRideComponentName(GetRideTypeDescriptor().NameConvention.vehicle).singular); + ft.Add(GetRideComponentName(GetRideTypeDescriptor().NameConvention.station).singular); return { nullptr, { STR_DATA_LOGGING_WILL_START_WHEN_NEXT_LEAVES, ft } }; } @@ -2367,7 +2367,7 @@ static void ride_track_set_map_tooltip(TileElement* tileElement) if (ride != nullptr) { auto ft = Formatter(); - ft.Add(STR_RIDE_MAP_TIP); + ft.Add(STR_RIDE_MAP_TIP); ride->FormatNameTo(ft); ride->FormatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); @@ -2383,7 +2383,7 @@ static void ride_queue_banner_set_map_tooltip(TileElement* tileElement) if (ride != nullptr) { auto ft = Formatter(); - ft.Add(STR_RIDE_MAP_TIP); + ft.Add(STR_RIDE_MAP_TIP); ride->FormatNameTo(ft); ride->FormatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); @@ -2404,10 +2404,10 @@ static void ride_station_set_map_tooltip(TileElement* tileElement) stationIndex = StationIndex::FromUnderlying(stationIndex.ToUnderlying() - 1); auto ft = Formatter(); - ft.Add(STR_RIDE_MAP_TIP); - ft.Add(ride->num_stations <= 1 ? STR_RIDE_STATION : STR_RIDE_STATION_X); + ft.Add(STR_RIDE_MAP_TIP); + ft.Add(ride->num_stations <= 1 ? STR_RIDE_STATION : STR_RIDE_STATION_X); ride->FormatNameTo(ft); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).capitalised); + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).capitalised); ft.Add(stationIndex.ToUnderlying() + 1); ride->FormatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); @@ -2436,8 +2436,8 @@ static void ride_entrance_set_map_tooltip(TileElement* tileElement) queueLength = ride->GetStation(stationIndex).QueueLength; auto ft = Formatter(); - ft.Add(STR_RIDE_MAP_TIP); - ft.Add(ride->num_stations <= 1 ? STR_RIDE_ENTRANCE : STR_RIDE_STATION_X_ENTRANCE); + ft.Add(STR_RIDE_MAP_TIP); + ft.Add(ride->num_stations <= 1 ? STR_RIDE_ENTRANCE : STR_RIDE_STATION_X_ENTRANCE); ride->FormatNameTo(ft); // String IDs have an extra pop16 for some reason @@ -2446,15 +2446,15 @@ static void ride_entrance_set_map_tooltip(TileElement* tileElement) ft.Add(stationIndex.ToUnderlying() + 1); if (queueLength == 0) { - ft.Add(STR_QUEUE_EMPTY); + ft.Add(STR_QUEUE_EMPTY); } else if (queueLength == 1) { - ft.Add(STR_QUEUE_ONE_PERSON); + ft.Add(STR_QUEUE_ONE_PERSON); } else { - ft.Add(STR_QUEUE_PEOPLE); + ft.Add(STR_QUEUE_PEOPLE); } ft.Add(queueLength); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); @@ -2470,7 +2470,7 @@ static void ride_entrance_set_map_tooltip(TileElement* tileElement) stationIndex = StationIndex::FromUnderlying(stationIndex.ToUnderlying() - 1); auto ft = Formatter(); - ft.Add(ride->num_stations <= 1 ? STR_RIDE_EXIT : STR_RIDE_STATION_X_EXIT); + ft.Add(ride->num_stations <= 1 ? STR_RIDE_EXIT : STR_RIDE_STATION_X_EXIT); ride->FormatNameTo(ft); // String IDs have an extra pop16 for some reason @@ -5768,7 +5768,7 @@ void Ride::FormatNameTo(Formatter& ft) const if (!custom_name.empty()) { auto str = custom_name.c_str(); - ft.Add(STR_STRING); + ft.Add(STR_STRING); ft.Add(str); } else @@ -5782,7 +5782,7 @@ void Ride::FormatNameTo(Formatter& ft) const rideTypeName = rideEntry->naming.Name; } } - ft.Add(1).Add(rideTypeName).Add(default_name_number); + ft.Add(1).Add(rideTypeName).Add(default_name_number); } } diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 7a7f751678..56040ad8fb 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -990,7 +990,7 @@ std::string_view get_ride_entry_name(ObjectEntryIndex index); extern money16 gTotalRideValueForMoney; -extern const rct_string_id ColourSchemeNames[4]; +extern const StringId ColourSchemeNames[4]; extern ObjectEntryIndex gLastEntranceStyle; diff --git a/src/openrct2/ride/RideData.cpp b/src/openrct2/ride/RideData.cpp index 72742856cb..109e53d7c9 100644 --- a/src/openrct2/ride/RideData.cpp +++ b/src/openrct2/ride/RideData.cpp @@ -193,7 +193,7 @@ const uint16_t RideFilmLength[3] = { 7000, // SPACE_RAIDERS }; -const rct_string_id RideModeNames[] = { +const StringId RideModeNames[] = { STR_RIDE_MODE_NORMAL, STR_RIDE_MODE_CONTINUOUS_CIRCUIT, STR_RIDE_MODE_REVERSE_INCLINE_LAUNCHED_SHUTTLE, diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index e198b3a3f0..cb6e1dab70 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -39,13 +39,13 @@ using ride_ratings_calculation = void (*)(Ride* ride, RideRatingUpdateState& sta struct RideComponentName { - rct_string_id singular; - rct_string_id plural; - rct_string_id capitalised; - rct_string_id capitalised_plural; - rct_string_id count; - rct_string_id count_plural; - rct_string_id number; + StringId singular; + StringId plural; + StringId capitalised; + StringId capitalised_plural; + StringId count; + StringId count_plural; + StringId number; }; enum class RideComponentType @@ -374,7 +374,7 @@ extern const CarEntry CableLiftVehicle; extern const uint16_t RideFilmLength[3]; -extern const rct_string_id RideModeNames[static_cast(RideMode::Count)]; +extern const StringId RideModeNames[static_cast(RideMode::Count)]; // clang-format off constexpr const RideTypeDescriptor DummyRTD = diff --git a/src/openrct2/ride/RideEntry.h b/src/openrct2/ride/RideEntry.h index 9641176d7a..800078e3df 100644 --- a/src/openrct2/ride/RideEntry.h +++ b/src/openrct2/ride/RideEntry.h @@ -22,8 +22,8 @@ static uint8_t constexpr NoFlatRideCars = 0xFF; struct RideNaming { - rct_string_id Name; - rct_string_id Description; + StringId Name; + StringId Description; }; struct track_colour_preset_list @@ -69,7 +69,7 @@ struct rct_ride_entry int8_t nausea_multiplier; uint8_t max_height; ShopItem shop_item[RCT2::ObjectLimits::MaxShopItemsPerRideEntry]; - rct_string_id capacity; + StringId capacity; void* obj; const CarEntry* GetCar(size_t id) const diff --git a/src/openrct2/ride/ShopItem.h b/src/openrct2/ride/ShopItem.h index 61e5a932e9..8a93c5ce6a 100644 --- a/src/openrct2/ride/ShopItem.h +++ b/src/openrct2/ride/ShopItem.h @@ -79,11 +79,11 @@ using ShopItemIndex = ShopItem; struct ShopItemStrings { - rct_string_id PriceLabel; // Balloon price: - rct_string_id Singular; // Balloon - rct_string_id Plural; // Balloons - rct_string_id Indefinite; // a Balloon - rct_string_id Display; // "Diamond Heights" Balloon + StringId PriceLabel; // Balloon price: + StringId Singular; // Balloon + StringId Plural; // Balloons + StringId Indefinite; // a Balloon + StringId Display; // "Diamond Heights" Balloon }; struct ShopItemDescriptor diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 662f7c42e5..e6e03946db 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -6167,7 +6167,7 @@ static constexpr TrackComputeFunction GetVerticalFunction(const uint16_t type) } } -static constexpr const rct_string_id RideConfigurationStringIds[] = { +static constexpr const StringId RideConfigurationStringIds[] = { STR_EMPTY, // 0 STR_STATION_PLATFORM, // 1 STR_EMPTY, // 2 diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index 13fd1c9934..ce54b69adf 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -75,7 +75,7 @@ constexpr const dodgems_track_size DodgemsTrackSize(track_type_t type) using TrackComputeFunction = int32_t (*)(const int16_t); struct TrackElementDescriptor { - rct_string_id Description; + StringId Description; rct_track_coordinates Coordinates; rct_preview_track* Block; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index da2e125864..66d87c2d72 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -91,7 +91,7 @@ static uint8_t TrackDesignGetEntranceStyle(const Ride& ride) return GetStationStyleFromIdentifier(objectName); } -rct_string_id TrackDesign::CreateTrackDesign(TrackDesignState& tds, const Ride& ride) +StringId TrackDesign::CreateTrackDesign(TrackDesignState& tds, const Ride& ride) { type = ride.type; @@ -173,7 +173,7 @@ rct_string_id TrackDesign::CreateTrackDesign(TrackDesignState& tds, const Ride& } } -rct_string_id TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, const Ride& ride) +StringId TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, const Ride& ride) { CoordsXYE trackElement; if (!ride_try_get_origin_element(&ride, &trackElement)) @@ -351,7 +351,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, const R return STR_NONE; } -rct_string_id TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ride& ride) +StringId TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ride& ride) { auto startLoc = MazeGetFirstElement(ride); @@ -494,7 +494,7 @@ CoordsXYE TrackDesign::MazeGetFirstElement(const Ride& ride) return tile; } -rct_string_id TrackDesign::CreateTrackDesignScenery(TrackDesignState& tds) +StringId TrackDesign::CreateTrackDesignScenery(TrackDesignState& tds) { scenery_elements = _trackSavedTileElementsDesc; // Run an element loop diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index 2f7f4bf350..9abd568ca6 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -148,14 +148,14 @@ struct TrackDesign std::string name; public: - rct_string_id CreateTrackDesign(TrackDesignState& tds, const Ride& ride); - rct_string_id CreateTrackDesignScenery(TrackDesignState& tds); + StringId CreateTrackDesign(TrackDesignState& tds, const Ride& ride); + StringId CreateTrackDesignScenery(TrackDesignState& tds); void Serialise(DataSerialiser& stream); private: uint8_t _saveDirection; - rct_string_id CreateTrackDesignTrack(TrackDesignState& tds, const Ride& ride); - rct_string_id CreateTrackDesignMaze(TrackDesignState& tds, const Ride& ride); + StringId CreateTrackDesignTrack(TrackDesignState& tds, const Ride& ride); + StringId CreateTrackDesignMaze(TrackDesignState& tds, const Ride& ride); CoordsXYE MazeGetFirstElement(const Ride& ride); }; diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index d689349174..2e041c434b 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -49,14 +49,14 @@ std::vector _trackSavedTileElementsDesc; struct TrackDesignAddStatus { bool IsSuccess{}; - rct_string_id Message{}; + StringId Message{}; static TrackDesignAddStatus Success() { - return { true, rct_string_id() }; + return { true, StringId() }; } - static TrackDesignAddStatus Fail(rct_string_id message) + static TrackDesignAddStatus Fail(StringId message) { return { false, message }; } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index e53acf5728..5d76e42bc4 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -3408,7 +3408,7 @@ void Vehicle::CheckIfMissing() if (gConfigNotifications.ride_stalled_vehicles) { Formatter ft; - ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).number); + ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).number); uint8_t vehicleIndex = 0; for (; vehicleIndex < curRide->num_vehicles; ++vehicleIndex) @@ -3418,7 +3418,7 @@ void Vehicle::CheckIfMissing() vehicleIndex++; ft.Add(vehicleIndex); curRide->FormatNameTo(ft); - ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.station).singular); + ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.station).singular); News::AddItemToQueue(News::ItemType::Ride, STR_NEWS_VEHICLE_HAS_STALLED, ride.ToUnderlying(), ft); } @@ -5681,10 +5681,10 @@ void Vehicle::SetMapToolbar() const break; auto ft = Formatter(); - ft.Add(STR_RIDE_MAP_TIP); - ft.Add(STR_MAP_TOOLTIP_STRINGID_STRINGID); + ft.Add(STR_RIDE_MAP_TIP); + ft.Add(STR_MAP_TOOLTIP_STRINGID_STRINGID); curRide->FormatNameTo(ft); - ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).capitalised); + ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).capitalised); ft.Add(vehicleIndex + 1); curRide->FormatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index e7fd293d1d..d3fd51673f 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -58,7 +58,7 @@ #include -const rct_string_id ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT] = { +const StringId ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT] = { STR_BEGINNER_PARKS, STR_CHALLENGING_PARKS, STR_EXPERT_PARKS, STR_REAL_PARKS, STR_OTHER_PARKS, STR_DLC_PARKS, STR_BUILD_YOUR_OWN_PARKS, @@ -120,7 +120,7 @@ void scenario_reset() utf8 normalisedName[64]; ScenarioSources::NormaliseName(normalisedName, sizeof(normalisedName), gScenarioName.c_str()); - rct_string_id localisedStringIds[3]; + StringId localisedStringIds[3]; if (language_get_localised_scenario_strings(normalisedName, localisedStringIds)) { if (localisedStringIds[0] != STR_NONE) diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index 0cf0115279..043d705a86 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -91,7 +91,7 @@ struct Objective union { uint16_t NumGuests; - rct_string_id RideId; + StringId RideId; uint16_t MinimumLength; // For the "Build 10 coasters of minimum length" objective. }; union @@ -148,7 +148,7 @@ enum static constexpr money64 COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x8000000000000001; -extern const rct_string_id ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT]; +extern const StringId ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT]; extern random_engine_t gScenarioRand; diff --git a/src/openrct2/title/TitleSequenceManager.cpp b/src/openrct2/title/TitleSequenceManager.cpp index da61dd419f..264dddbef6 100644 --- a/src/openrct2/title/TitleSequenceManager.cpp +++ b/src/openrct2/title/TitleSequenceManager.cpp @@ -32,7 +32,7 @@ namespace TitleSequenceManager { const utf8* ConfigId; const utf8* Filename; - rct_string_id StringId; + StringId StringId; }; static constexpr PredefinedSequence PredefinedSequences[] = { @@ -235,7 +235,7 @@ namespace TitleSequenceManager if (item.PredefinedIndex != PREDEFINED_INDEX_CUSTOM) { - rct_string_id stringId = PredefinedSequences[item.PredefinedIndex].StringId; + StringId stringId = PredefinedSequences[item.PredefinedIndex].StringId; item.Name = language_get_string(stringId); } else if (IsNameReserved(item.Name)) diff --git a/src/openrct2/ui/DummyWindowManager.cpp b/src/openrct2/ui/DummyWindowManager.cpp index ebd38fc0f2..61d98f0c82 100644 --- a/src/openrct2/ui/DummyWindowManager.cpp +++ b/src/openrct2/ui/DummyWindowManager.cpp @@ -27,7 +27,7 @@ namespace OpenRCT2::Ui { return nullptr; } - rct_window* ShowError(rct_string_id /*title*/, rct_string_id /*message*/, const Formatter& /*formatter*/) override + rct_window* ShowError(StringId /*title*/, StringId /*message*/, const Formatter& /*formatter*/) override { return nullptr; } diff --git a/src/openrct2/ui/WindowManager.h b/src/openrct2/ui/WindowManager.h index 00d296df66..1feda7bd03 100644 --- a/src/openrct2/ui/WindowManager.h +++ b/src/openrct2/ui/WindowManager.h @@ -33,7 +33,7 @@ namespace OpenRCT2::Ui virtual rct_window* OpenDetails(uint8_t type, int32_t id) abstract; virtual rct_window* OpenIntent(Intent* intent) abstract; virtual void BroadcastIntent(const Intent& intent) abstract; - virtual rct_window* ShowError(rct_string_id title, rct_string_id message, const Formatter& formatter) abstract; + virtual rct_window* ShowError(StringId title, StringId message, const Formatter& formatter) abstract; virtual rct_window* ShowError(std::string_view title, std::string_view message) abstract; virtual void ForceClose(rct_windowclass windowClass) abstract; virtual void UpdateMapTooltip() abstract; diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index c1e5e80793..dc2f5e7c58 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -48,7 +48,7 @@ void Banner::FormatTextTo(Formatter& ft, bool addColour) const { auto formatToken = FormatTokenFromTextColour(text_colour); auto tokenText = FormatTokenToString(formatToken, true); - ft.Add(STR_STRING_STRINGID); + ft.Add(STR_STRING_STRINGID); ft.Add(tokenText.data()); } @@ -59,7 +59,7 @@ void Banner::FormatTextTo(Formatter& ft) const { if (flags & BANNER_FLAG_NO_ENTRY) { - ft.Add(STR_NO_ENTRY); + ft.Add(STR_NO_ENTRY); } else if (flags & BANNER_FLAG_LINKED_TO_RIDE) { @@ -70,16 +70,16 @@ void Banner::FormatTextTo(Formatter& ft) const } else { - ft.Add(STR_DEFAULT_SIGN); + ft.Add(STR_DEFAULT_SIGN); } } else if (text.empty()) { - ft.Add(STR_DEFAULT_SIGN); + ft.Add(STR_DEFAULT_SIGN); } else { - ft.Add(STR_STRING).Add(text.c_str()); + ft.Add(STR_STRING).Add(text.c_str()); } } diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index 3096683a26..bd2b5ff7e5 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -306,8 +306,8 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); res.ErrorMessage = STR_X_IN_THE_WAY; auto ft = Formatter(res.ErrorMessageArgs.data()); - rct_string_id stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); - ft.Add(stringId); + StringId stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); + ft.Add(stringId); break; } case TileElementType::Entrance: @@ -329,8 +329,8 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul auto* wallEntry = tileElement->AsWall()->GetEntry(); res.ErrorMessage = STR_X_IN_THE_WAY; auto ft = Formatter(res.ErrorMessageArgs.data()); - rct_string_id stringId = wallEntry != nullptr ? wallEntry->name : static_cast(STR_EMPTY); - ft.Add(stringId); + StringId stringId = wallEntry != nullptr ? wallEntry->name : static_cast(STR_EMPTY); + ft.Add(stringId); break; } case TileElementType::LargeScenery: @@ -338,8 +338,8 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); res.ErrorMessage = STR_X_IN_THE_WAY; auto ft = Formatter(res.ErrorMessageArgs.data()); - rct_string_id stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); - ft.Add(stringId); + StringId stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); + ft.Add(stringId); break; } case TileElementType::Banner: diff --git a/src/openrct2/world/Entrance.h b/src/openrct2/world/Entrance.h index 9dbbd55c57..0edd84c0ae 100644 --- a/src/openrct2/world/Entrance.h +++ b/src/openrct2/world/Entrance.h @@ -19,10 +19,10 @@ #pragma pack(push, 1) struct rct_entrance_type { - rct_string_id string_idx; // 0x00 - uint32_t image_id; // 0x02 - uint8_t scrolling_mode; // 0x06 - uint8_t text_height; // 0x07 + StringId string_idx; // 0x00 + uint32_t image_id; // 0x02 + uint8_t scrolling_mode; // 0x06 + uint8_t text_height; // 0x07 }; assert_struct_size(rct_entrance_type, 8); #pragma pack(pop) diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index a8f6732148..3e8c58749d 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -47,7 +47,7 @@ enum #pragma pack(push, 1) struct rct_footpath_entry { - rct_string_id string_idx; // 0x00 + StringId string_idx; // 0x00 uint32_t image; // 0x02 uint32_t bridge_image; // 0x06 RailingEntrySupportType support_type; // 0x0A @@ -82,7 +82,7 @@ assert_struct_size(rct_footpath_entry, 13); struct PathSurfaceDescriptor { - rct_string_id Name; + StringId Name; uint32_t Image; uint32_t PreviewImage; uint8_t Flags; @@ -95,7 +95,7 @@ struct PathSurfaceDescriptor struct PathRailingsDescriptor { - rct_string_id Name; + StringId Name; uint32_t PreviewImage; uint32_t BridgeImage; uint32_t RailingsImage; diff --git a/src/openrct2/world/Scenery.h b/src/openrct2/world/Scenery.h index c56b1d2179..82721c126b 100644 --- a/src/openrct2/world/Scenery.h +++ b/src/openrct2/world/Scenery.h @@ -26,7 +26,7 @@ struct LargeSceneryText; struct SceneryEntryBase { - rct_string_id name; + StringId name; uint32_t image; }; @@ -189,7 +189,7 @@ struct LargeSceneryText struct rct_scenery_group_entry { - rct_string_id name; + StringId name; uint32_t image; std::vector SceneryEntries; uint8_t priority; diff --git a/src/openrct2/world/Water.h b/src/openrct2/world/Water.h index 77943a7c03..ef10102a55 100644 --- a/src/openrct2/world/Water.h +++ b/src/openrct2/world/Water.h @@ -19,7 +19,7 @@ enum #pragma pack(push, 1) struct rct_water_type { - rct_string_id string_idx; // 0x00 + StringId string_idx; // 0x00 uint32_t image_id; // 0x02 uint32_t palette_index_1; // 0x06 uint32_t palette_index_2; // 0x0A diff --git a/test/tests/FormattingTests.cpp b/test/tests/FormattingTests.cpp index 55bc313536..2c7584f4ee 100644 --- a/test/tests/FormattingTests.cpp +++ b/test/tests/FormattingTests.cpp @@ -292,8 +292,8 @@ TEST_F(FormattingTests, monthyear) TEST_F(FormattingTests, two_level_format) { - constexpr rct_string_id strDefault = STR_RIDE_NAME_DEFAULT; - constexpr rct_string_id strBoatHire = STR_RIDE_NAME_BOAT_HIRE; + constexpr StringId strDefault = STR_RIDE_NAME_DEFAULT; + constexpr StringId strBoatHire = STR_RIDE_NAME_BOAT_HIRE; auto actual = FormatString("Queuing for {STRINGID}", strDefault, strBoatHire, 2); ASSERT_EQ("Queuing for Boat Hire 2", actual); } @@ -307,8 +307,8 @@ TEST_F(FormattingTests, any_string_int_string) TEST_F(FormattingTests, any_two_level_format) { - constexpr rct_string_id strDefault = STR_RIDE_NAME_DEFAULT; - constexpr rct_string_id strBoatHire = STR_RIDE_NAME_BOAT_HIRE; + constexpr StringId strDefault = STR_RIDE_NAME_DEFAULT; + constexpr StringId strBoatHire = STR_RIDE_NAME_BOAT_HIRE; auto actual = FormatStringAny("Queuing for {STRINGID}", { strDefault, strBoatHire, 2 }); ASSERT_EQ("Queuing for Boat Hire 2", actual); } @@ -331,8 +331,8 @@ TEST_F(FormattingTests, to_fixed_buffer) TEST_F(FormattingTests, using_legacy_buffer_args) { auto ft = Formatter(); - ft.Add(STR_RIDE_NAME_DEFAULT); - ft.Add(STR_RIDE_NAME_BOAT_HIRE); + ft.Add(STR_RIDE_NAME_DEFAULT); + ft.Add(STR_RIDE_NAME_BOAT_HIRE); ft.Add(2); char buffer[32]{};