Merge pull request #9256 from SollyBunny/fix_colors_on_repeated_client_msg

Fix colors on repeated client msg
This commit is contained in:
Dennis Felsing 2024-11-16 18:40:22 +00:00 committed by GitHub
commit 95d6d99aff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1094,22 +1094,20 @@ void CChat::OnPrepareLines(float y)
TextRender()->CreateOrAppendTextContainer(Line.m_TextContainerIndex, &Cursor, ": "); TextRender()->CreateOrAppendTextContainer(Line.m_TextContainerIndex, &Cursor, ": ");
} }
// Only apply msg color if no custom color is set ColorRGBA Color;
if(!Line.m_CustomColor) if(Line.m_CustomColor)
{ Color = *Line.m_CustomColor;
ColorRGBA Color; else if(Line.m_ClientId == SERVER_MSG)
if(Line.m_ClientId == SERVER_MSG) Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageSystemColor));
Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageSystemColor)); else if(Line.m_ClientId == CLIENT_MSG)
else if(Line.m_ClientId == CLIENT_MSG) Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageClientColor));
Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageClientColor)); else if(Line.m_Highlighted)
else if(Line.m_Highlighted) Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageHighlightColor));
Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageHighlightColor)); else if(Line.m_Team)
else if(Line.m_Team) Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageTeamColor));
Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageTeamColor)); else // regular message
else // regular message Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageColor));
Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageColor)); TextRender()->TextColor(Color);
TextRender()->TextColor(Color);
}
CTextCursor AppendCursor = Cursor; CTextCursor AppendCursor = Cursor;
AppendCursor.m_LongestLineWidth = 0.0f; AppendCursor.m_LongestLineWidth = 0.0f;