Skip to content

Commit

Permalink
UI: Unified Spec Color (TTT-2#1525)
Browse files Browse the repository at this point in the history
Unified the usage of the new spec color in some places I could find.
There are probably more, but that's it for now. Fixes TTT-2#1481
  • Loading branch information
TimGoll authored May 22, 2024
1 parent b3a0491 commit b9e59f8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- use `net.ReadPlayer` / `net.WritePlayer` if applicable instead of `net.Read|WriteEntity`
- Reduced radar bit size for net message
- The holdtype for pistol weapons now matches the viewmodel
- Unified the spec color usage throughout the whole UI (by @TimGoll)

### Fixed

Expand Down
6 changes: 5 additions & 1 deletion gamemodes/terrortown/gamemode/client/cl_voice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ end
-- @return Color The color of the voice panel
-- @realm client
function VOICE.GetVoiceColor(ply)
if VOICE.GetVoiceMode(ply) == VOICE_MODE_GLOBAL then
local voiceMode = VOICE.GetVoiceMode(ply)

if voiceMode == VOICE_MODE_SPEC then
return COLOR_SPEC
elseif voiceMode == VOICE_MODE_GLOBAL then
return INNOCENT.color
else
return TEAMS[ply:GetTeam()].color
Expand Down
2 changes: 1 addition & 1 deletion gamemodes/terrortown/gamemode/client/vgui/cl_sb_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function PANEL:Init()
self.ply_groups[GROUP_TERROR] = t

t = vgui.Create("TTTScoreGroup", self.ply_frame:GetCanvas())
t:SetGroupInfo(GetTranslation("spectators"), Color(200, 200, 0, 100), GROUP_SPEC)
t:SetGroupInfo(GetTranslation("spectators"), COLOR_SPEC, GROUP_SPEC)
self.ply_groups[GROUP_SPEC] = t

if DetectiveMode() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ if CLIENT then
local mat_tid_ammo = Material("vgui/ttt/tid/tid_ammo")

local color_sprint = Color(36, 154, 198)
local color_defaultgrey = Color(100, 100, 100, 200)
local color_health = Color(234, 41, 41)
local color_ammoBar = Color(238, 151, 0)

Expand Down Expand Up @@ -150,7 +149,7 @@ if CLIENT then
if cactive then
c = client:GetRoleColor()
else
c = color_defaultgrey
c = COLOR_SPEC
end

surface.SetDrawColor(clr(c))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ if CLIENT then
c = tm.color or COLOR_BLACK
else -- player is dead and spectator
icon = material_watching
c = COLOR_WARMGRAY
c = COLOR_SPEC
end

-- draw dark bottom overlay
Expand Down

0 comments on commit b9e59f8

Please sign in to comment.