spawnmenu.AddToolMenuOption
spawnmenu.AddToolMenuOption( string tab, string category, string class, string name, string cmd, string config, function cpanel, table table = {} )
Description
Adds an option to the right side of the spawnmenu
Arguments
6 string config
Config name, used in older versions to load tool settings UI from a file. No longer works.
We advise against using this. It may be changed or removed in a future update.
8 table table = {}
Allows to override the table that will be added to the tool list. Some of the fields will be overwritten by this function.
Example
Adds a new option to the menu with a slider to change the gravity
hook.Add( "AddToolMenuCategories", "CustomCategory", function()
spawnmenu.AddToolCategory( "Utilities", "Stuff", "#Stuff" )
end )
hook.Add( "PopulateToolMenu", "CustomMenuSettings", function()
spawnmenu.AddToolMenuOption( "Utilities", "Stuff", "Custom_Menu", "#My Custom Menu", "", "", function( panel )
panel:ClearControls()
panel:NumSlider( "Gravity", "sv_gravity", 0, 600 )
-- Add stuff here
end )
end )
Output: 
