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:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ struct Banner
|
||||
}
|
||||
|
||||
std::string getText() const;
|
||||
void formatTextTo(Formatter&, bool addColour) const;
|
||||
void formatTextWithColourTo(Formatter&) const;
|
||||
void formatTextTo(Formatter&) const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user