Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
E2Helper.Descriptions["primitiveGetVars(e)"] = "Reads primitive shape variables"
E2Helper.Descriptions["primitiveEdit(es...)"] = "Edits a primitive shape entity"
11 changes: 1 addition & 10 deletions lua/entities/gmod_wire_expression2/core/custom/primitive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ E2Lib.RegisterExtension( "primitive", false, "Allows the manipulation of primiti

local ANTISPAM_UPDATE_DELAY = 0.5


--
local function isValidPrimitive( self, ent )
if not IsValid( ent ) or not scripted_ents.IsBasedOn( ent:GetClass(), "primitive_base" ) then
return false
Expand All @@ -13,7 +11,6 @@ local function isValidPrimitive( self, ent )
return true
end


local function antispam( ent, key )
if not ent.E2PrimitiveAntispam then
ent.E2PrimitiveAntispam = {}
Expand All @@ -36,7 +33,6 @@ local function antispam( ent, key )
return true
end


local e2type = {}
e2type.Vector = function( val )
local a = val[1]
Expand Down Expand Up @@ -73,19 +69,14 @@ local function editVariable( ply, ent, key, val )
hook.Run( "VariableEdited", ent, ply, key, tostring( val ), editor )
end


--
__e2setcost( 15 )

e2function void primitiveEdit( entity ent, string key, ... )
e2function void primitiveEdit( entity ent, string key, ...args )
if not isValidPrimitive( self, ent ) then return end

local args = { ... }
editVariable( self.player, ent, key, args[1] )
end


--
__e2setcost( 30 )

local e2table = { string = "s", number = "n", boolean = "n" }
Expand Down