Browse Source

Use DrawStringWithColors() in plrmsg

pull/6729/head
staphen 2 years ago committed by Anders Jenbo
parent
commit
9d8455956c
  1. 8
      Source/plrmsg.cpp

8
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<DrawStringFormatArg> 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);
}
}

Loading…
Cancel
Save