I'm not getting an error in the console or anything and all the derma is loaded. However when I actually go to change the tabs, the tool tips (little speech bubbles that come up when you hold the mouse over the tabs) don't say anything and I can't actually change the tabs. Clicking on a different tab does nothing and no error message is received.
cl_init.lua:
[lua]include( 'shared.lua' )
// Clientside only stuff goes here
function ShowTeamMenu()
local DermaPanel = vgui.Create( "DFrame" ) -- Creates the frame itself
DermaPanel:SetPos( 80,80 ) -- Position on the players screen
DermaPanel:SetSize( 800, 600 ) -- Size of the frame
DermaPanel:SetTitle( "Main Menu" ) -- Title of the frame
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false ) -- Draggable by mouse?
DermaPanel:ShowCloseButton( true ) -- Show the close button?
DermaPanel:MakePopup() -- Show the frame
local TestingPanel = vgui.Create( "DPanel", DermaPanel )
TestingPanel:SetPos( 25, 50 )
TestingPanel:SetSize( 750, 50 )
TestingPanel.Paint = function() -- Paint function
surface.SetDrawColor( 50, 50, 50, 255 ) -- Set our rect color below us; we do this so you can see items added to this panel
surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() ) -- Draw the rect
surface.DrawText( "Message of the Day: Zyler Rocks!" )
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( DermaPanel )
PropertySheet:SetPos( 25, 110 )
PropertySheet:SetSize( 750, 315 )
local Welcome = vgui.Create( "DCheckBoxLabel" )
Welcome:SetText( "A" )
local Character = vgui.Create( "DCheckBoxLabel" )
Character:SetText( "B" )
local Props = vgui.Create( "DCheckBoxLabel" )
Props:SetText( "C" )
PropertySheet:AddSheet( "Welcome", Welcome, "gui/silkicons/user", false, false, "Rules and stuff" )
PropertySheet:AddSheet( "Character/Groups", Character, "gui/silkicons/group", false, false, "Manage your character and groups" )
PropertySheet:AddSheet( "Props/Tools", Props, "gui/silkicons/group", false, false, "Get Props and Tools" )
end
end
usermessage.Hook( "call_vgui", ShowTeamMenu )
[/lua]
try creating those GUI stuff outside of your paint function.
Not to mention adding your sheets outside of it.
[QUOTE=LauScript;30556989]try creating those GUI stuff outside of your paint function.
Not to mention adding your sheets outside of it.[/QUOTE]
Outside the function? They're local though.
Can you clarify what you mean exactly, like do you suggest making a new function to put them in or just moving them out of a function altogether.
As far as I can see I want all this stuff to happen when the function is called, how does moving it out of a function without a hook or anything help me?
The function Testing.Panel should be closed (with an end) after
[lua]surface.DrawText( "Message of the Day: Zyler Rocks!" )[/lua]
which is probably what he meant.
(Also means you have to remove the first end at the bottom of the script (Line 44))
Thanks, I just tested it, it works perfectly.
The last thing I want to know is how to add plain text instead of 'tick boxes' on my tab sheets. I tried replacing 'vgui.Create' with 'surface.DrawText', but I dont think that works.
DLabels.
Sorry, you need to Log In to post a reply to this thread.