1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Deduplicate FormatStringID symbols

This commit is contained in:
Duncan
2024-03-10 18:15:49 +00:00
committed by GitHub
parent b219ab1ed4
commit 1d3bd31ab8
12 changed files with 14 additions and 14 deletions

View File

@@ -168,8 +168,8 @@ static Widget window_error_widgets[] = {
WindowBase* WindowErrorOpen(StringId title, StringId message, const Formatter& args)
{
auto titlez = FormatStringID(title, args.Data());
auto messagez = FormatStringID(message, args.Data());
auto titlez = FormatStringIDLegacy(title, args.Data());
auto messagez = FormatStringIDLegacy(message, args.Data());
return WindowErrorOpen(titlez, messagez);
}
} // namespace OpenRCT2::Ui::Windows

View File

@@ -404,7 +404,7 @@ namespace OpenRCT2::Ui::Windows
WindowBase* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs,
StringId existing_text, uintptr_t existing_args, int32_t maxLength)
{
auto existingText = FormatStringID(existing_text, &existing_args);
auto existingText = FormatStringIDLegacy(existing_text, &existing_args);
WindowTextInputRawOpen(call_w, call_widget, title, description, descriptionArgs, existingText.c_str(), maxLength);
}

View File

@@ -131,11 +131,11 @@ static Widget _tooltipWidgets[] = {
// Returns the width of the new tooltip text
int32_t FormatTextForTooltip(const OpenRCT2String& message)
{
const u8string tempString = ::FormatStringID(message.str, message.args.Data());
const u8string tempString = FormatStringIDLegacy(message.str, message.args.Data());
OpenRCT2String formattedMessage{ STR_STRING_TOOLTIP, Formatter() };
formattedMessage.args.Add<const char*>(tempString.c_str());
const u8string tooltipTextUnwrapped = ::FormatStringID(formattedMessage.str, formattedMessage.args.Data());
const u8string tooltipTextUnwrapped = FormatStringIDLegacy(formattedMessage.str, formattedMessage.args.Data());
auto textWidth = GfxGetStringWidthNewLined(tooltipTextUnwrapped, FontStyle::Small);
textWidth = std::min(textWidth, 196);

View File

@@ -25,7 +25,7 @@ namespace GameActions
}
std::string operator()(const StringId strId) const
{
return FormatStringID(strId, ErrorMessageArgs);
return FormatStringIDLegacy(strId, ErrorMessageArgs);
}
};

View File

@@ -927,7 +927,7 @@ bool ConfigFindOrBrowseInstallDirectory()
return true;
}
uiContext->ShowMessageBox(FormatStringID(STR_COULD_NOT_FIND_AT_PATH, &g1DatPath));
uiContext->ShowMessageBox(FormatStringIDLegacy(STR_COULD_NOT_FIND_AT_PATH, &g1DatPath));
}
}
catch (const std::exception& ex)

View File

@@ -157,7 +157,7 @@ int32_t DrawTextWrapped(
{
const void* args = ft.Data();
StaticLayout layout(FormatStringID(format, args), textPaint, width);
StaticLayout layout(FormatStringIDLegacy(format, args), textPaint, width);
if (textPaint.Alignment == TextAlignment::CENTRE)
{

View File

@@ -1586,7 +1586,7 @@ std::string Peep::GetName() const
{
Formatter ft;
FormatNameTo(ft);
return ::FormatStringID(STR_STRINGID, ft.Data());
return FormatStringIDLegacy(STR_STRINGID, ft.Data());
}
bool Peep::SetName(std::string_view value)

View File

@@ -265,7 +265,7 @@ const StringId PeepThoughts[] = {
};
// clang-format on
std::string FormatStringID(StringId format, const void* args)
std::string FormatStringIDLegacy(StringId format, const void* args)
{
std::string buffer(256, 0);
size_t len{};

View File

@@ -18,7 +18,7 @@
#include <string>
std::string FormatStringID(StringId format, const void* args);
std::string FormatStringIDLegacy(StringId format, const void* args);
void FormatStringToUpper(char* dest, size_t size, StringId format, const void* args);
/**

View File

@@ -5712,7 +5712,7 @@ std::string Ride::GetName() const
{
Formatter ft;
FormatNameTo(ft);
return FormatStringID(STR_STRINGID, reinterpret_cast<const void*>(ft.Data()));
return FormatStringIDLegacy(STR_STRINGID, reinterpret_cast<const void*>(ft.Data()));
}
void Ride::FormatNameTo(Formatter& ft) const

View File

@@ -830,7 +830,7 @@ namespace OpenRCT2::Scripting
// format string with arguments
auto ft = Formatter();
PeepThoughtSetFormatArgs(&_backing, ft);
return FormatStringID(STR_STRINGID, ft.Data());
return FormatStringIDLegacy(STR_STRINGID, ft.Data());
}
} // namespace OpenRCT2::Scripting

View File

@@ -43,7 +43,7 @@ std::string Banner::GetText() const
{
Formatter ft;
FormatTextTo(ft);
return FormatStringID(STR_STRINGID, ft.Data());
return FormatStringIDLegacy(STR_STRINGID, ft.Data());
}
void Banner::FormatTextTo(Formatter& ft, bool addColour) const