forked from CFC-Servers/cfc_chat_transit
Get color from ULX rank
This commit is contained in:
parent
1ed59e8b93
commit
9aeae61d63
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user