Garry's Mod Wiki

Revision Difference

spawnmenu.AddToolCategory#512864

<function name="AddToolCategory" parent="spawnmenu" type="libraryfunc">⤶ <description>⤶ Used to create a new category in the list inside of a spawnmenu ToolTab.⤶ ⤶ You must call this function from <page>SANDBOX:AddToolMenuCategories</page> for it to work properly.⤶ </description>⤶ <realm>Client</realm>⤶ <args>⤶ <arg name="tab" type="string">The ToolTab name, as created with &lt;page&gt;spawnmenu.AddToolTab&lt;/page&gt;.&#xA;&#xA;You can also use the default ToolTab names &quot;Main&quot; and &quot;Utilities&quot;.</arg>⤶ <arg name="RealName" type="string">The identifier name</arg>⤶ <arg name="PrintName" type="string">The displayed name</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Adds the Constraints category to the Main ToolTab. See `lua\includes\modules\spawnmenu.lua`.</description>⤶ <code>spawnmenu.AddToolCategory( "Main", "Constraints", "#spawnmenu.tools.constraints" )</code>⤶ ⤶ </example>⤶ ⤶ ⤶ <example>⤶ <description>Adds the User category to the Utilities ToolTab. See `lua\autorun\utilities_menu.lua`.</description>⤶ <code>spawnmenu.AddToolCategory( "Utilities", "User", "#spawnmenu.utilities.user" )</code>⤶ ⤶ </example>