Skip to content

Commit

Permalink
Fix Name Color In Chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Deaod committed Apr 10, 2023
1 parent a366641 commit d404f0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Classes/VS_UI_ChatArea.uc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
}
Expand Down
1 change: 1 addition & 0 deletions Classes/VS_UI_ChatMessage.uc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class VS_UI_ChatMessage extends UWindowDynamicTextRow;

var string PlayerName;
var int ColorRef;
var color PlayerColor;

function string LineText() {
Expand Down

0 comments on commit d404f0d

Please sign in to comment.