Permalink
Browse files

More updates to tools

* Fixed button Toggle State updating improperly
* Fixed "Remove on Explode" not updating on dynamite
* Fixed No Collide undo & remove all constraints
* Changed all default keys to their Numpad counterparts
  • Loading branch information...
1 parent d0de762 commit d40e3a6fcf668f8ff2ec59a3944ab193d5f06a78 @robotboy655 robotboy655 committed Oct 14, 2013
@@ -5,7 +5,7 @@ TOOL.Command = nil
TOOL.ConfigName = ""
TOOL.ClientConVar[ "model" ] = "models/dav0r/buttons/button.mdl"
-TOOL.ClientConVar[ "keygroup" ] = "1"
+TOOL.ClientConVar[ "keygroup" ] = "37"
TOOL.ClientConVar[ "description" ] = ""
TOOL.ClientConVar[ "toggle" ] = "1"
@@ -22,7 +22,7 @@ function TOOL:RightClick( trace )
local model = self:GetClientInfo( "model" )
local key = self:GetClientNumber( "keygroup" )
local description = self:GetClientInfo( "description" )
- local toggle = self:GetClientNumber( "toggle" )
+ local toggle = self:GetClientNumber( "toggle" ) == 1
-- If we shot a button change its keygroup
if ( trace.Entity:IsValid() &&
@@ -31,7 +31,7 @@ function TOOL:RightClick( trace )
trace.Entity:SetKey( key )
trace.Entity:SetLabel( description )
- trace.Entity:SetIsToggle( toggle );
+ trace.Entity:SetIsToggle( toggle )
return true, NULL, true
@@ -100,7 +100,7 @@ if (SERVER) then
button:SetPlayer( pl )
button:SetKey( key )
button:SetLabel( description )
- button:SetIsToggle( toggle == 1 )
+ button:SetIsToggle( toggle )
local ttable =
{
@@ -6,7 +6,7 @@ TOOL.Command = nil
TOOL.ConfigName = nil
TOOL.ClientConVar[ "locked" ] = "0"
-TOOL.ClientConVar[ "key" ] = "0"
+TOOL.ClientConVar[ "key" ] = "37"
TOOL.ClientConVar[ "toggle" ] = "1"
cleanup.Register( "cameras" )
@@ -2,7 +2,7 @@
TOOL.Category = "Construction"
TOOL.Name = "#tool.dynamite.name"
-TOOL.ClientConVar[ "group" ] = 65 -- Current group
+TOOL.ClientConVar[ "group" ] = 52 -- Current group
TOOL.ClientConVar[ "damage" ] = 200 -- Damage to inflict
TOOL.ClientConVar[ "delay" ] = 0 -- Delay before explosions start
TOOL.ClientConVar[ "model" ] = "models/dav0r/tnt/tnt.mdl"
@@ -29,6 +29,7 @@ function TOOL:LeftClick( trace )
-- If we shot a button change its keygroup
if ( IsValid( trace.Entity ) && trace.Entity:GetClass() == "gmod_dynamite" && trace.Entity:GetPlayer() == ply ) then
trace.Entity:Setup( _damage )
+ trace.Entity:SetShouldRemove( _remove )
return true
end
@@ -4,7 +4,7 @@ TOOL.Name = "#tool.emitter.name"
TOOL.Command = nil
TOOL.ConfigName = ""
-TOOL.ClientConVar[ "key" ] = "10"
+TOOL.ClientConVar[ "key" ] = "51"
TOOL.ClientConVar[ "delay" ] = "1"
TOOL.ClientConVar[ "toggle" ] = "1"
TOOL.ClientConVar[ "starton" ] = "0"
@@ -5,8 +5,8 @@ TOOL.Command = nil
TOOL.ConfigName = nil
-TOOL.ClientConVar[ "keyup" ] = "9"
-TOOL.ClientConVar[ "keydn" ] = "6"
+TOOL.ClientConVar[ "keyup" ] = "46"
+TOOL.ClientConVar[ "keydn" ] = "43"
TOOL.ClientConVar[ "speed" ] = "1"
TOOL.ClientConVar[ "resistance" ] = "0"
TOOL.ClientConVar[ "strength" ] = "1"
@@ -5,7 +5,7 @@ TOOL.Command = nil
TOOL.ConfigName = nil
-TOOL.ClientConVar[ "group" ] = "1"
+TOOL.ClientConVar[ "group" ] = "37"
TOOL.ClientConVar[ "width" ] = "3"
TOOL.ClientConVar[ "addlength" ] = "100"
TOOL.ClientConVar[ "fixed" ] = "1"
@@ -9,8 +9,8 @@ TOOL.ClientConVar[ "torque" ] = "500"
TOOL.ClientConVar[ "friction" ] = "1"
TOOL.ClientConVar[ "nocollide" ] = "1"
TOOL.ClientConVar[ "forcetime" ] = "0"
-TOOL.ClientConVar[ "fwd" ] = "1"
-TOOL.ClientConVar[ "bwd" ] = "2"
+TOOL.ClientConVar[ "fwd" ] = "45"
+TOOL.ClientConVar[ "bwd" ] = "42"
TOOL.ClientConVar[ "toggle" ] = "0"
TOOL.ClientConVar[ "forcelimit" ] = "0"
@@ -5,7 +5,7 @@ TOOL.Command = nil
TOOL.ConfigName = nil
-TOOL.ClientConVar[ "group" ] = "1"
+TOOL.ClientConVar[ "group" ] = "37"
TOOL.ClientConVar[ "width" ] = "2"
TOOL.ClientConVar[ "addlength" ] = "100"
TOOL.ClientConVar[ "fixed" ] = "1"
@@ -32,12 +32,14 @@ function TOOL:LeftClick( trace )
local constraint = constraint.NoCollide(Ent1, Ent2, Bone1, Bone2)
- undo.Create( "NoCollide" )
- undo.AddEntity( constraint )
- undo.SetPlayer( self:GetOwner() )
- undo.Finish()
-
- self:GetOwner():AddCleanup( "nocollide", constraint )
+ if ( constraint ) then
+ undo.Create( "NoCollide" )
+ undo.AddEntity( constraint )
+ undo.SetPlayer( self:GetOwner() )
+ undo.Finish()
+
+ self:GetOwner():AddCleanup( "nocollide", constraint )
+ end
self:ClearObjects()
@@ -51,6 +53,12 @@ function TOOL:LeftClick( trace )
end
+hook.Add( "EntityRemoved", "nocollide_fix", function( ent )
+ if ( ent:GetClass() == "logic_collision_pair" ) then
+ ent:Input( "EnableCollisions", nil, nil, nil )
+ end
+end )
+
function TOOL:RightClick( trace )
if (!trace.Entity ) then return end
@@ -6,8 +6,8 @@ TOOL.ConfigName = ""
TOOL.ClientConVar[ "force" ] = "1500"
TOOL.ClientConVar[ "model" ] = "models/props_c17/lampShade001a.mdl"
-TOOL.ClientConVar[ "keygroup" ] = "7"
-TOOL.ClientConVar[ "keygroup_back" ] = "4"
+TOOL.ClientConVar[ "keygroup" ] = "45"
+TOOL.ClientConVar[ "keygroup_back" ] = "42"
TOOL.ClientConVar[ "toggle" ] = "0"
TOOL.ClientConVar[ "collision" ] = "0"
TOOL.ClientConVar[ "effect" ] = "fire"
@@ -9,8 +9,8 @@ TOOL.ClientConVar[ "torque" ] = "3000"
TOOL.ClientConVar[ "friction" ] = "1"
TOOL.ClientConVar[ "nocollide" ] = "1"
TOOL.ClientConVar[ "forcelimit" ] = "0"
-TOOL.ClientConVar[ "fwd" ] = "8" -- Forward key
-TOOL.ClientConVar[ "bck" ] = "5" -- Back key
+TOOL.ClientConVar[ "fwd" ] = "45" -- Forward key
+TOOL.ClientConVar[ "bck" ] = "42" -- Back key
TOOL.ClientConVar[ "toggle" ] = "0" -- Togglable
TOOL.ClientConVar[ "model" ] = "models/props_vehicles/carparts_wheel01a.mdl"
TOOL.ClientConVar[ "rx" ] = "90"
@@ -9,8 +9,8 @@ TOOL.ClientConVar[ "rope_material" ] = "cable/rope"
TOOL.ClientConVar[ "rope_width" ] = "3"
TOOL.ClientConVar[ "fwd_speed" ] = "64"
TOOL.ClientConVar[ "bwd_speed" ] = "64"
-TOOL.ClientConVar[ "fwd_group" ] = "8"
-TOOL.ClientConVar[ "bwd_group" ] = "5"
+TOOL.ClientConVar[ "fwd_group" ] = "44"
+TOOL.ClientConVar[ "bwd_group" ] = "41"
function TOOL:LeftClick( trace )

0 comments on commit d40e3a6

Please sign in to comment.