diff --git a/lua/entities/sbep_elev_system/init.lua b/lua/entities/sbep_elev_system/init.lua index ab2aa945..ece64e24 100644 --- a/lua/entities/sbep_elev_system/init.lua +++ b/lua/entities/sbep_elev_system/init.lua @@ -29,6 +29,7 @@ function ENT:Initialize() self.SystemTable = {} self.FloorTable = {} self.HatchTable = {} + self.LiftSpeed = 1 if self.Usable == nil then self.Usable = true @@ -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 @@ -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 @@ -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 @@ -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 @@ -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() @@ -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]] diff --git a/lua/weapons/gmod_tool/stools/sbep_lift_designer.lua b/lua/weapons/gmod_tool/stools/sbep_lift_designer.lua index 7eb9f67a..ce596178 100644 --- a/lua/weapons/gmod_tool/stools/sbep_lift_designer.lua +++ b/lua/weapons/gmod_tool/stools/sbep_lift_designer.lua @@ -35,6 +35,7 @@ local ConVars = { editing = 0, skin = 0, enableuse = 0, + -- liftspeed = 1, doors = 0, size = 1, type = "M" @@ -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" ) @@ -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))