Skip to content

Commit

Permalink
Get color from ULX rank
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonsturgeon committed Sep 21, 2023
1 parent 1ed59e8 commit 9aeae61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion moon/cfc_chat_transit/server/avatar_service.moon
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AvatarService
outlineAvatar: (ply, data) =>
@logger\debug "Received request to outline avatar for ply: #{ply\Nick!}"
avatar = data.response.players[1].avatarfull
outlineColor = ChatTransit\GetTeamColor ply\Team!
outlineColor = ChatTransit\GetRankColor ply
steamID64 = ply\SteamID64!

@processAvatar avatar, outlineColor, steamID64
Expand Down
10 changes: 4 additions & 6 deletions moon/cfc_chat_transit/server/init.moon
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ ChatTransit.Send = (data) =>

@WebSocket\write TableToJSON data

ChatTransit.TeamColorCache = {}
ChatTransit.GetTeamColor = (teamName) =>
return @TeamColorCache[teamName] if @TeamColorCache[teamName]
ChatTransit.GetRankColor = (ply) =>
groupName = ULib.ucl.users[ply\SteamID!].group
team = ULib.ucl.groups[groupName].team

teamColor = tostring GetColor teamName

@TeamColorCache[teamName] = teamColor
teamColor = "#{team.color_red} #{team.color_green} #{team.color_blue} 255"

teamColor

Expand Down

0 comments on commit 9aeae61

Please sign in to comment.