Garry's Mod Wiki


  spawnmenu.AddContentType( string name, function constructor )


Registers a new content type that is saveable into spawnlists. Created/called by spawnmenu.CreateContentIcon.


1 string name
An unique name of the content type.
2 function constructor
A function that is called whenever we need create a new panel for this content type.

It has two arguments:


A simple header content type.

spawnmenu.AddContentType( "header", function( container, obj ) if ( !obj.text or type(obj.text) != "string" ) then return end local label = vgui.Create( "ContentHeader", container ) label:SetText( obj.text ) container:Add( label ) end )