1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-11 10:02:27 +01:00

Differentiate formatTextTo() from formatTextWithColourTo()

This commit is contained in:
Gymnasiast
2025-05-20 23:49:31 +02:00
parent 068112c1ee
commit d2f9d34123
4 changed files with 8 additions and 11 deletions

View File

@@ -453,7 +453,7 @@ namespace OpenRCT2::Ui
auto ft = Formatter();
ft.Add<StringId>(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID);
banner->formatTextTo(ft, /*addColour*/ true);
banner->formatTextWithColourTo(ft);
ft.Add<StringId>(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY);
ft.Add<StringId>(bannerEntry->name);
SetMapTooltip(ft);

View File

@@ -55,7 +55,7 @@ static void PaintBannerScrollingText(
}
auto ft = Formatter();
banner.formatTextTo(ft, true);
banner.formatTextWithColourTo(ft);
char text[256];
if (Config::Get().general.UpperCaseBanners)

View File

@@ -49,15 +49,12 @@ std::string Banner::getText() const
return FormatStringIDLegacy(STR_STRINGID, ft.Data());
}
void Banner::formatTextTo(Formatter& ft, bool addColour) const
void Banner::formatTextWithColourTo(Formatter& ft) const
{
if (addColour)
{
auto formatToken = FormatTokenFromTextColour(textColour);
formattedTextBuffer = FormatTokenToStringWithBraces(formatToken);
ft.Add<StringId>(STR_STRING_STRINGID);
ft.Add<const char*>(formattedTextBuffer.data());
}
auto formatToken = FormatTokenFromTextColour(textColour);
formattedTextBuffer = FormatTokenToStringWithBraces(formatToken);
ft.Add<StringId>(STR_STRING_STRINGID);
ft.Add<const char*>(formattedTextBuffer.data());
formatTextTo(ft);
}

View File

@@ -58,7 +58,7 @@ struct Banner
}
std::string getText() const;
void formatTextTo(Formatter&, bool addColour) const;
void formatTextWithColourTo(Formatter&) const;
void formatTextTo(Formatter&) const;
};