Revision Difference
Custom_SpawnMenu#544726
<cat>Dev.Lua</cat>
<title>Custom SpawnMenu</title>
# How do I make my own SpawnMenu?
## This requires, at a minimum, accessing all added tabs. You can do this like this:
```lua
for k, v in SortedPairsByMemberValue( spawnmenu.GetCreationTabs(), "Order" ) do
PrintTable( v )
print( k ) -- The tab name
end
```
<example>
<code>
local menu = vgui.Create( "DFrame" )
menu:SetSize( 1000, 550 )
menu:Center()
menu:MakePopup()
local sheet = vgui.Create( "DPropertySheet", menu )
sheet:Dock( FILL )
for k, v in SortedPairsByMemberValue( spawnmenu.GetCreationTabs(), "Order" ) do
local panel = v.Function()
panel:SetParent( sheet )
sheet:AddSheet( k, panel, v.Icon )
end
</code>
<output>
<image src = 'https://i.imgur.com/CZU3dNh.png' alt = 'Autocomplete_showing_several_DarkRP_commands' />
</output>
</example>
## Next you need to access the Tool part:
```lua
for _, tool in ipairs( spawnmenu.GetTools() ) do
for _, category in ipairs( tool.Items ) do
print( category.Text ) -- Category name
for _, item in ipairs( category ) do
print( item.Text ) -- Name of the tool itself
end
end
end
```
The most difficult thing has already been done, it remains only to substitute the VGUI part to these schemes and enjoy your SpawnMenu.
⤶
# Example of a ready-made SpawnMenu⤶
⤶
## SpawnMenu by Freline user:⤶
https://steamcommunity.com/sharedfiles/filedetails/?id=2032678386⤶
⤶
## SpawnMenu by Dan:⤶
https://steamcommunity.com/sharedfiles/filedetails/?id=1782190410