Close #12993: Remove hardcoded {SMALLFONT}{BLACK} from tooltips

This commit is contained in:
Łukasz Pękalski 2020-12-19 20:53:57 +01:00 committed by GitHub
parent d0afa7947f
commit 9ec61fa5d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 521 additions and 516 deletions

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,12 @@ void window_tooltip_reset(const ScreenCoordsXY& screenCoords)
// Returns the width of the new tooltip text
static int32_t FormatTextForTooltip(const OpenRCT2String& message)
{
format_string(_tooltipText, sizeof(_tooltipText), message.str, message.args.Data());
utf8 tempBuffer[sizeof(gCommonStringFormatBuffer)];
format_string(tempBuffer, sizeof(tempBuffer), message.str, message.args.Data());
OpenRCT2String formattedMessage{ STR_STRING_TOOLTIP, Formatter() };
formattedMessage.args.Add<const char*>(tempBuffer);
format_string(_tooltipText, sizeof(_tooltipText), formattedMessage.str, formattedMessage.args.Data());
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
auto textWidth = gfx_get_string_width_new_lined(_tooltipText);