Permalink
Browse files

NPC Weapons: move "None" to the top

Prevent it from being buried in the list if it is big enough
  • Loading branch information...
1 parent 0bfdd04 commit 7a48b01280471fde411e93218c215a40f6a6d1d6 @robotboy655 robotboy655 committed Jun 8, 2015
Showing with 16 additions and 17 deletions.
  1. +2 −4 garrysmod/lua/autorun/game_hl2.lua
  2. +14 −13 garrysmod/lua/autorun/menubar.lua
@@ -42,9 +42,8 @@ ADD_ITEM( "Helicopter Grenade", "grenade_helicopter" )
ADD_ITEM( "Zombine Grenade", "npc_grenade_frag" )
if ( IsMounted( "ep2" ) ) then
- game.AddParticles( "particles/striderbuster.pcf" )
- ADD_ITEM( "Magnusson", "weapon_striderbuster" )
- --Find out how to add the other helicopter grenade skin
+ game.AddParticles( "particles/striderbuster.pcf" )
+ ADD_ITEM( "Magnusson", "weapon_striderbuster" )
end
-- Weapons
@@ -68,7 +67,6 @@ Category = "Other"
ADD_WEAPON( "Physics Gun", "weapon_physgun" )
-- NPC Weapons
-list.Add( "NPCUsableWeapons", { class = "none", title = "None" } )
list.Add( "NPCUsableWeapons", { class = "weapon_stunstick", title = "Stunstick" } )
list.Add( "NPCUsableWeapons", { class = "weapon_crowbar", title = "Crowbar" } )
list.Add( "NPCUsableWeapons", { class = "weapon_pistol", title = "Pistol" } )
@@ -8,12 +8,12 @@ if ( SERVER ) then return end
hook.Add( "PopulateMenuBar", "DisplayOptions_MenuBar", function( menubar )
local m = menubar:AddOrGetMenu( "Drawing" )
-
+
m:AddCVar( "Physgun Grab Halo", "physgun_halo", "1", "0" )
m:AddCVar( "Physgun Beams", "physgun_drawbeams", "1", "0" )
-
+
m:AddSpacer()
-
+
m:AddCVar( "Draw HUD", "cl_drawhud", "1", "0" )
m:AddCVar( "Draw Freeze", "effects_freeze", "1", "0" )
m:AddCVar( "Draw Cameras", "cl_drawcameras", "1", "0" )
@@ -23,22 +23,22 @@ hook.Add( "PopulateMenuBar", "DisplayOptions_MenuBar", function( menubar )
m:AddCVar( "Draw Effect Rings", "cl_draweffectrings", "1", "0" )
m:AddCVar( "Draw Spawn Effect", "cl_drawspawneffect", "1", "0" )
m:AddCVar( "Draw World Tooltips", "cl_drawworldtooltips", "1", "0" )
-
+
m:AddSpacer()
-
+
m:AddCVar( "Draw Shadows", "r_shadows", "1", "0" )
m:AddCVar( "Detail Props", "r_drawdetailprops", "1", "0" )
-
+
m:AddSpacer()
-
+
m:AddCVar( "Show FPS", "cl_showfps", "1", "0" )
m:AddCVar( "Minecraftify", "mat_showlowresimage", "1", "0", function() timer.Simple( 0.1, function() RunConsoleCommand( "mat_reloadallmaterials" ) end ) end )
m:AddCVar( "Wireframe", "mat_wireframe", "1", "0" )
-
- m:AddSpacer()
-
+
+ m:AddSpacer()
+
m:AddCVar( "Hints", "cl_showhints", "1", "0" )
-
+
end )
-- AI Options
@@ -56,12 +56,13 @@ hook.Add( "PopulateMenuBar", "NPCOptions_MenuBar", function( menubar )
weapons:SetDeleteSelf( false )
weapons:AddCVar( "Default Weapon", "gmod_npcweapon", "" )
+ weapons:AddCVar( "#None", "gmod_npcweapon", "none" )
weapons:AddSpacer()
for _, v in pairs( list.Get( "NPCUsableWeapons" ) ) do
-
+
weapons:AddCVar( v.title, "gmod_npcweapon", v.class )
-
+
end
end )

0 comments on commit 7a48b01

Please sign in to comment.