Skip to content
Open
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
24 changes: 13 additions & 11 deletions lua/entities/base_wire_entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ if CLIENT then
self.PlayerWasLookingAtMe = false
end

function ENT:Draw()
function ENT:Draw(flags)
local entsTbl = EntityMeta.GetTable( self )
entsTbl.DoNormalDraw( self )
entsTbl.DoNormalDraw( self, nil, nil, flags )
Wire_Render(self)
if entsTbl.GetBeamLength and (not entsTbl.GetShowBeam or entsTbl.GetShowBeam( self )) then
-- Every SENT that has GetBeamLength should draw a tracer. Some of them have the GetShowBeam boolean
Expand Down Expand Up @@ -270,15 +270,17 @@ if CLIENT then
end
end)

function ENT:DoNormalDraw(nohalo, notip)
if not nohalo and wire_drawoutline:GetBool() and looked_at == self then
self:DrawEntityOutline()
self:DrawModel()
else
self:DrawModel()
end
if not notip and looked_at == self then
self:AddWorldTip()
function ENT:DoNormalDraw(nohalo, notip, flags)
self:DrawModel(flags)

if looked_at == self then
if not nohalo and wire_drawoutline:GetBool() then
self:DrawEntityOutline()
end

if not notip then
self:AddWorldTip()
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
baseclass.Get("gmod_button").UpdateLever(self)
end

function ENT:Draw()
self:DoNormalDraw(true,false)
function ENT:Draw(flags)
self:DoNormalDraw(true,false,flags)
if LocalPlayer():GetEyeTrace().Entity == self and EyePos():DistToSqr( self:GetPos() ) < 512^2 and GetConVarNumber("wire_drawoutline")~=0 then

Check warning on line 23 in lua/entities/gmod_wire_button.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
if self:GetOn() then
halo_ent = self
halo_blur = 4 + math.sin(CurTime()*20)*2
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_characterlcd/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ function ENT:DrawSpecialCharacter(c,x,y,w,h,r,g,b)
end

local VECTOR_1_1_1 = Vector(1, 1, 1)
function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)

local tone = render.GetToneMappingScaleLinear()
render.SetToneMappingScaleLinear(VECTOR_1_1_1)
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_consolescreen/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ function ENT:DrawSpecialCharacter(c,x,y,w,h,r,g,b)
end

local VECTOR_1_1_1 = Vector(1, 1, 1)
function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)

local tone = render.GetToneMappingScaleLinear()
render.SetToneMappingScaleLinear(VECTOR_1_1_1)
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_digitalscreen/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ function ENT:RedrawRow(y)
end

local VECTOR_1_1_1 = Vector(1, 1, 1)
function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)

local tone = render.GetToneMappingScaleLinear()
render.SetToneMappingScaleLinear(VECTOR_1_1_1)
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_dynamic_button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ end
if CLIENT then
local halo_ent, halo_blur

function ENT:Draw()
self:DoNormalDraw(true,false)
function ENT:Draw(flags)
self:DoNormalDraw(true,false,flags)
if LocalPlayer():GetEyeTrace().Entity == self and EyePos():Distance( self:GetPos() ) < 512 then
if self:GetOn() then
halo_ent = self
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_egp/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ end
function ENT:DrawEntityOutline() end

local VECTOR_1_1_1 = Vector(1, 1, 1)
function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)
Wire_Render(self)

local tone = render.GetToneMappingScaleLinear()
Expand Down
6 changes: 3 additions & 3 deletions lua/entities/gmod_wire_egp_emitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ if CLIENT then
end
end

function ENT:Draw()
function ENT:Draw(flags)
if self.GPU then -- if we're rendering on RT, use base EGP's draw function instead
BaseClass.Draw(self)
BaseClass.Draw(self, flags)
else
self:DrawModel()
self:DrawModel(flags)
self:DrawNoRT()
Wire_Render(self)
end
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_egp_hud/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function ENT:EGP_Update() end

function ENT:DrawEntityOutline() end

function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)
Wire_Render(self)
end
8 changes: 4 additions & 4 deletions lua/entities/gmod_wire_gpu/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
self.VM.QuotaOverrunFunc = self.VM.SyncQuotaOverrun
self.VM.ASYNC = 0
end
local function getCode(self)

Check warning on line 175 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: getCode
local mem = {}
for i=0,16 do
mem[i] = self.VM:ReadCell(i)
Expand Down Expand Up @@ -242,7 +242,7 @@
if self.VM.VertexMode == 0 then self.VM.RenderEnable = 0 end
else
-- Remember screen RT if this is the first switch
local noRT = true

Check warning on line 245 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: noRT
if not self.ScreenRTSet then
self.ScreenRT = render.GetRenderTarget()
self.ScreenRTWidth = ScrW()
Expand Down Expand Up @@ -366,15 +366,15 @@
local VECTOR_1_1_1 = Vector(1, 1, 1)
--------------------------------------------------------------------------------
-- Entity drawing function
function ENT:Draw()
function ENT:Draw(flags)
-- Calculate time-related variables
self.CurrentTime = CurTime()
self.DeltaTime = math.min(1/30,self.CurrentTime - (self.PreviousTime or 0))
self.PreviousTime = self.CurrentTime

-- Draw GPU itself
self:DrawModel()
self:DrawModel(flags)

local tone = render.GetToneMappingScaleLinear()
render.SetToneMappingScaleLinear(VECTOR_1_1_1)

Expand Down Expand Up @@ -441,8 +441,8 @@

local h = width and width*monitor.RatioX or height or 1024
local w = width or h/monitor.RatioX
local x = -w/2

Check warning on line 444 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: x
local y = -h/2

Check warning on line 445 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: y

local res = monitor.RS*1024/h
self.VertexCamSettings = { pos, ang, res }
Expand All @@ -458,7 +458,7 @@
end
end
end

render.SetToneMappingScaleLinear(tone)
Wire_Render(self)
end
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_graphics_tablet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

ENT.workingDistance = 64

local SCREEN_CURSOR = false -- (0, 0) is top left, (1, 1) is bottom right

Check warning on line 10 in lua/entities/gmod_wire_graphics_tablet.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: SCREEN_CURSOR
local GRAPH_CURSOR = true -- (0, 0) is center, (1, 1) is top right

function ENT:SetupDataTables()
Expand All @@ -33,10 +33,10 @@
return x,y,w,h
end

function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)

local draw_background = self:GetDrawBackground()

Check warning on line 39 in lua/entities/gmod_wire_graphics_tablet.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use :GetPaintBackground instead
self.GPU:RenderToWorld(nil, 512, function(x, y, w, h, monitor, pos, ang, res)
if draw_background then
surface.SetDrawColor(0, 0, 0, 255)
Expand Down Expand Up @@ -111,8 +111,8 @@
local pos = GPUEntity:LocalToWorld(monitor.offset)
local h = 1024
local w = h/monitor.RatioX
local x = -w/2

Check warning on line 114 in lua/entities/gmod_wire_graphics_tablet.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: x
local y = -h/2

Check warning on line 115 in lua/entities/gmod_wire_graphics_tablet.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: y

for _,ply in player.Iterator() do
local trace = ply:GetEyeTraceNoCursor()
Expand Down Expand Up @@ -176,7 +176,7 @@
-- only needed for legacy dupes
function ENT:Setup(gmode, draw_background)
if gmode ~= nil then self:SetCursorMode(gmode) end
if draw_background ~= nil then self:SetDrawBackground(draw_background) end

Check warning on line 179 in lua/entities/gmod_wire_graphics_tablet.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use :SetPaintBackground instead
end

duplicator.RegisterEntityClass("gmod_wire_graphics_tablet", WireLib.MakeWireEnt, "Data", "gmode", "draw_background")
6 changes: 3 additions & 3 deletions lua/entities/gmod_wire_hologram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ if CLIENT then
render.EnableClipping(selfTbl.oldClipState)
end

function ENT:Draw()
function ENT:Draw(flags)
local selfTbl = EntityMeta.GetTable(self)
if selfTbl.blocked or selfTbl.notvisible then return end

Expand All @@ -132,10 +132,10 @@ if CLIENT then

if selfTbl.GetDisableShading(self) then
render.SuppressEngineLighting(true)
EntityMeta.DrawModel(self)
EntityMeta.DrawModel(self, flags)
render.SuppressEngineLighting(false)
else
EntityMeta.DrawModel(self)
EntityMeta.DrawModel(self, flags)
end

if invert_model then
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_keypad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ if CLIENT then
local color_red = Color(255, 0, 0)
local color_green = Color(0, 255, 0)

function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)

local entpos = self:GetPos()
if entpos:Distance(EyePos()) > 512 then return end
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_oscilloscope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ if CLIENT then
end
end)

function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)

local length = self:GetNWFloat("Length", 50)
local r,g,b = self:GetNWFloat("R"), self:GetNWFloat("G"), self:GetNWFloat("B")
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_pixel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ ENT.PrintName = "Wire Pixel"
ENT.WireDebugName = "Pixel"

if CLIENT then
function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)
end

return -- No more client
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_rt_screen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ if CLIENT then
cam.End3D2D()
end

function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)

if self.MonitorDesc == nil then
return
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_screen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ if CLIENT then
surface.DrawText( value )
end

function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)

self.GPU:RenderToWorld(nil, 188, function(x, y, w, h)
surface.SetDrawColor(0, 0, 0, 255)
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_textscreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ if CLIENT then
if fullUpdate then return end
self.GPU:Finalize()
end
function ENT:Draw()
self:DrawModel()
function ENT:Draw(flags)
self:DrawModel(flags)

if self.NeedRefresh then
self.NeedRefresh = nil
Expand Down
6 changes: 3 additions & 3 deletions lua/weapons/laserpointer/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ function SWEP:PostDrawViewModel(vm, wep, ply)
end
end

function SWEP:DrawWorldModel()
self:DrawModel()
function SWEP:DrawWorldModel(flags)
self:DrawModel(flags)

if self:GetLaserEnabled() then
local att = self:GetAttachment(self:LookupAttachment("muzzle") or 0)
Expand All @@ -54,4 +54,4 @@ function SWEP:DrawWorldModel()
render.SetMaterial(laser)
render.DrawBeam(startpos, endpos, 2, 0, 12.5, color_red)
end
end
end
Loading