So basically when i type derma_menu in console and submit it, the menu shows up, but when i submit derma_menu again nothing seems to happen (unless you moved the first derma menu), but when i moved the derma menu there was two of them, i tried it a third time and now there was three derma menus, i want it so that when you submit derm_menu in console it opens the derma menu and when you submit it again it closes/removes the derma menu, and when you submit it again it opens the derma menu, pretty much like a toggle.
Man thats alot of "derma menu", lol :P Thank You for your help!
Code:
local function DrawMenu()
local frame = vgui.Create("DFrame")
frame:SetSize(1110, 650)
frame:Center()
frame:SetTitle("")
frame:MakePopup()
frame:SetVisible(true)
frame:ShowCloseButton(false)
frame:SetDraggable(true)
local button = vgui.Create("DButton", frame)
button:SetFont('marlett')
button:SetText('r')
button:SetColor(Color(20, 20, 20))
button:SetSize(15, 15)
button:SetDrawBackground(false)
button:SetPos(frame:GetWide() - 20, 5)
button.DoClick = function()
frame:Remove()
end
end
concommand.Add("derma_menu", DrawMenu)