Skip to content

Commit 07e2888

Browse files
authored
Properly pass draw args through (#3613)
* Properly pass draw args through * Also fix buttons * Satisfy linter
1 parent e1d1683 commit 07e2888

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

lua/entities/gmod_wire_button.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ if CLIENT then
1818
baseclass.Get("gmod_button").UpdateLever(self)
1919
end
2020

21-
function ENT:Draw()
22-
self:DoNormalDraw(true,false)
23-
if LocalPlayer():GetEyeTrace().Entity == self and EyePos():DistToSqr( self:GetPos() ) < 512^2 and GetConVarNumber("wire_drawoutline")~=0 then
21+
local wire_drawoutline = GetConVar("wire_drawoutline")
22+
function ENT:Draw( flags )
23+
self:DoNormalDraw(true,false, flags)
24+
if LocalPlayer():GetEyeTrace().Entity == self and EyePos():DistToSqr( self:GetPos() ) < 512^2 and wire_drawoutline:GetInt()~=0 then
2425
if self:GetOn() then
2526
halo_ent = self
2627
halo_blur = 4 + math.sin(CurTime()*20)*2

lua/entities/gmod_wire_dynamic_button.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ end
1111
if CLIENT then
1212
local halo_ent, halo_blur
1313

14-
function ENT:Draw()
15-
self:DoNormalDraw(true,false)
14+
function ENT:Draw( flags )
15+
self:DoNormalDraw(true,false, flags)
1616
if LocalPlayer():GetEyeTrace().Entity == self and EyePos():Distance( self:GetPos() ) < 512 then
1717
if self:GetOn() then
1818
halo_ent = self

lua/entities/gmod_wire_fx_emitter.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ComboBox_Wire_FX_Emitter_Options = {}
2424

2525
function AddFXEmitterEffect(name, func, nicename)
2626
fx_emitter.fxcount = fx_emitter.fxcount+1
27-
// Maintain a global reference for these effects
27+
-- Maintain a global reference for these effects
2828
ComboBox_Wire_FX_Emitter_Options[name] = fx_emitter.fxcount
2929
if CLIENT then
3030
fx_emitter.Effects[fx_emitter.fxcount] = func
@@ -39,16 +39,16 @@ include( "wire/fx_emitter_default.lua" )
3939
if CLIENT then
4040
ENT.Delay = 0.05
4141

42-
function ENT:Draw()
43-
// Don't draw if we are in camera mode
42+
function ENT:Draw( ... )
43+
-- Don't draw if we are in camera mode
4444
local ply = LocalPlayer()
4545
local wep = ply:GetActiveWeapon()
4646
if ( wep:IsValid() ) then
4747
local weapon_name = wep:GetClass()
4848
if ( weapon_name == "gmod_camera" ) then return end
4949
end
5050

51-
BaseClass.Draw( self )
51+
BaseClass.Draw( self, ... )
5252
end
5353

5454
function ENT:Think()
@@ -59,7 +59,7 @@ if CLIENT then
5959

6060
local Effect = self:GetEffect()
6161

62-
// Missing effect... replace it if possible :/
62+
-- Missing effect... replace it if possible :/
6363
if ( not self.Effects[ Effect ] ) then if ( self.Effects[1] ) then Effect = 1 else return end end
6464

6565
local Angle = self:GetAngles()
@@ -73,13 +73,13 @@ if CLIENT then
7373
local b, e = pcall( self.Effects[Effect], FXPos, Angle )
7474

7575
if (not b) then
76-
// Report the error
76+
-- Report the error
7777
Print(self.Effects)
7878
Print(FXPos)
7979
Print(Angle)
8080
Msg("Error in Emitter "..tostring(Effect).."\n -> "..tostring(e).."\n")
8181

82-
// Remove the naughty function
82+
-- Remove the naughty function
8383
self.Effects[ Effect ] = nil
8484
end
8585
end

0 commit comments

Comments
 (0)