Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1768,8 +1768,8 @@ function SKIN:PaintRoleImageTTT2(panel, w, h)
drawFilteredShadowedTexture(
widthBorder,
widthBorder,
sizeIconRole - widthBorder2,
sizeIconRole - widthBorder2,
sizeIconRole,
sizeIconRole,
panel:GetMaterial(),
colorIcon.a,
colorIcon
Expand All @@ -1778,8 +1778,8 @@ function SKIN:PaintRoleImageTTT2(panel, w, h)
drawFilteredTexture(
widthBorder,
widthBorder,
sizeIconRole - widthBorder2,
sizeIconRole - widthBorder2,
sizeIconRole,
sizeIconRole,
panel:GetMaterial(),
colorIcon.a * 0.5,
colorIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ function PANEL:SetConVar(cvar)
return
end

self:SetDefaultValue(tobool(GetConVar(cvar):GetDefault()))
self.convar = GetConVar(cvar)

self:SetDefaultValue(tobool(self.convar:GetDefault()))
self:SetValue(self.convar:GetBool())
end

local callbackEnabledVarTracker = 0
Expand Down Expand Up @@ -217,7 +220,9 @@ function PANEL:ValueChanged(val)
val = not val
end

if self.serverConVar and not self:GetIgnoreCallbackEnabledVar() then
if self.convar then
self.convar:SetBool(val)
elseif self.serverConVar and not self:GetIgnoreCallbackEnabledVar() then
cvars.ChangeServerConVar(self.serverConVar, val and "1" or "0")
elseif self.databaseInfo and not self:GetIgnoreCallbackEnabledVar() then
database.SetValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function PANEL:InitRoles(layeredRoles)
ic:SetTooltip(roleData.name)
ic:SetTooltipFixedPosition(0, 64)
ic:SetServerConVar("ttt_" .. roleData.name .. "_enabled")
ic:EnableIndicator(true)
ic:SetIsActiveIndicator(true)

ic.subrole = subrole

Expand Down
Loading