2007-02-04 01:16:06 +00:00
|
|
|
|
|
|
|
AddCSLuaFile( "cl_init.lua" )
|
|
|
|
AddCSLuaFile( "shared.lua" )
|
|
|
|
|
|
|
|
include('shared.lua')
|
|
|
|
|
|
|
|
ENT.WireDebugName = "Value"
|
|
|
|
ENT.OverlayDelay = 0
|
|
|
|
|
|
|
|
function ENT:Initialize()
|
|
|
|
self.Entity:PhysicsInit( SOLID_VPHYSICS )
|
|
|
|
self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
|
|
|
|
self.Entity:SetSolid( SOLID_VPHYSICS )
|
|
|
|
|
|
|
|
self.Outputs = Wire_CreateOutputs(self.Entity, { "Out" })
|
|
|
|
end
|
|
|
|
|
|
|
|
function ENT:Setup(value)
|
2007-04-06 19:38:17 +00:00
|
|
|
|
|
|
|
if type(value) != "table" then
|
|
|
|
local v = value
|
|
|
|
value = {}
|
|
|
|
value[1] = tostring(v)
|
|
|
|
end
|
|
|
|
|
|
|
|
self.value = value
|
|
|
|
//this is where storing the values as strings comes in
|
|
|
|
Wire_AdjustOutputs(self.Entity, value)
|
|
|
|
|
|
|
|
local txt = ""
|
|
|
|
|
|
|
|
for k,v in pairs(value) do
|
|
|
|
//line break after 4 values
|
|
|
|
if (k == 5) or (k == 9) then txt = txt.."\n" end
|
|
|
|
txt = txt .. v
|
|
|
|
if (k < #value) then txt = txt .. ", " end
|
|
|
|
Wire_TriggerOutput(self.Entity, v, tonumber(v))
|
|
|
|
end
|
|
|
|
|
|
|
|
self:SetOverlayText(txt)
|
|
|
|
|
2007-02-04 01:16:06 +00:00
|
|
|
end
|