Skip to content
Merged
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
6 changes: 6 additions & 0 deletions lua/entities/gmod_wire_expression2/core/egpfunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

e2function void wirelink:egpLoadFrame( number index )
if (!EGP:IsAllowed( self, this )) then return end
if (!index) then return end

Check warning on line 62 in lua/entities/gmod_wire_expression2/core/egpfunctions.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'not' and '!'
local bool, frame = EGP:LoadFrame( self.player, nil, tostring(index) )
if (bool) then
if (EGP:IsDifferent( this.RenderTable, frame )) then
Expand All @@ -74,7 +74,7 @@
--------------------------------------------------------

e2function void wirelink:egpOrder(number index, number order)
if not isAllowed(nil, self, this) then return end

Check warning on line 77 in lua/entities/gmod_wire_expression2/core/egpfunctions.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'not' and '!'
local bool, k, v = hasObject(this, index)
if bool then
if EGP.SetOrder(this, k, order) then
Expand Down Expand Up @@ -107,7 +107,7 @@
end

e2function void wirelink:egpOrderBelow( number index, number belowthis )
if not isAllowed(nil, self, this) then return end

Check warning on line 110 in lua/entities/gmod_wire_expression2/core/egpfunctions.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '!' and 'not'
local bool, k, v = hasObject(this, index)
if bool then
if hasObject(this, belowthis) then
Expand All @@ -125,7 +125,7 @@
-- Box
--------------------------------------------------------
e2function egpobject wirelink:egpBox( number index, vector2 pos, vector2 size )
if (!EGP:IsAllowed( self, this )) then return NULL_EGPOBJECT end

Check warning on line 128 in lua/entities/gmod_wire_expression2/core/egpfunctions.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '!' and 'not'
local bool, obj = egp_create("Box", { index = index, w = size[1], h = size[2], x = pos[1], y = pos[2] }, this)
if (bool) then EGP:DoAction( this, self, "SendObject", obj ) Update(self,this) end
return obj
Expand Down Expand Up @@ -153,7 +153,7 @@

e2function void wirelink:egpRadius( number index, number radius )
if (!EGP:IsAllowed( self, this )) then return NULL_EGPOBJECT end
local bool, k, v = hasObject(this, index)

Check warning on line 156 in lua/entities/gmod_wire_expression2/core/egpfunctions.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: k
if (bool) then
if v:EditObject({ radius = radius }) then EGP:DoAction( this, self, "SendObject", v ) Update(self,this) end
end
Expand Down Expand Up @@ -198,7 +198,7 @@
e2function void wirelink:egpSetText( number index, string text )
if (!EGP:IsAllowed( self, this )) then return end
if #text>EGP_TEXT_LIMIT then text = string.sub(text, 1, EGP_TEXT_LIMIT) end
local bool, k, v = hasObject(this, index)

Check warning on line 201 in lua/entities/gmod_wire_expression2/core/egpfunctions.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: k
if (bool) then
if v:EditObject({ text = text }) then EGP:DoAction( this, self, "SendObject", v ) Update(self,this) end
end
Expand All @@ -209,7 +209,7 @@
----------------------------
e2function void wirelink:egpAlign( number index, number halign )
if (!EGP:IsAllowed( self, this )) then return end
local bool, k, v = hasObject(this, index)

Check warning on line 212 in lua/entities/gmod_wire_expression2/core/egpfunctions.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: k
if (bool) then
if v:EditObject({ halign = math.Clamp(halign,0,2) }) then EGP:DoAction( this, self, "SendObject", v ) Update(self,this) end
end
Expand All @@ -217,7 +217,7 @@

e2function void wirelink:egpAlign( number index, number halign, number valign )
if (!EGP:IsAllowed( self, this )) then return end
local bool, k, v = hasObject(this, index)

Check warning on line 220 in lua/entities/gmod_wire_expression2/core/egpfunctions.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: k
if (bool) then
if v:EditObject({ valign = math.Clamp(valign,0,2), halign = math.Clamp(halign,0,2) }) then EGP:DoAction( this, self, "SendObject", v ) Update(self,this) end
end
Expand All @@ -228,7 +228,7 @@
----------------------------
e2function void wirelink:egpFiltering( number index, number filtering )
if (!EGP:IsAllowed( self, this )) then return end
local bool, k, v = hasObject(this, index)

Check warning on line 231 in lua/entities/gmod_wire_expression2/core/egpfunctions.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: k
if (bool) then
if v:EditObject({ filtering = math.Clamp(filtering,0,3) }) then EGP:DoAction( this, self, "SendObject", v ) Update(self,this) end
end
Expand Down Expand Up @@ -259,7 +259,7 @@
end

e2function void wirelink:egpFont( number index, string font )
if (!EGP:IsAllowed( self, this )) then return end

Check warning on line 262 in lua/entities/gmod_wire_expression2/core/egpfunctions.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'not' and '!'
if #font > 30 then return self:throw("Font string is too long!", nil) end
if not canCreateFont( self.player, font ) then return self:throw("You have reached the maximum amount of fonts!", nil) end

Expand Down Expand Up @@ -1158,6 +1158,7 @@
antispam[self.player] = CurTime() + 0.1

timer.Simple(0, function()
if not EGP:ValidEGP(this) then return end
EGP.EGPHudConnect(this, not (this.Users ~= nil and this.Users[self.player] ~= nil), self.player)
end)
end
Expand All @@ -1168,10 +1169,15 @@
antispam[self.player] = CurTime() + 0.1

timer.Simple(0, function()
if not EGP:ValidEGP(this) then return end
EGP.EGPHudConnect(this, enable ~= 0, self.player)
end)
end

registerCallback("destruct", function(self)
antispam[self.player] = nil
end)

e2function array wirelink:egpConnectedUsers()
if not EGP:ValidEGP(this) then return self:throw("Invalid wirelink!", {}) end
if not this.Users then return {} end
Expand Down
Loading