ContentIcon
Description
The spawn icon used for SWEPs and other SENTs, commonly featured as part of the spawn menu. Do note that at least one of your ContentIcon's parents must either be an EditablePanel or derived from it (like a DFrame, for example), else it won't be able to focus and thus be unclickable.
This control only exists in Sandbox derived gamemodes.
Parent
Derives methods, etc not listed on this page from DButton.
Methods
string ContentIcon:GetContentType()
An AccessorFunc that returns the content type used to save and restore the content icon in a spawnlist.
table ContentIcon:GetNPCWeapon()
An AccessorFunc that returns a table of weapon classes for the content icon with "NPC" content type to be randomly chosen from when user tries to spawn the NPC.
string ContentIcon:GetSpawnName()
An AccessorFunc that returns the internal "name" for the content icon, usually a class name for an entity.
ContentIcon:OpenMenu()
A hook for override, by default does nothing. Called when user right clicks on the content icon, you are supposed to open a DermaMenu here with additional options.
ContentIcon:SetAdminOnly( boolean adminOnly )
An AccessorFunc that sets whether the content item is admin only. This makes the icon to display a admin icon in the top left corner of the icon.
An AccessorFunc that sets the color for the content icon. Currently is not used by the content icon panel.
ContentIcon:SetContentType( string type )
An AccessorFunc that sets the content type used to save and restore the content icon in a spawnlist.
ContentIcon:SetMaterial( string path )
Sets the material to be displayed as the content icon.
Sets the tool tip and the "nice" name to be displayed by the content icon.
ContentIcon:SetNPCWeapon( table weapons )
An AccessorFunc that sets a table of weapon classes for the content icon with "NPC" content type to be randomly chosen from when user tries to spawn the NPC.
ContentIcon:SetSpawnName( string name )
An AccessorFunc that sets the internal "name" for the content icon, usually a class name for an entity.
Example
Creates a button to spawn one or multiple pistols on top of a custom DFrame.
Output: