Code |
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 200, 250 )
DermaPanel:SetTitle( "Testing Derma Stuff" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
local MenuButton = vgui.Create("DButton")
MenuButton:SetParent( DermaPanel )
MenuButton:SetText( "Menu >" )
MenuButton:SetPos(25, 50)
MenuButton:SetSize( 150, 175 )
function MenuButton:DoClick()
local Menu = DermaMenu()
for _,ply in pairs(player.GetAll()) do
Menu:AddOption(ply:Name(),function() print(ply:Name()) end)
end
MenuButtonOptions:Open() -- Open the menu AFTER adding your options
end
|