From d404f0d057ad0e14dbbc14dd53a82422bbbac628 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 10 Apr 2023 12:11:31 +0200 Subject: [PATCH] Fix Name Color In Chat --- Classes/VS_UI_ChatArea.uc | 8 +++++++- Classes/VS_UI_ChatMessage.uc | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Classes/VS_UI_ChatArea.uc b/Classes/VS_UI_ChatArea.uc index 890b56c..18c9547 100644 --- a/Classes/VS_UI_ChatArea.uc +++ b/Classes/VS_UI_ChatArea.uc @@ -167,7 +167,11 @@ function float DrawTextLine2(Canvas C, UWindowDynamicTextRow L, float Y, float W TextAreaClipText(C, X, Y, M.LineText()); if (M.PlayerName != "") { - C.DrawColor = M.PlayerColor; + if(M.ColorRef == 0) { + C.DrawColor = M.PlayerColor; + } else if (M.ColorRef == 1) { + C.DrawColor = Theme.Foreground; + } TextAreaClipText(C, X, Y, M.PlayerName); C.DrawColor = Theme.Foreground; } @@ -193,8 +197,10 @@ function AddChat(PlayerReplicationInfo PRI, string Message) { PRI.Team < 4 && Len(PRI.TeamName) > 0 ) { + M.ColorRef = 0; M.PlayerColor = class'ChallengeTeamHUD'.default.TeamColor[PRI.Team]; } else { + M.ColorRef = 1; M.PlayerColor = Theme.Foreground; } } diff --git a/Classes/VS_UI_ChatMessage.uc b/Classes/VS_UI_ChatMessage.uc index 174a7cd..2546d1e 100644 --- a/Classes/VS_UI_ChatMessage.uc +++ b/Classes/VS_UI_ChatMessage.uc @@ -1,6 +1,7 @@ class VS_UI_ChatMessage extends UWindowDynamicTextRow; var string PlayerName; +var int ColorRef; var color PlayerColor; function string LineText() {