Skip to content

Commit

Permalink
Minor fix on player volume
Browse files Browse the repository at this point in the history
  • Loading branch information
CattoGamer committed Aug 29, 2024
1 parent 0740904 commit 577199c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function PLAYER:UpdatePlayer()
self.Name:SetText( self.Player:Name() )
self.Location:SetText( string.upper( self.Player:GetLocationName() or "Unknown" ) )

--[[
--[[
Info: Code taken from 'base' gamemode
Desc: Change the icon of the mute button based on state
--]]
Expand All @@ -206,9 +206,11 @@ function PLAYER:UpdatePlayer()
end

self.Mute.PaintOver = function( s, w, h )
if not IsValid(self.Player) then return end
if ( not IsValid( self.Player ) ) then return end

local a = 255 - math.Clamp( CurTime() - ( s.LastTick or 0 ), 0, 3 ) * 255
if ( a <= 0 ) then return end

draw.RoundedBox( 4, 0, 0, w, h, Color( 0, 0, 0, a * 0.75 ) )
draw.SimpleText( math.ceil( self.Player:GetVoiceVolumeScale() * 100 ) .. "%", "DermaDefaultBold", w / 2, h / 2, Color( 255, 255, 255, a ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
end
Expand Down

0 comments on commit 577199c

Please sign in to comment.