More cleanup

This commit is contained in:
Xerasin 2022-05-15 20:46:58 -07:00
parent 15141f179e
commit 467cf9ab25
2 changed files with 5 additions and 8 deletions

View File

@ -26,7 +26,7 @@ end
if CLIENT then
wowozela.Samplers = wowozela.Samplers or {}
wowozela.Samplers = {}
wowozela.volume = CreateClientConVar("wowozela_volume", "0.5", true, false)
wowozela.hudtext = CreateClientConVar("wowozela_hudtext", "1", true, false)
wowozela.pitchbar = CreateClientConVar("wowozela_pitchbar", "1", true, false)
@ -314,8 +314,6 @@ if CLIENT then -- sample meta
META.__index = META
function META:Initialize(ply)
ply.wowozela_sampler = self
self.Player = NULL
self.Pitch = 100
@ -723,14 +721,13 @@ if CLIENT then -- sample meta
local sampler = setmetatable({}, wowozela.SamplerMeta)
sampler:Initialize(ply)
ply.wowozela_sampler = sampler
wowozela.Samplers[ply:AccountID() or ply:UserID()] = sampler
wowozela.Samplers[ply:UserID()] = sampler
return sampler
end
function wowozela.GetSampler(ply)
return ply.wowozela_sampler
return wowozela.Samplers[ply:UserID()]
end
end
@ -798,7 +795,7 @@ do -- hooks
wowozela.disabled = vol < 0.01
for _, ply in ipairs(player.GetHumans()) do
if not ply.wowozela_sampler then
if not wowozela.Samplers[ply:UserID()] then
wowozela.CreateSampler(ply)
end
end

View File

@ -988,7 +988,7 @@ if CLIENT then
surface.SetDrawColor(Color(0, 255, 55, 120))
surface.DrawLine(ScrW() - 18, center_y, ScrW(), center_y)
draw.TextShadow({
text = ("%0.01f"):format(curr_pitch),
text = ("%0.1f"):format(curr_pitch),
color = Color(255, 255, 255, 255),
pos = {ScrW() - 19, center_y},
xalign = TEXT_ALIGN_RIGHT,