Garry's Mod Wiki

Revision Difference

spawnmenu.AddToolTab#512862

<function name="AddToolTab" parent="spawnmenu" type="libraryfunc">⤶ <description>⤶ Adds a new tool tab to the right side of the spawnmenu via the <page>SANDBOX:AddToolMenuTabs</page> hook.⤶ ⤶ This function is a inferior duplicate of <page>spawnmenu.GetToolMenu</page>, just without its return value.⤶ </description>⤶ <realm>Client</realm>⤶ <args>⤶ <arg name="name" type="string">The internal name of the tab. This is used for sorting.</arg>⤶ <arg name="label" type="string" default="name">The &#x27;nice&#x27; name of the tab (Tip: &lt;page&gt;language.Add&lt;/page&gt;)</arg>⤶ <arg name="icon" type="string" default="icon16/wrench.png">The filepath to the icon of the tab. Should be a .png</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Creates a new tab named, "Tab name!" with a unique name and a wrench icon.</description>⤶ <code>⤶ hook.Add( "AddToolMenuTabs", "myHookClass", function()⤶ spawnmenu.AddToolTab( "Tab name!", "#Unique_Name", "icon16/wrench.png" )⤶ end )⤶ </code>⤶ ⤶ </example>