mirror of
https://github.com/shadowscion/TankTrackTool.git
synced 2025-03-04 03:03:06 -05:00
remove strut for now
This commit is contained in:
parent
eff1d496ac
commit
068030d50c
@ -65,7 +65,7 @@ local validClasses = {
|
||||
sent_point_beam = true,
|
||||
sent_suspension_shock = true,
|
||||
sent_suspension_spring = true,
|
||||
sent_suspension_mstrut = true,
|
||||
--sent_suspension_mstrut = true,
|
||||
}
|
||||
|
||||
local isOwner = E2Lib.isOwner
|
||||
@ -222,6 +222,7 @@ quicklink.sent_suspension_spring = {
|
||||
end
|
||||
}
|
||||
|
||||
--[[
|
||||
quicklink.sent_suspension_mstrut = {
|
||||
get = function()
|
||||
return { "Chassis (entity)", "LeftWheel (entity)", "RightWheel (entity)" }
|
||||
@ -242,6 +243,7 @@ quicklink.sent_suspension_mstrut = {
|
||||
return this:netvar_setLinks( { Chassis = E2Table.s.Chassis, LeftWheel = E2Table.s.LeftWheel, RightWheel = E2Table.s.RightWheel }, self.player )
|
||||
end
|
||||
}
|
||||
]]
|
||||
|
||||
__e2setcost( 100 )
|
||||
e2function void entity:tanktracktoolSetLinks( table links )
|
||||
|
@ -1,555 +0,0 @@
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
DEFINE_BASECLASS( "base_tanktracktool" )
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminOnly = false
|
||||
ENT.Category = "tanktracktool"
|
||||
|
||||
local tanktracktool = tanktracktool
|
||||
|
||||
--[[
|
||||
wiremod & tool_link setup
|
||||
]]
|
||||
if CLIENT then
|
||||
tanktracktool.netvar.addToolLink( ENT, "Chassis", nil, nil )
|
||||
tanktracktool.netvar.addToolLink( ENT, "LeftWheel", nil, nil )
|
||||
tanktracktool.netvar.addToolLink( ENT, "RightWheel", nil, nil )
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
function ENT:netvar_setLinks( tbl, ply )
|
||||
if not istable( tbl ) then
|
||||
return tanktracktool.netvar.setLinks( self, {}, ply )
|
||||
end
|
||||
|
||||
tbl = {
|
||||
Chassis = isentity( tbl.Chassis ) and tbl.Chassis or nil,
|
||||
LeftWheel = isentity( tbl.LeftWheel ) and tbl.LeftWheel or nil,
|
||||
RightWheel = isentity( tbl.RightWheel ) and tbl.RightWheel or nil,
|
||||
}
|
||||
|
||||
return tanktracktool.netvar.setLinks( self, tbl, ply )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--[[
|
||||
netvar setup
|
||||
]]
|
||||
local netvar = tanktracktool.netvar.new()
|
||||
|
||||
function ENT:netvar_setup()
|
||||
return netvar
|
||||
end
|
||||
|
||||
netvar:category( "Contraption Parameters" )
|
||||
|
||||
netvar:subcategory( "chassis axis" )
|
||||
netvar:var( "matrixrx", "Bool", { def = 0, title = "rotate forward" } )
|
||||
netvar:var( "matrixix", "Bool", { def = 0, title = "invert forward" } )
|
||||
netvar:var( "matrixiz", "Bool", { def = 0, title = "invert up" } )
|
||||
|
||||
netvar:subcategory( nil )
|
||||
netvar:var( "wheelrad", "Float", { def = 15, min = 0, max = 1000, title = "wheel radius" } )
|
||||
netvar:var( "wheelfwd", "Float", { def = 0, min = -1000, max = 1000, title = "wheel position (x)" } )
|
||||
|
||||
|
||||
netvar:category( "Linkages" )
|
||||
netvar:var( "scale", "Float", { def = 1, min = 0, max = 50, title = "model scale" } )
|
||||
netvar:var( "spindleri", "Float", { def = 0, min = -1, max = 1, title = "spindle position (y)" } )
|
||||
netvar:var( "pivotri", "Float", { def = 15, min = -1000, max = 1000, title = "pivot position (y)" } )
|
||||
netvar:var( "pivotup", "Float", { def = -10, min = -1000, max = 1000, title = "pivot position (z)" } )
|
||||
|
||||
|
||||
netvar:subcategory( "Colors" )
|
||||
netvar:var( "spindlecolor", "Color", { def = "", title = "spindle" } )
|
||||
netvar:var( "ujointcolor", "Color", { def = "", title = "u-joint" } )
|
||||
netvar:var( "armcolor", "Color", { def = "", title = "control arm" } )
|
||||
|
||||
netvar:subcategory( "Materials" )
|
||||
netvar:var( "spindlemat", "String", { def = "phoenix_storms/gear", title = "spindle" } )
|
||||
netvar:var( "ujointmat", "String", { def = "phoenix_storms/gear", title = "u-joint" } )
|
||||
netvar:var( "armmat", "String", { def = "phoenix_storms/gear", title = "control arm" } )
|
||||
|
||||
|
||||
netvar:category( "Shock Absorber" )
|
||||
|
||||
netvar:subcategory( "Setup" )
|
||||
netvar:var( "shocktype", "Combo", { def = "coil_over", values = { coil_over = 1, spring = 2, covered = 3, none = 4 }, sort = SortedPairsByValue, title = "type" } )
|
||||
netvar:var( "shockscale", "Float", { def = 0.75, min = 0, max = 50, title = "model scale" } )
|
||||
netvar:var( "shocklencyl", "Float", { def = 6, min = 0, max = 1000, title = "cylinder length", help = "absolute units" } )
|
||||
netvar:var( "shocklenret", "Float", { def = 0.75, min = 0, max = 1, title = "retainer offset", help = "% of cylinder length" } )
|
||||
netvar:var( "shockcoilradius", "Float", { def = 0.25, min = 0, max = 1, title = "coil wire radius", help = "% of model scale" } )
|
||||
netvar:var( "shockcoilcount", "Int", { def = 8, min = 1, max = 50, title = "coil turn count" } )
|
||||
netvar:var( "shockoffset1", "Vector", { def = Vector( 0, 20, 20 ), min = Vector( -1000, -1000, -1000 ), max = Vector( 1000, 1000, 1000 ), title = "local offset" } )
|
||||
|
||||
netvar:subcategory( "Colors" )
|
||||
netvar:var( "shockrodcolor", "Color", { def = "", title = "piston" } )
|
||||
netvar:var( "shocktopcolor", "Color", { def = "175 175 175 255", title = "top" } )
|
||||
netvar:var( "shockbotcolor", "Color", { def = "30 30 30 255", title = "bottom" } )
|
||||
netvar:var( "shockcylcolor", "Color", { def = "30 30 30 255", title = "cylinder" } )
|
||||
netvar:var( "shockretcolor", "Color", { def = "175 175 175 255", title = "retainer" } )
|
||||
netvar:var( "shockwirecolor", "Color", { def = "30 30 30 255", title = "coil/cover" } )
|
||||
|
||||
netvar:subcategory( "Materials" )
|
||||
netvar:var( "shockrodmat", "String", { def = "phoenix_storms/fender_chrome", title = "piston" } )
|
||||
netvar:var( "shocktopmat", "String", { def = "models/shiny", title = "top" } )
|
||||
netvar:var( "shockbotmat", "String", { def = "models/shiny", title = "bottom" } )
|
||||
netvar:var( "shockcylmat", "String", { def = "models/shiny", title = "cylinder" } )
|
||||
netvar:var( "shockretmat", "String", { def = "models/shiny", title = "retainer" } )
|
||||
netvar:var( "shockcovermat", "String", { def = "phoenix_storms/concrete0", title = "cover" } )
|
||||
|
||||
|
||||
--[[
|
||||
CLIENT
|
||||
]]
|
||||
if SERVER then return end
|
||||
|
||||
local math, util, string, table, render =
|
||||
math, util, string, table, render
|
||||
|
||||
local next, pairs, FrameTime, Entity, IsValid, EyePos, EyeVector, Vector, Angle, Matrix, WorldToLocal, LocalToWorld, Lerp, LerpVector =
|
||||
next, pairs, FrameTime, Entity, IsValid, EyePos, EyeVector, Vector, Angle, Matrix, WorldToLocal, LocalToWorld, Lerp, LerpVector
|
||||
|
||||
local pi = math.pi
|
||||
|
||||
|
||||
--[[
|
||||
netvar hooks
|
||||
]]
|
||||
local hooks = {}
|
||||
|
||||
hooks.editor_open = function( self, editor )
|
||||
for k, cat in pairs( editor.Categories ) do
|
||||
cat:ExpandRecurse( true )
|
||||
end
|
||||
self.tanktracktool_modeData_overlay = true
|
||||
end
|
||||
hooks.editor_close = function( self, editor )
|
||||
self.tanktracktool_modeData_overlay = nil
|
||||
end
|
||||
|
||||
hooks.netvar_set = function( self ) self.tanktracktool_reset = true end
|
||||
hooks.netvar_syncLink = function( self ) self.tanktracktool_reset = true end
|
||||
hooks.netvar_syncData = function( self ) self.tanktracktool_reset = true end
|
||||
|
||||
function ENT:netvar_callback( id, ... )
|
||||
if hooks[id] then hooks[id]( self, ... ) end
|
||||
end
|
||||
|
||||
local function GetEntities( self )
|
||||
if not self.netvar.entities and ( self.netvar.entindex.Chassis and self.netvar.entindex.LeftWheel and self.netvar.entindex.RightWheel ) then
|
||||
local e0 = Entity( self.netvar.entindex.Chassis )
|
||||
local e1 = Entity( self.netvar.entindex.LeftWheel )
|
||||
local e2 = Entity( self.netvar.entindex.RightWheel )
|
||||
|
||||
if IsValid( e0 ) and IsValid( e1 ) and IsValid( e2 ) then
|
||||
self.netvar.entities = { Chassis = e0, LeftWheel = e1, RightWheel = e2 }
|
||||
end
|
||||
end
|
||||
|
||||
local e0 = self.netvar.entities and IsValid( self.netvar.entities.Chassis ) and self.netvar.entities.Chassis or nil
|
||||
local e1 = self.netvar.entities and IsValid( self.netvar.entities.LeftWheel ) and self.netvar.entities.LeftWheel or nil
|
||||
local e2 = self.netvar.entities and IsValid( self.netvar.entities.RightWheel ) and self.netvar.entities.RightWheel or nil
|
||||
|
||||
return e0, e1, e2
|
||||
end
|
||||
|
||||
|
||||
--[[
|
||||
|
||||
]]
|
||||
local mode = tanktracktool.render.mode()
|
||||
mode:addCSent( "spindle", "ujoint", "arm", "driveshaft", "rollbar" )
|
||||
|
||||
function ENT:Think()
|
||||
self.BaseClass.Think( self )
|
||||
|
||||
if self.tanktracktool_reset then
|
||||
self.tanktracktool_reset = nil
|
||||
mode:init( self )
|
||||
return
|
||||
end
|
||||
|
||||
mode:think( self )
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
end
|
||||
|
||||
function mode:onInit( controller )
|
||||
self:override( controller, true )
|
||||
|
||||
local values = controller.netvar.values
|
||||
local data = self:getData( controller )
|
||||
|
||||
data.wheelrad = values.wheelrad
|
||||
data.wheelfwd = values.wheelfwd
|
||||
data.spindleri = values.spindleri
|
||||
data.pivotri = values.pivotri
|
||||
data.pivotup = values.pivotup
|
||||
|
||||
data.scale = values.scale + 1
|
||||
|
||||
data.spindle = self:addPart( controller, "spindle" )
|
||||
data.spindle:setmodel( "models/tanktracktool/suspension/linkage_spindle1.mdl" )
|
||||
data.spindle:setscale( Vector( data.scale, data.scale, data.scale ) )
|
||||
data.spindle.my = -4 * data.scale
|
||||
data.spindle.mz = -3.33601 * data.scale
|
||||
data.spindle.le_anglocal.y = 90
|
||||
data.spindle.ri_anglocal.y = -90
|
||||
|
||||
data.ujoint = self:addPart( controller, "ujoint" )
|
||||
data.ujoint:setmodel( "models/tanktracktool/suspension/linkage_ujoint.mdl" )
|
||||
data.ujoint:setscale( Vector( data.scale, data.scale, data.scale ) * 0.75 )
|
||||
data.ujoint.le_poslocal.z = 0.5 * data.scale
|
||||
data.ujoint.ri_poslocal.z = 0.5 * data.scale
|
||||
|
||||
data.arm = self:addPart( controller, "arm" )
|
||||
data.arm:setmodel( "models/tanktracktool/suspension/linkage_arm1.mdl" )
|
||||
data.arm:setscale( Vector( data.scale, data.scale, data.scale ) )
|
||||
data.arm.le_anglocal = Angle( 0, -90, 180 )
|
||||
data.arm.ri_anglocal = Angle( 0, -90, 0 )
|
||||
data.arm.le_poslocal.z = -0.75 * data.scale
|
||||
data.arm.ri_poslocal.z = -0.75 * data.scale
|
||||
|
||||
data.arm.bone_2_length_l = Vector()
|
||||
data.arm.bone_2_length_r = Vector()
|
||||
|
||||
data.arm.setupscale = function( self, csent, left, controller )
|
||||
csent:EnableMatrix( "RenderMultiply", self.scale_m )
|
||||
if left then
|
||||
csent:ManipulateBonePosition( 2, self.bone_2_length_l )
|
||||
else
|
||||
csent:ManipulateBonePosition( 2, self.bone_2_length_r )
|
||||
end
|
||||
csent:SetupBones()
|
||||
end
|
||||
|
||||
|
||||
data.driveshaft = self:addPart( controller, "driveshaft" )
|
||||
data.driveshaft:setmodel( "models/tanktracktool/suspension/linkage_driveshaft.mdl" )
|
||||
data.driveshaft:setscale( Vector( data.scale, data.scale, data.scale ) * 0.75 )
|
||||
data.driveshaft.le_poslocal = Vector( 1.84827, 0, 3.33601 ) * data.scale
|
||||
data.driveshaft.ri_poslocal = Vector( 1.84827, 0, 3.33601 ) * data.scale
|
||||
data.driveshaft.le_anglocal = Angle( 0, -90, 180 )
|
||||
data.driveshaft.ri_anglocal = Angle( 0, -90, 0 )
|
||||
data.driveshaft.bone_1_length_l = Vector()
|
||||
data.driveshaft.bone_1_length_r = Vector()
|
||||
data.driveshaft.scalar = data.scale * 0.75
|
||||
|
||||
data.driveshaft.setupscale = function( self, csent, left, controller )
|
||||
csent:EnableMatrix( "RenderMultiply", self.scale_m )
|
||||
if left then
|
||||
csent:ManipulateBonePosition( 1, self.bone_1_length_l )
|
||||
else
|
||||
csent:ManipulateBonePosition( 1, self.bone_1_length_r )
|
||||
end
|
||||
csent:SetupBones()
|
||||
end
|
||||
|
||||
|
||||
|
||||
data.rollbar = self:addPart( controller, "rollbar" )
|
||||
data.rollbar:setnodraw( false, true )
|
||||
data.rollbar:setmodel( "models/tanktracktool/suspension/linkage_rollbar.mdl" )
|
||||
data.rollbar:setscale( Vector( data.scale, data.scale, data.scale ) )
|
||||
data.rollbar.bone_length_l = Vector()
|
||||
data.rollbar.bone_length_r = Vector()
|
||||
|
||||
data.rollbar.le_poslocal = Vector( data.wheelfwd - ( 0.7 + 0.863351 + 2 ) * data.scale, 0, data.pivotup * 0.75 )
|
||||
|
||||
data.rollbar.setupscale = function( self, csent, left, controller )
|
||||
csent:EnableMatrix( "RenderMultiply", self.scale_m )
|
||||
csent:ManipulateBonePosition( 0, self.bone_length_l )
|
||||
csent:ManipulateBonePosition( 1, self.bone_length_r )
|
||||
csent:SetupBones()
|
||||
end
|
||||
|
||||
data.rollbar.beam_mat = Material( "tanktracktool/cable_white" )
|
||||
data.rollbar.beam_col = string.ToColor( values.shocktopcolor )
|
||||
data.rollbar.beam_w = data.scale * 0.25
|
||||
|
||||
data.rollbar.beam_le_wpos1 = Vector()
|
||||
data.rollbar.beam_le_wpos2 = Vector()
|
||||
data.rollbar.beam_ri_wpos1 = Vector()
|
||||
data.rollbar.beam_ri_wpos2 = Vector()
|
||||
|
||||
data.rollbar.postrender = function( self )
|
||||
local w = self.beam_w
|
||||
|
||||
render.SetMaterial( self.beam_mat )
|
||||
|
||||
render.StartBeam( 2 )
|
||||
render.AddBeam( self.beam_le_wpos1, w, 0, self.beam_col )
|
||||
render.AddBeam( self.beam_le_wpos2, w, 1, self.beam_col )
|
||||
render.EndBeam()
|
||||
|
||||
render.StartBeam( 2 )
|
||||
render.AddBeam( self.beam_ri_wpos1, w, 0, self.beam_col )
|
||||
render.AddBeam( self.beam_ri_wpos2, w, 1, self.beam_col )
|
||||
render.EndBeam()
|
||||
end
|
||||
|
||||
data.spindle:setcolor( values.spindlecolor )
|
||||
data.spindle:setmaterial( values.spindlemat )
|
||||
data.ujoint:setcolor( values.ujointcolor )
|
||||
data.ujoint:setmaterial( values.ujointmat )
|
||||
data.arm:setcolor( values.armcolor )
|
||||
data.arm:setmaterial( values.armmat )
|
||||
|
||||
data.rollbar:setcolor( values.shocktopcolor )
|
||||
|
||||
|
||||
local shock = tanktracktool.render.addshock( self, controller )
|
||||
data.shock = shock
|
||||
|
||||
shock.info.type = values.shocktype
|
||||
shock.info.scale = values.scale * values.shockscale
|
||||
shock.info.coilcount = values.shockcoilcount
|
||||
shock.info.wireradius = values.shockcoilradius
|
||||
shock.info.shocklencyl = values.shocklencyl
|
||||
shock.info.shocklenret = values.shocklenret
|
||||
shock.info.rodcolor = values.shockrodcolor
|
||||
shock.info.topcolor = values.shocktopcolor
|
||||
shock.info.botcolor = values.shockbotcolor
|
||||
shock.info.cylcolor = values.shockcylcolor
|
||||
shock.info.retcolor = values.shockretcolor
|
||||
shock.info.wirecolor = values.shockwirecolor
|
||||
|
||||
shock.info.rodmat = values.shockrodmat
|
||||
shock.info.topmat = values.shocktopmat
|
||||
shock.info.botmat = values.shockbotmat
|
||||
shock.info.cylmat = values.shockcylmat
|
||||
shock.info.retmat = values.shockretmat
|
||||
shock.info.covermat = values.shockcovermat
|
||||
|
||||
data.shockoffset_l1 = Vector( -0.5, 0, 6 - 0.5 ) * data.scale
|
||||
data.shockoffset_r1 = Vector( -0.5, 0, 6 - 0.5 ) * data.scale
|
||||
data.shockoffset_l2 = Vector( data.wheelfwd + values.shockoffset1.x, values.shockoffset1.y, values.shockoffset1.z )
|
||||
data.shockoffset_r2 = Vector( data.wheelfwd + values.shockoffset1.x, -values.shockoffset1.y, values.shockoffset1.z )
|
||||
data.shock:init( true, true )
|
||||
|
||||
data.shock.parts.tip1:setnodraw( true, true )
|
||||
data.shock.parts.tip2:setnodraw( true, true )
|
||||
|
||||
-- for k, v in pairs( self:getParts( controller ) ) do
|
||||
-- v:setcolor( HSVToColor( ( 360 / #self:getParts( controller ) ) * k, 0.667, 1 ) )
|
||||
-- v:setmaterial( "" )
|
||||
-- end
|
||||
|
||||
do
|
||||
local rotate
|
||||
local m = Matrix()
|
||||
|
||||
if tobool( values.matrixrx ) then
|
||||
local r = m:GetRight()
|
||||
m:SetRight( -m:GetForward() )
|
||||
m:SetForward( r )
|
||||
rotate = true
|
||||
end
|
||||
if tobool( values.matrixix ) then
|
||||
m:SetForward( m:GetForward() * -1 )
|
||||
m:SetRight( m:GetRight() * -1 )
|
||||
rotate = true
|
||||
end
|
||||
if tobool( values.matrixiz ) then
|
||||
m:SetUp( m:GetUp() * -1 )
|
||||
m:SetRight( m:GetRight() * -1 )
|
||||
rotate = true
|
||||
end
|
||||
|
||||
if rotate then
|
||||
data.rotation = tanktracktool.util.toLocalAng( Vector(), Angle(), m:GetAngles() )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local _ang = Angle()
|
||||
|
||||
function mode:onThink( controller )
|
||||
local e0, e1, e2 = GetEntities( controller )
|
||||
if not e0 or not e1 or not e2 then
|
||||
self:setnodraw( controller, true )
|
||||
return
|
||||
end
|
||||
|
||||
self:setnodraw( controller, false )
|
||||
|
||||
local data = self:getData( controller )
|
||||
local parts = self:getParts( controller )
|
||||
|
||||
local m = e0:GetWorldTransformMatrix()
|
||||
if data.rotation then m:Rotate( data.rotation ) end
|
||||
data.matrix = m
|
||||
|
||||
local fw_chassis = m:GetForward()
|
||||
local rg_chassis = m:GetRight()
|
||||
local up_chassis = m:GetUp()
|
||||
|
||||
local pos_chassis, ang_chassis = m:GetTranslation(), m:GetAngles()
|
||||
local pos_wheel_l, ang_wheel_l = WorldToLocal( e1:GetPos(), e1:GetAngles(), pos_chassis, ang_chassis )
|
||||
local pos_wheel_r, ang_wheel_r = WorldToLocal( e2:GetPos(), e2:GetAngles(), pos_chassis, ang_chassis )
|
||||
|
||||
|
||||
-- spindles
|
||||
data.spindle.le_anglocal.y = -math.acos( e1:GetRight():Dot( m:GetForward() ) ) * ( 180 / math.pi ) + 180
|
||||
|
||||
local offset = Vector( data.wheelfwd, pos_wheel_l.y + data.wheelrad * data.spindleri + data.spindle.my, pos_wheel_l.z + data.spindle.mz )
|
||||
data.spindle:setwposangl( LocalToWorld( offset, data.spindle.le_anglocal, pos_chassis, ang_chassis ) )
|
||||
data.rollbar.bone_length_l.y = ( offset.y ) / data.scale - 6.5
|
||||
|
||||
data.spindle.ri_anglocal.y = math.acos( e2:GetRight():Dot( m:GetForward() ) ) * ( 180 / math.pi ) + 180
|
||||
|
||||
local offset = Vector( data.wheelfwd, pos_wheel_r.y - data.wheelrad * data.spindleri - data.spindle.my, pos_wheel_r.z + data.spindle.mz )
|
||||
data.spindle:setwposangr( LocalToWorld( offset, data.spindle.ri_anglocal, pos_chassis, ang_chassis ) )
|
||||
data.rollbar.bone_length_r.y = ( offset.y ) / data.scale + 6.5
|
||||
|
||||
data.ujoint:setparent( data.spindle, data.spindle )
|
||||
|
||||
|
||||
-- control arms
|
||||
data.arm:setparent( data.ujoint, data.ujoint )
|
||||
|
||||
local target = LocalToWorld( Vector( data.wheelfwd, math.Clamp( data.pivotri, pos_wheel_r.y, pos_wheel_l.y ), data.pivotup ), _ang, pos_chassis, ang_chassis )
|
||||
local normal = tanktracktool.util.toLocalAxis( pos_chassis, ang_chassis, target - data.arm.le_posworld )
|
||||
|
||||
data.arm.le_anglocal.p = math.atan2( normal.z, normal.y ) * ( 180 / math.pi )
|
||||
data.arm:setwangl( tanktracktool.util.toWorldAng( pos_chassis, ang_chassis, data.arm.le_anglocal ) )
|
||||
data.arm.bone_2_length_l.z = -normal:Length() / data.scale + ( 3.746 + 3.254 )
|
||||
|
||||
local target = LocalToWorld( Vector( data.wheelfwd, -math.Clamp( data.pivotri, pos_wheel_r.y, pos_wheel_l.y ), data.pivotup ), _ang, pos_chassis, ang_chassis )
|
||||
local normal = tanktracktool.util.toLocalAxis( pos_chassis, ang_chassis, target - data.arm.ri_posworld )
|
||||
|
||||
data.arm.ri_anglocal.p = math.atan2( normal.z, normal.y ) * ( 180 / math.pi )
|
||||
data.arm:setwangr( tanktracktool.util.toWorldAng( pos_chassis, ang_chassis, data.arm.ri_anglocal ) )
|
||||
data.arm.bone_2_length_r.z = -normal:Length() / data.scale + ( 3.746 + 3.254 )
|
||||
|
||||
|
||||
-- driveshafts
|
||||
data.driveshaft:setparent( data.spindle, data.spindle )
|
||||
|
||||
local target = LocalToWorld( Vector( data.wheelfwd, math.Clamp( data.pivotri, pos_wheel_r.y, pos_wheel_l.y ) * 0.5, data.pivotup * 0.25 ), _ang, pos_chassis, ang_chassis )
|
||||
local normal = tanktracktool.util.toLocalAxis( pos_chassis, ang_chassis, target - data.driveshaft.le_posworld )
|
||||
|
||||
data.driveshaft.le_anglocal.p = math.atan2( normal.z, normal.y ) * ( 180 / math.pi )
|
||||
data.driveshaft:setwangl( tanktracktool.util.toWorldAng( pos_chassis, ang_chassis, data.driveshaft.le_anglocal ) )
|
||||
data.driveshaft.bone_1_length_l.x = -normal:Length() / data.driveshaft.scalar + 2
|
||||
|
||||
local target = LocalToWorld( Vector( data.wheelfwd, -math.Clamp( data.pivotri, pos_wheel_r.y, pos_wheel_l.y ) * 0.5, data.pivotup * 0.25 ), _ang, pos_chassis, ang_chassis )
|
||||
local normal = tanktracktool.util.toLocalAxis( pos_chassis, ang_chassis, target - data.driveshaft.ri_posworld )
|
||||
|
||||
data.driveshaft.ri_anglocal.p = math.atan2( normal.z, normal.y ) * ( 180 / math.pi )
|
||||
data.driveshaft:setwangr( tanktracktool.util.toWorldAng( pos_chassis, ang_chassis, data.driveshaft.ri_anglocal ) )
|
||||
data.driveshaft.bone_1_length_r.x = -normal:Length() / data.driveshaft.scalar + 2
|
||||
|
||||
|
||||
-- rollbar
|
||||
data.rollbar.le_anglocal.p = -math.NormalizeAngle( 180 - data.driveshaft.le_anglocal.p + data.driveshaft.ri_anglocal.p ) * 3 --* 0.333
|
||||
data.rollbar:setwposangl( LocalToWorld( data.rollbar.le_poslocal, data.rollbar.le_anglocal, pos_chassis, ang_chassis ) )
|
||||
|
||||
data.rollbar.beam_le_wpos1 = data.rollbar:toworldl( Vector( 0.863352, data.rollbar.bone_length_l.y + 6, 0 ) * data.scale )
|
||||
data.rollbar.beam_le_wpos2 = data.spindle:toworldl( Vector( -0.5, 0.7, 5.5 ) * data.scale )
|
||||
data.rollbar.beam_ri_wpos1 = data.rollbar:toworldl( Vector( 0.863352, data.rollbar.bone_length_r.y - 6, 0 ) * data.scale )
|
||||
data.rollbar.beam_ri_wpos2 = data.spindle:toworldr( Vector( -0.5, -0.7, 5.5 ) * data.scale )
|
||||
|
||||
|
||||
-- shocks
|
||||
local sp0 = LocalToWorld( data.shockoffset_l1, _ang, data.spindle.le_posworld, data.spindle.le_angworld )
|
||||
local sp1 = LocalToWorld( data.shockoffset_l2, _ang, pos_chassis, ang_chassis )
|
||||
local sp2 = LocalToWorld( data.shockoffset_r1, _ang, data.spindle.ri_posworld, data.spindle.ri_angworld )
|
||||
local sp3 = LocalToWorld( data.shockoffset_r2, _ang, pos_chassis, ang_chassis )
|
||||
|
||||
data.shock:setcontrolpoints( sp0, sp1, sp2, sp3 )
|
||||
end
|
||||
|
||||
function mode:onDraw( controller, eyepos, eyedir, empty, flashlight )
|
||||
local data = self:getData( controller )
|
||||
|
||||
data.shock:render()
|
||||
self:renderParts( controller, eyepos, eyedir, emptyCSENT, flashlightMODE )
|
||||
|
||||
if flashlightMODE then
|
||||
render.PushFlashlightMode( true )
|
||||
self:renderParts( controller, eyepos, eyedir, emptyCSENT, flashlightMODE )
|
||||
render.PopFlashlightMode()
|
||||
end
|
||||
end
|
||||
|
||||
local rgb_grn = Color( 0, 255, 0 )
|
||||
local rgb_red = Color( 255, 0, 0 )
|
||||
local rgb_blu = Color( 0, 0, 255 )
|
||||
local rgb_yel = Color( 255, 255, 0 )
|
||||
|
||||
local function DrawAxis( m, len )
|
||||
local pos = m:GetTranslation()
|
||||
render.DrawLine( pos, pos + m:GetForward() * len, rgb_grn )
|
||||
render.DrawLine( pos, pos + m:GetRight() * len, rgb_red )
|
||||
render.DrawLine( pos, pos + m:GetUp() * len, rgb_blu )
|
||||
end
|
||||
|
||||
function mode:overlay( controller, eyepos, eyedir, empty, flashlight )
|
||||
local data = self:getData( controller )
|
||||
|
||||
local mpos = data.matrix:GetTranslation()
|
||||
local mang = data.matrix:GetAngles()
|
||||
local mfw = data.matrix:GetForward()
|
||||
local mri = data.matrix:GetRight()
|
||||
local mup = data.matrix:GetUp()
|
||||
|
||||
local length = 25
|
||||
DrawAxis( data.matrix, length )
|
||||
|
||||
if controller.netvar.entities then
|
||||
|
||||
local f = ( mpos + mfw * length ):ToScreen()
|
||||
local u = ( mpos + mup * length ):ToScreen()
|
||||
|
||||
cam.Start2D()
|
||||
|
||||
local cpos = controller.netvar.entities.Chassis:GetPos():ToScreen()
|
||||
draw.SimpleTextOutlined( "Chassis", "Trebuchet18", cpos.x, cpos.y, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black )
|
||||
|
||||
|
||||
local lpos = controller.netvar.entities.LeftWheel:GetPos():ToScreen()
|
||||
draw.SimpleTextOutlined( "LeftWheel", "Trebuchet18", lpos.x, lpos.y, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black )
|
||||
|
||||
|
||||
local rpos = controller.netvar.entities.RightWheel:GetPos():ToScreen()
|
||||
draw.SimpleTextOutlined( "RightWheel", "Trebuchet18", rpos.x, rpos.y, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black )
|
||||
|
||||
|
||||
local ldot = ( controller.netvar.entities.LeftWheel:GetPos() - mpos ):Dot( mri )
|
||||
local rdot = ( controller.netvar.entities.RightWheel:GetPos() - mpos ):Dot( mri )
|
||||
|
||||
if not ( ldot < 0 and rdot > 0 ) then
|
||||
draw.SimpleTextOutlined( "Invalid chassis configuration", "Trebuchet24", u.x, u.y, Color( 255, 255, 0 ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black )
|
||||
draw.SimpleTextOutlined( "Try changing parameters in editor", "Trebuchet18", u.x, u.y + 24, Color( 255, 255, 0 ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black )
|
||||
|
||||
surface.SetDrawColor( 255, 255, 0 )
|
||||
surface.DrawLine( f.x, f.y, lpos.x, lpos.y )
|
||||
surface.DrawLine( f.x, f.y, rpos.x, rpos.y )
|
||||
else
|
||||
surface.SetDrawColor( 0, 255, 0 )
|
||||
surface.DrawLine( f.x, f.y, lpos.x, lpos.y )
|
||||
surface.DrawLine( f.x, f.y, rpos.x, rpos.y )
|
||||
end
|
||||
|
||||
cam.End2D()
|
||||
|
||||
render.SetColorMaterial()
|
||||
|
||||
local offset = WorldToLocal( controller.netvar.entities.LeftWheel:GetPos(), Angle(), mpos, mang )
|
||||
local target = LocalToWorld( Vector( data.wheelfwd, offset.y, offset.z ), Angle(), mpos, mang )
|
||||
render.DrawSphere( target, data.wheelrad, 8, 8, Color( 255, 255, 255, 50 ), true )
|
||||
|
||||
local offset = WorldToLocal( controller.netvar.entities.RightWheel:GetPos(), Angle(), mpos, mang )
|
||||
local target = LocalToWorld( Vector( data.wheelfwd, offset.y, offset.z ), Angle(), mpos, mang )
|
||||
render.DrawSphere( target, data.wheelrad, 8, 8, Color( 255, 255, 255, 50 ), true )
|
||||
|
||||
end
|
||||
end
|
@ -187,7 +187,7 @@ end
|
||||
function PANEL:RebuildSettings()
|
||||
local cat = self:AddNode( "TOOL SETTINGS" )
|
||||
|
||||
local node = cat:AddNode( "Enable Overlay" )
|
||||
local node = cat:AddNode( "Enable Overlays" )
|
||||
node:Setup( { type = "checkbox" } )
|
||||
|
||||
node.DataUpdate = function( _ )
|
||||
@ -240,7 +240,6 @@ function PANEL:Think()
|
||||
while SysTime() - t < 0.01 do
|
||||
local a, b = coroutine.resume( self.coroutine )
|
||||
if not a or b then
|
||||
if b then print( b ) end
|
||||
self.coroutine = nil
|
||||
self.mywindow.btnClose:SetImage( "gui/cross.png" )
|
||||
break
|
||||
|
@ -571,7 +571,12 @@ function tanktracktool.render.addshock( mode, controller )
|
||||
self.info.retmat = ""
|
||||
self.info.covermat = ""
|
||||
|
||||
self.info.mdltip = "models/tanktracktool/suspension/shock_piston_tip1.mdl"
|
||||
self.info.mdltop = "models/tanktracktool/shock/top1.mdl"
|
||||
self.info.mdlbot = "models/tanktracktool/shock/bottom1.mdl"
|
||||
self.info.mdlcyl = "models/tanktracktool/shock/cylinder1.mdl"
|
||||
self.info.mdlret = "models/tanktracktool/shock/retainer1.mdl"
|
||||
self.info.mdltip = "models/tanktracktool/shock/piston_tip1.mdl"
|
||||
self.info.mdlcov = "models/tanktracktool/shock/cover1.mdl"
|
||||
|
||||
function self:setnodraw( l, r )
|
||||
for k, v in pairs( self.parts ) do v:setnodraw( l, r ) end
|
||||
@ -597,7 +602,7 @@ function tanktracktool.render.addshock( mode, controller )
|
||||
|
||||
if self.info.type == "covered" then
|
||||
self.parts.cover = mode:addPart( controller, "shock_cover" )
|
||||
self.parts.cover:setmodel( "models/tanktracktool/suspension/shock_cover1.mdl" )
|
||||
self.parts.cover:setmodel( self.info.mdlcov )
|
||||
self.parts.cover.scale_v = Vector( self.info.scale, self.info.scale, self.info.scale )
|
||||
self.parts.cover.scale_l = Matrix()
|
||||
self.parts.cover.scale_r = Matrix()
|
||||
@ -610,7 +615,7 @@ function tanktracktool.render.addshock( mode, controller )
|
||||
else
|
||||
if self.info.type ~= "spring" then
|
||||
self.parts.rod = mode:addPart( controller, "shock_rod" )
|
||||
self.parts.rod:setmodel( "models/tanktracktool/suspension/shock_piston_rod.mdl" )
|
||||
self.parts.rod:setmodel( "models/tanktracktool/shock/piston_rod.mdl" )
|
||||
self.parts.rod.le_poslocal.x = 1.5 * self.info.scale
|
||||
self.parts.rod.ri_poslocal.x = 1.5 * self.info.scale
|
||||
self.parts.rod.scale_v = Vector( self.info.scale, self.info.scale, self.info.scale )
|
||||
@ -645,7 +650,7 @@ function tanktracktool.render.addshock( mode, controller )
|
||||
end
|
||||
|
||||
self.parts.top = mode:addPart( controller, "shock_top" )
|
||||
self.parts.top:setmodel( "models/tanktracktool/suspension/shock_top1.mdl" )
|
||||
self.parts.top:setmodel( self.info.mdltop )
|
||||
self.parts.top.le_poslocal.x = 1.25 * self.info.scale
|
||||
self.parts.top.ri_poslocal.x = 1.25 * self.info.scale
|
||||
self.parts.top:setscale( Vector( self.info.scale, self.info.scale, self.info.scale ) )
|
||||
@ -653,7 +658,7 @@ function tanktracktool.render.addshock( mode, controller )
|
||||
self.parts.top:setmaterial( self.info.topmat )
|
||||
|
||||
self.parts.cylinder = mode:addPart( controller, "shock_cylinder" )
|
||||
self.parts.cylinder:setmodel( "models/tanktracktool/suspension/shock_cylinder1.mdl" )
|
||||
self.parts.cylinder:setmodel( self.info.mdlcyl )
|
||||
self.parts.cylinder.le_poslocal.x = 3 * self.info.scale
|
||||
self.parts.cylinder.ri_poslocal.x = 3 * self.info.scale
|
||||
self.parts.cylinder:setscale( Vector( self.info.shocklencyl / 12, self.info.scale, self.info.scale ) )
|
||||
@ -662,7 +667,7 @@ function tanktracktool.render.addshock( mode, controller )
|
||||
|
||||
if self.info.type ~= "none" then
|
||||
self.parts.bot = mode:addPart( controller, "shock_bot" )
|
||||
self.parts.bot:setmodel( "models/tanktracktool/suspension/shock_bottom1.mdl" )
|
||||
self.parts.bot:setmodel( self.info.mdlbot )
|
||||
self.parts.bot.le_anglocal.p = 180
|
||||
self.parts.bot.ri_anglocal.p = 180
|
||||
self.parts.bot.le_poslocal.x = 3 * self.info.scale
|
||||
@ -672,7 +677,7 @@ function tanktracktool.render.addshock( mode, controller )
|
||||
self.parts.bot:setmaterial( self.info.botmat )
|
||||
|
||||
self.parts.retainer = mode:addPart( controller, "shock_retainer" )
|
||||
self.parts.retainer:setmodel( "models/tanktracktool/suspension/shock_retainer1.mdl" )
|
||||
self.parts.retainer:setmodel( self.info.mdlret )
|
||||
self.parts.retainer.le_poslocal.x = ( self.info.shocklencyl - ( 0.312768 * self.info.scale + 0.175 * ( self.info.shocklencyl / 12 ) ) ) * self.info.shocklenret
|
||||
self.parts.retainer.ri_poslocal.x = ( self.info.shocklencyl - ( 0.312768 * self.info.scale + 0.175 * ( self.info.shocklencyl / 12 ) ) ) * self.info.shocklenret
|
||||
self.parts.retainer:setscale( Vector( self.info.scale, self.info.scale, self.info.scale ) )
|
||||
|
@ -197,43 +197,93 @@ end
|
||||
|
||||
|
||||
--[[
|
||||
HUD stuff
|
||||
HUD display
|
||||
]]
|
||||
multitool.ui = {}
|
||||
|
||||
multitool.ui.fonts = {}
|
||||
multitool.ui.fonts.small = "tanktracktool_stool0"
|
||||
multitool.ui.fonts.large = "tanktracktool_stool1"
|
||||
surface.CreateFont( multitool.ui.fonts.small, { font = "Consolas", size = 14, weight = 100, shadow = false } )
|
||||
surface.CreateFont( multitool.ui.fonts.large, { font = "Consolas", size = 20, weight = 100, shadow = false } )
|
||||
|
||||
multitool.ui.colors = {}
|
||||
local function rgb( color, a )
|
||||
return Color( color.r / 255, color.g / 255, color.b / 255, a )
|
||||
end
|
||||
-- local function rgbCookieGet( key, def )
|
||||
-- return Color( cookie.GetNumber( key .. "_r", def.r ), cookie.GetNumber( key .. "_g", def.g ), cookie.GetNumber( key .. "_b", def.b ), cookie.GetNumber( key .. "_a", def.a ) )
|
||||
-- end
|
||||
|
||||
local default_colors = {
|
||||
text_class = Color( 255, 255, 0 ),
|
||||
text_keyword = Color( 0, 255, 255 ),
|
||||
text_input = Color( 0, 255, 0 ),
|
||||
text_plain = Color( 255, 255, 255 ),
|
||||
}
|
||||
local default_colors = { text_class = Color( 255, 255, 0 ), text_keyword = Color( 0, 255, 255 ), text_input = Color( 0, 255, 0 ), text_plain = Color( 255, 255, 255 ) }
|
||||
|
||||
multitool.ui = {}
|
||||
|
||||
multitool.ui.colors = {}
|
||||
multitool.ui.colors.text_class = default_colors.text_class
|
||||
multitool.ui.colors.text_keyword = default_colors.text_keyword
|
||||
multitool.ui.colors.text_input = default_colors.text_input
|
||||
multitool.ui.colors.text_plain = default_colors.text_plain
|
||||
multitool.ui.colors.text_box = Color( 0, 0, 0, 200 )
|
||||
|
||||
multitool.ui.colors.text_linked = Color( multitool.ui.colors.text_class.r, multitool.ui.colors.text_class.g, multitool.ui.colors.text_class.b, 200 )
|
||||
multitool.ui.colors.text_linked_box = Color( 0, 0, 0, 150 )
|
||||
|
||||
multitool.ui.colors.ents_bbox = Color( 255, 255, 255, 66 )
|
||||
multitool.ui.colors.ents_possible = rgb( multitool.ui.colors.text_plain, 0.333 )
|
||||
multitool.ui.colors.ents_selected = rgb( multitool.ui.colors.text_keyword, 0.333 )
|
||||
multitool.ui.colors.ents_hovered = rgb( multitool.ui.colors.text_class, 0.333 )
|
||||
|
||||
multitool.ui.fonts = {}
|
||||
multitool.ui.fonts.small = "tanktracktool_stool0"
|
||||
multitool.ui.fonts.large = "tanktracktool_stool1"
|
||||
--[[
|
||||
local function reskin()
|
||||
local color = rgbCookieGet( "tttm_tc", default_colors.text_class )
|
||||
multitool.ui.colors.text_class.r = color.r
|
||||
multitool.ui.colors.text_class.g = color.g
|
||||
multitool.ui.colors.text_class.b = color.b
|
||||
multitool.ui.colors.text_class.a = color.a
|
||||
|
||||
surface.CreateFont( multitool.ui.fonts.small, { font = "Consolas", size = 14, weight = 100, shadow = false } )
|
||||
surface.CreateFont( multitool.ui.fonts.large, { font = "Consolas", size = 20, weight = 100, shadow = false } )
|
||||
local color = rgbCookieGet( "tttm_tw", default_colors.text_keyword )
|
||||
multitool.ui.colors.text_keyword.r = color.r
|
||||
multitool.ui.colors.text_keyword.g = color.g
|
||||
multitool.ui.colors.text_keyword.b = color.b
|
||||
multitool.ui.colors.text_keyword.a = color.a
|
||||
|
||||
local color = rgbCookieGet( "tttm_ti", default_colors.text_input )
|
||||
multitool.ui.colors.text_input.r = color.r
|
||||
multitool.ui.colors.text_input.g = color.g
|
||||
multitool.ui.colors.text_input.b = color.b
|
||||
multitool.ui.colors.text_input.a = color.a
|
||||
|
||||
local color = rgbCookieGet( "tttm_tp", default_colors.text_plain )
|
||||
multitool.ui.colors.text_plain.r = color.r
|
||||
multitool.ui.colors.text_plain.g = color.g
|
||||
multitool.ui.colors.text_plain.b = color.b
|
||||
multitool.ui.colors.text_plain.a = color.a
|
||||
|
||||
local color = multitool.ui.colors.text_class
|
||||
multitool.ui.colors.text_linked.r = color.r
|
||||
multitool.ui.colors.text_linked.g = color.g
|
||||
multitool.ui.colors.text_linked.b = color.b
|
||||
|
||||
local color = rgb( multitool.ui.colors.text_plain, 0.333 )
|
||||
multitool.ui.colors.ents_possible.r = color.r
|
||||
multitool.ui.colors.ents_possible.g = color.g
|
||||
multitool.ui.colors.ents_possible.b = color.b
|
||||
multitool.ui.colors.ents_possible.a = color.a
|
||||
|
||||
local color = rgb( multitool.ui.colors.text_keyword, 0.333 )
|
||||
multitool.ui.colors.ents_selected.r = color.r
|
||||
multitool.ui.colors.ents_selected.g = color.g
|
||||
multitool.ui.colors.ents_selected.b = color.b
|
||||
multitool.ui.colors.ents_selected.a = color.a
|
||||
|
||||
local color = rgb( multitool.ui.colors.text_class, 0.333 )
|
||||
multitool.ui.colors.ents_hovered.r = color.r
|
||||
multitool.ui.colors.ents_hovered.g = color.g
|
||||
multitool.ui.colors.ents_hovered.b = color.b
|
||||
multitool.ui.colors.ents_hovered.a = color.a
|
||||
end
|
||||
]]
|
||||
|
||||
|
||||
--[[
|
||||
HUD draw
|
||||
]]
|
||||
function multitool:renderModel( ent, color )
|
||||
if not IsValid( ent ) then return end
|
||||
if not IsValid( self.csent ) then
|
||||
@ -1041,7 +1091,7 @@ local function BuildPanel_EntitySettings( self )
|
||||
combo:AddChoice( "sent_point_beam", nil, nil, "icon16/bullet_blue.png" )
|
||||
combo:AddChoice( "sent_suspension_shock", nil, nil, "icon16/bullet_blue.png" )
|
||||
combo:AddChoice( "sent_suspension_spring", nil, nil, "icon16/bullet_blue.png" )
|
||||
combo:AddChoice( "sent_suspension_mstrut", nil, nil, "icon16/bullet_blue.png" )
|
||||
--combo:AddChoice( "sent_suspension_mstrut", nil, nil, "icon16/bullet_blue.png" )
|
||||
|
||||
combo.OnSelect = function( _, id, val, func )
|
||||
RunConsoleCommand( "tanktracktool_spawn_entity", tostring( val ) )
|
||||
@ -1071,7 +1121,72 @@ local function BuildPanel_EntitySettings( self )
|
||||
return pnl
|
||||
end
|
||||
|
||||
--[[
|
||||
local function BuildPanel_ToolSettings( self )
|
||||
local pnl = vgui.Create( "DForm" )
|
||||
pnl:SetName( "Tool Settings" )
|
||||
|
||||
local txt = header( pnl, "Overlay Colors" )
|
||||
|
||||
local combo = vgui.Create( "DComboBox", pnl )
|
||||
pnl:AddItem( combo )
|
||||
|
||||
combo:AddChoice( "text_class", "tttm_tc" )
|
||||
combo:AddChoice( "text_keyword", "tttm_tw" )
|
||||
combo:AddChoice( "text_input", "tttm_ti" )
|
||||
combo:AddChoice( "text_plain", "tttm_tp" )
|
||||
|
||||
local col = vgui.Create( "DColorMixer", pnl )
|
||||
pnl:AddItem( col )
|
||||
|
||||
col:SetAlphaBar( true )
|
||||
col:SetPalette( false )
|
||||
col:SetWangs( true )
|
||||
|
||||
local btn = pnl:Button( "Reset" )
|
||||
btn.DoClick = function( self )
|
||||
local key, data = combo:GetSelected()
|
||||
col:SetColor( default_colors[key] )
|
||||
end
|
||||
|
||||
local btn = pnl:Button( "Reset ALL" )
|
||||
btn.DoClick = function( self )
|
||||
for i = 1, 4 do
|
||||
local key = combo:GetOptionText( i )
|
||||
local data = combo:GetOptionData( i )
|
||||
|
||||
local color = default_colors[key]
|
||||
cookie.Set( data .. "_r", color.r )
|
||||
cookie.Set( data .. "_g", color.g )
|
||||
cookie.Set( data .. "_b", color.b )
|
||||
cookie.Set( data .. "_a", color.a )
|
||||
end
|
||||
|
||||
combo:ChooseOption( "text_class", 1 )
|
||||
end
|
||||
|
||||
combo.OnSelect = function( self, i, val, data )
|
||||
col:SetColor( rgbCookieGet( data, default_colors[val] ) )
|
||||
end
|
||||
|
||||
combo:ChooseOption( "text_class", 1 )
|
||||
|
||||
col.ValueChanged = function( self, color )
|
||||
local key, data = combo:GetSelected()
|
||||
|
||||
cookie.Set( data .. "_r", color.r )
|
||||
cookie.Set( data .. "_g", color.g )
|
||||
cookie.Set( data .. "_b", color.b )
|
||||
cookie.Set( data .. "_a", color.a )
|
||||
|
||||
reskin()
|
||||
end
|
||||
|
||||
return pnl
|
||||
end
|
||||
]]
|
||||
function TOOL.BuildCPanel( self )
|
||||
self:AddPanel( BuildPanel_AddonSettings( self ) )
|
||||
self:AddPanel( BuildPanel_EntitySettings( self ) )
|
||||
--self:AddPanel( BuildPanel_ToolSettings( self ) )
|
||||
end
|
||||
|
BIN
materials/entities/sent_point_beam.png
Normal file
BIN
materials/entities/sent_point_beam.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
BIN
materials/entities/sent_suspension_shock.png
Normal file
BIN
materials/entities/sent_suspension_shock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
BIN
materials/entities/sent_suspension_spring.png
Normal file
BIN
materials/entities/sent_suspension_spring.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
BIN
materials/entities/sent_tanktracks_auto.png
Normal file
BIN
materials/entities/sent_tanktracks_auto.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
BIN
materials/entities/sent_tanktracks_legacy.png
Normal file
BIN
materials/entities/sent_tanktracks_legacy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
BIN
models/tanktracktool/shock/bottom1.dx80.vtx
Normal file
BIN
models/tanktracktool/shock/bottom1.dx80.vtx
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/bottom1.dx90.vtx
Normal file
BIN
models/tanktracktool/shock/bottom1.dx90.vtx
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/bottom1.mdl
Normal file
BIN
models/tanktracktool/shock/bottom1.mdl
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/bottom1.sw.vtx
Normal file
BIN
models/tanktracktool/shock/bottom1.sw.vtx
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/bottom1.vvd
Normal file
BIN
models/tanktracktool/shock/bottom1.vvd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
models/tanktracktool/shock/cover1.vvd
Normal file
BIN
models/tanktracktool/shock/cover1.vvd
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/cylinder1.dx80.vtx
Normal file
BIN
models/tanktracktool/shock/cylinder1.dx80.vtx
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/cylinder1.dx90.vtx
Normal file
BIN
models/tanktracktool/shock/cylinder1.dx90.vtx
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/cylinder1.mdl
Normal file
BIN
models/tanktracktool/shock/cylinder1.mdl
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/cylinder1.sw.vtx
Normal file
BIN
models/tanktracktool/shock/cylinder1.sw.vtx
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/cylinder1.vvd
Normal file
BIN
models/tanktracktool/shock/cylinder1.vvd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
models/tanktracktool/shock/piston_rod.mdl
Normal file
BIN
models/tanktracktool/shock/piston_rod.mdl
Normal file
Binary file not shown.
Binary file not shown.
BIN
models/tanktracktool/shock/piston_rod.vvd
Normal file
BIN
models/tanktracktool/shock/piston_rod.vvd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
models/tanktracktool/shock/piston_tip1.vvd
Normal file
BIN
models/tanktracktool/shock/piston_tip1.vvd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
models/tanktracktool/shock/piston_tip2.mdl
Normal file
BIN
models/tanktracktool/shock/piston_tip2.mdl
Normal file
Binary file not shown.
Binary file not shown.
BIN
models/tanktracktool/shock/piston_tip2.vvd
Normal file
BIN
models/tanktracktool/shock/piston_tip2.vvd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
models/tanktracktool/shock/retainer1.vvd
Normal file
BIN
models/tanktracktool/shock/retainer1.vvd
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/top1.dx80.vtx
Normal file
BIN
models/tanktracktool/shock/top1.dx80.vtx
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/top1.dx90.vtx
Normal file
BIN
models/tanktracktool/shock/top1.dx90.vtx
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/top1.mdl
Normal file
BIN
models/tanktracktool/shock/top1.mdl
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/top1.sw.vtx
Normal file
BIN
models/tanktracktool/shock/top1.sw.vtx
Normal file
Binary file not shown.
BIN
models/tanktracktool/shock/top1.vvd
Normal file
BIN
models/tanktracktool/shock/top1.vvd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
models/tanktracktool/shock/top2.mdl
Normal file
BIN
models/tanktracktool/shock/top2.mdl
Normal file
Binary file not shown.
Binary file not shown.
BIN
models/tanktracktool/shock/top2.vvd
Normal file
BIN
models/tanktracktool/shock/top2.vvd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user