From 9d8455956c918ddc1862f4a0911bed94591b8a2b Mon Sep 17 00:00:00 2001 From: staphen Date: Thu, 19 Oct 2023 13:10:01 -0400 Subject: [PATCH] Use DrawStringWithColors() in plrmsg --- Source/plrmsg.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/plrmsg.cpp b/Source/plrmsg.cpp index 975f5c77c..f522fb18c 100644 --- a/Source/plrmsg.cpp +++ b/Source/plrmsg.cpp @@ -129,8 +129,12 @@ void DrawPlrMsg(const Surface &out) y -= message.lineHeight * chatlines; DrawHalfTransparentRectTo(out, x - 3, y, width + 6, message.lineHeight * chatlines); - DrawString(out, text, { { x, y }, { width, 0 } }, message.style, 1, message.lineHeight); - DrawString(out, std::string_view(message.text.data(), message.prefixLength), { { x, y }, { width, 0 } }, UiFlags::ColorWhitegold, 1, message.lineHeight); + + std::vector args { + { std::string_view(text.data(), message.prefixLength), UiFlags::ColorWhitegold }, + { std::string_view(text.data() + message.prefixLength, text.size() - message.prefixLength), message.style } + }; + DrawStringWithColors(out, "{:s}{:s}", args, { { x, y }, { width, 0 } }, UiFlags::None, 1, message.lineHeight); } }