Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Commit

Permalink
Add the player voice chat volume setting on the scoreboard
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyFrenzy committed Jun 10, 2021
1 parent 105ec78 commit bf4a914
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gamemodes/superpedobear/gamemode/cl_scoreboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@ local PLAYER_LINE = {
end

self.Mute.DoClick = function() self.Player:SetMuted(!self.Muted) end
self.Mute.OnMouseWheeled = function(s, delta)
self.Player:SetVoiceVolumeScale(self.Player:GetVoiceVolumeScale() + (delta / 100 * 5))
s.LastTick = CurTime()
end

self.Mute.PaintOver = function(s, w, h)
local a = 255 - math.Clamp(CurTime() - (s.LastTick or 0), 0, 3) * 255
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

end

Expand Down

0 comments on commit bf4a914

Please sign in to comment.