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
16 changes: 14 additions & 2 deletions lua/entities/sbep_elev_system/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function ENT:Initialize()
self.SystemTable = {}
self.FloorTable = {}
self.HatchTable = {}
self.LiftSpeed = 1

if self.Usable == nil then
self.Usable = true
Expand Down Expand Up @@ -225,7 +226,8 @@ function ENT:Think()

if self.ATL then return true end

self.Increment = self.Increment + math.Clamp( ( self.TargetOffset - self.Increment) , -0.6 , 0.6 )
-- self.Increment = self.Increment + math.Clamp( ( self.TargetOffset - self.Increment) , -0.6 , 0.6 )
self.Increment = self.Increment + math.Clamp( ( self.TargetOffset - self.Increment) , -0.6 * self.LiftSpeed , 0.6 * self.LiftSpeed )

local D = 100000
local F = 0
Expand Down Expand Up @@ -555,6 +557,7 @@ function ENT:MakeWire( bAdjust ) --Adds the appropriate wire inputs.
table.insert( self.SBEP_WireInputsTable , ( "Floor "..tostring(k) ) )
end
table.insert( self.SBEP_WireInputsTable , ( "Hold" ) )
table.insert( self.SBEP_WireInputsTable , ( "Speed multiplier" ) )
if bAdjust then
self.Inputs = Wire_AdjustInputs(self.Entity, self.SBEP_WireInputsTable )
else
Expand All @@ -565,7 +568,6 @@ function ENT:MakeWire( bAdjust ) --Adds the appropriate wire inputs.
end

function ENT:TriggerInput(k,v)

if k == "FloorNum" then
self:AddCallFloorNum( v )
end
Expand All @@ -578,6 +580,13 @@ function ENT:TriggerInput(k,v)

if k == "Hold" and v > 0 then
self:AddHoldDelay( 4 )
end
if k == "Speed multiplier" then
if v > 0 then
self.LiftSpeed = v
else
self.LiftSpeed = 1
end
end
end

Expand Down Expand Up @@ -615,6 +624,7 @@ function ENT:PreEntityCopy()
DI.SystemTable = self.SystemTable
DI.FloorTable = self.FloorTable
DI.Increment = self.Increment
-- DI.LiftSpeed = self.LiftSpeed
DI.PartTable = {}
for n,Part in pairs( self.PartTable ) do
DI.PartTable[n] = Part:EntIndex()
Expand All @@ -641,6 +651,8 @@ function ENT:PostEntityPaste(pl, Ent, CreatedEntities)
self.SystemTable = DT.SystemTable
self.FloorTable = DT.FloorTable
self.Increment = DT.Increment
-- self.LiftSpeed = DT.LiftSpeed
-- if self.LiftSpeed == nil then self.LiftSpeed = 1 end

for n = 1, #DT.PartTable do
self.PartTable[n] = CreatedEntities[DT.PartTable[n]]
Expand Down
13 changes: 13 additions & 0 deletions lua/weapons/gmod_tool/stools/sbep_lift_designer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ local ConVars = {
editing = 0,
skin = 0,
enableuse = 0,
-- liftspeed = 1,
doors = 0,
size = 1,
type = "M"
Expand Down Expand Up @@ -732,6 +733,7 @@ function TOOL:LeftClick( trace )

LiftSystem_SER[ply].PartTable[ 1 ]:SetRenderMode( RENDERMODE_TRANSCOLOR )
LiftSystem_SER[ply].PartTable[ 1 ]:SetColor( Color( 255 , 255 , 255 , 180 ))
-- LiftSystem_SER[ply].LiftSpeed = ply:GetInfoNum( "sbep_lift_designer_liftspeed", 1 )

ply:ConCommand( "sbep_lift_designer_editing 1" )

Expand Down Expand Up @@ -845,6 +847,17 @@ function TOOL.BuildCPanel(panel)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-- local MainSpeed = vgui.Create( "DNumSlider" )
-- MainSpeed:SetText( "Lift speed" )
-- MainSpeed:SetMin( 1 )
-- MainSpeed:SetMax( 10 )
-- MainSpeed:SetDark( true )
-- MainSpeed:SetDecimals( 0 )
-- MainSpeed:SetConVar( "sbep_lift_designer_liftspeed" )
-- panel:AddItem( MainSpeed )
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

local ResetLabel= vgui.Create("DLabel")
ResetLabel:SetText("This tool is still a prototype. If the tool bugs,\nyou may need to reset it with this button.")
ResetLabel:SetTextColor(Color(0,0,0,255))
Expand Down