Garry's Mod Wiki

spawnmenu.AddToolCategory

  spawnmenu.AddToolCategory( string tab, string RealName, string PrintName )

Description

Used to create a new category in the list inside of a spawnmenu ToolTab.

You must call this function from SANDBOX:AddToolMenuCategories for it to work properly.

Arguments

1 string tab
The ToolTab name, as created with spawnmenu.AddToolTab.

You can also use the default ToolTab names "Main" and "Utilities".

2 string RealName
The identifier name
3 string PrintName
The displayed name

Example

Adds the Constraints category to the Main ToolTab. See lua\includes\modules\spawnmenu.lua.

spawnmenu.AddToolCategory( "Main", "Constraints", "#spawnmenu.tools.constraints" )

Example

Adds the User category to the Utilities ToolTab. See lua\autorun\utilities_menu.lua.

spawnmenu.AddToolCategory( "Utilities", "User", "#spawnmenu.utilities.user" )