spawnmenu.AddToolMenuOption

From GMod Wiki

Jump to: navigation, search
Function
Syntax spawnmenu.AddToolMenuOption( String tab, String category, String itemname, String text, String command, String controls, Function cpanelfunction, Table button )
Where is this used?
Description:
Creates a custom Menu in the spawnmenu.
Returns: nil
Part of Library: spawnmenu
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Spawnmenu.AddToolMenuOption]Spawnmenu.AddToolMenuOption [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionAdds a menu in the Category "Stuff"
Used onNewerClient.png
Code
 
function TheMenu( Panel )
	Panel:ClearControls()
	Panel:AddHeader()
	//Do menu things here
end
 
function createthemenu()
	spawnmenu.AddToolMenuOption( "Options",
			"Stuff",   
			"CustomMenu",  
			 "My Custom Menu",    "",    "",    
			TheMenu,
			{SwitchConVar="sv_cheats"} )
end
hook.Add( "PopulateToolMenu", "pleasework", createthemenu )
 
Outputnothing.


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox