1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-03 18:07:53 +01:00

Port remaining DrawTextWrapped calls with void args to Formatter

This commit is contained in:
Michael Steenbeek
2021-08-21 09:42:05 +02:00
committed by GitHub
parent d8997cd60f
commit f5935931e3
8 changed files with 40 additions and 31 deletions

View File

@@ -189,9 +189,10 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor)
screenCoords.y = _chatBottom - inputLineHeight - 5;
auto lineCh = lineBuffer.c_str();
auto ft = Formatter();
ft.Add<const char*>(lineCh);
inputLineHeight = DrawTextWrapped(
dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, static_cast<void*>(&lineCh),
{ TEXT_COLOUR_255 });
dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, ft, { TEXT_COLOUR_255 });
gfx_set_dirty_blocks({ screenCoords, { screenCoords + ScreenCoordsXY{ _chatWidth, inputLineHeight + 15 } } });
// TODO: Show caret if the input text has multiple lines