From 1361a4476f7ab79acaff58837751a271f67e976f Mon Sep 17 00:00:00 2001 From: SollyBunny Date: Sat, 16 Nov 2024 17:25:10 +0000 Subject: [PATCH] Fix colors on repeated client msg --- src/game/client/components/chat.cpp | 30 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 9f03db458..a011bbb85 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -1094,22 +1094,20 @@ void CChat::OnPrepareLines(float y) TextRender()->CreateOrAppendTextContainer(Line.m_TextContainerIndex, &Cursor, ": "); } - // Only apply msg color if no custom color is set - if(!Line.m_CustomColor) - { - ColorRGBA Color; - if(Line.m_ClientId == SERVER_MSG) - Color = color_cast(ColorHSLA(g_Config.m_ClMessageSystemColor)); - else if(Line.m_ClientId == CLIENT_MSG) - Color = color_cast(ColorHSLA(g_Config.m_ClMessageClientColor)); - else if(Line.m_Highlighted) - Color = color_cast(ColorHSLA(g_Config.m_ClMessageHighlightColor)); - else if(Line.m_Team) - Color = color_cast(ColorHSLA(g_Config.m_ClMessageTeamColor)); - else // regular message - Color = color_cast(ColorHSLA(g_Config.m_ClMessageColor)); - TextRender()->TextColor(Color); - } + ColorRGBA Color; + if(Line.m_CustomColor) + Color = *Line.m_CustomColor; + else if(Line.m_ClientId == SERVER_MSG) + Color = color_cast(ColorHSLA(g_Config.m_ClMessageSystemColor)); + else if(Line.m_ClientId == CLIENT_MSG) + Color = color_cast(ColorHSLA(g_Config.m_ClMessageClientColor)); + else if(Line.m_Highlighted) + Color = color_cast(ColorHSLA(g_Config.m_ClMessageHighlightColor)); + else if(Line.m_Team) + Color = color_cast(ColorHSLA(g_Config.m_ClMessageTeamColor)); + else // regular message + Color = color_cast(ColorHSLA(g_Config.m_ClMessageColor)); + TextRender()->TextColor(Color); CTextCursor AppendCursor = Cursor; AppendCursor.m_LongestLineWidth = 0.0f;