• pop up menu(DAX Flood Mod)
    1 replies, posted
I am working on a menu that pops up when a player joins to educate the player on how to play. The problem with my menu right now is that I can't open, close, & then open again the Collapsible Category's. How do i fix this? [lua] function SpawnMenu() local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 50,50 ) DermaPanel:SetSize( 1000, 700 ) DermaPanel:SetTitle( "Welcome to DAX Flood!" ) // Name of Fram DermaPanel:SetVisible( true ) DermaPanel:SetDraggable( true ) DermaPanel:ShowCloseButton( true ) //Show the X (Close button) /True/False DermaPanel:MakePopup() -------------------------- --About -------------------------- local AboutCollapsibleCategory = vgui.Create("DCollapsibleCategory", DermaPanel) AboutCollapsibleCategory:SetPos( 25,50 ) AboutCollapsibleCategory:SetSize( 200, 50 ) -- Keep the second number at 50 AboutCollapsibleCategory:SetExpanded( 0 ) -- Expanded when popped up AboutCollapsibleCategory:SetLabel( "About DAX Flood" ) -------------------------- --How To Play -------------------------- local HowCollapsibleCategory = vgui.Create("DCollapsibleCategory", DermaPanel) HowCollapsibleCategory:SetPos( 25,105 ) HowCollapsibleCategory:SetSize( 200, 50 ) -- Keep the second number at 50 HowCollapsibleCategory:SetExpanded( 0 ) -- Expanded when popped up HowCollapsibleCategory:SetLabel( "How to Play DAX Flood" ) -------------------------- --About Contents -------------------------- local AboutSheet = vgui.Create( "DPanel" ) -- We create a panel so we can draw stuff on; if we use the frame, it comes up transparent for some reason AboutSheet:SetPos( 10, 10 ) AboutSheet:SetSize( 200, 200 ) AboutSheet.Paint = function() local OurStringThing = "About" -- This was a pain in the ass to figure out; this gets the name of the option chosen surface.SetFont( "default" ) surface.SetTextColor( 255, 255, 255, 255 ) surface.SetTextPos( 50, 50 ) surface.DrawText( OurStringThing ) -- Draws the text end AboutCollapsibleCategory:SetContents( AboutSheet ) -------------------------- --How To Play Contents -------------------------- local HowSheet = vgui.Create( "DPanel" ) -- We create a panel so we can draw stuff on; if we use the frame, it comes up transparent for some reason HowSheet:SetPos( 10, 10 ) HowSheet:SetSize( 200, 200 ) HowSheet.Paint = function() local OurStringThing = "How to Play" -- This was a pain in the ass to figure out; this gets the name of the option chosen surface.SetFont( "default" ) surface.SetTextColor( 255, 255, 255, 255 ) surface.SetTextPos( 50, 50 ) surface.DrawText( OurStringThing ) -- Draws the text end HowCollapsibleCategory:SetContents( HowSheet ) local DermaButton = vgui.Create( "DButton" ) DermaButton:SetParent( DermaPanel ) // Set parent to our "DermaPanel" DermaButton:SetText( "Zombie" ) DermaButton:SetPos( 25, 300 ) DermaButton:SetSize( 150, 50 ) DermaButton.DoClick = function () RunConsoleCommand( "kill" ) // What happens when you press the button end end usermessage.Hook( "call_vgui", SpawnMenu ) [/lua]
anyone know how to use Derma?
Sorry, you need to Log In to post a reply to this thread.