spawnmenu.AddCreationTab

From Garry's Mod
Jump to: navigation, search
 spawnmenu.AddCreationTab( )

Contents

Description

Inserts a new tab into the CreationMenus table, which will be used by the creation menu to generate its tabs (Spawnlists, Weapons, Entities, etc.)

Arguments

string name

What text will appear on the tab (I.E Spawnlists).

Arguments

function function

The function called to generate the content of the tab.

Arguments

string material="icon16/exclamation.png"

Path to the material that will be used as an icon on the tab.

Arguments

number order=1000

The order in which this tab should be shown relative to the other tabs on the creation menu.

Arguments

string tooltip=nil

The tooltip to be shown for this tab.

Examples

Example

An excerpt from the Dupe creation menu tab.

spawnmenu.AddCreationTab( "#spawnmenu.category.dupes", function()

    HTML = vgui.Create( "DHTML" );
        JS_Language( HTML )
        HTML:SetAllowLua( true );
        HTML:OpenURL( "asset://garrysmod/html/dupes.html" );
        HTML:Call( "SetDupeSaveState( " .. tostring( DupeInClipboard ).. " );" );        

    return HTML

end, "icon16/control_repeat_blue.png", 200 )

Output:

A new tab named "Dupes" will be placed in the creation menu.
Personal tools
Navigation