|
|
@ -11,17 +11,17 @@ local net = Quantum.Client.Menu.GetAPI( "net" ) |
|
|
|
local page = Quantum.Client.Menu.GetAPI( "page" ) |
|
|
|
local page = Quantum.Client.Menu.GetAPI( "page" ) |
|
|
|
|
|
|
|
|
|
|
|
local resScale = Quantum.Client.ResolutionScale |
|
|
|
local resScale = Quantum.Client.ResolutionScale |
|
|
|
|
|
|
|
local sw, sh = ScrW(), ScrH() |
|
|
|
|
|
|
|
local padding = 10 * resScale |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local pages = { |
|
|
|
local pages = { |
|
|
|
charSelect = function() |
|
|
|
charSelect = function( parent ) |
|
|
|
local args = { |
|
|
|
local args = { |
|
|
|
CloseButtonPaint = function( self, w, h ) |
|
|
|
CloseButtonText = "Back", |
|
|
|
surface.SetDrawColor( 100, 100, 100, 255 ) |
|
|
|
CloseButtonFont = "q_text", |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
|
|
|
|
end, |
|
|
|
|
|
|
|
OnClose = function() print("close test") end |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
local p = page.New( args ) |
|
|
|
local p, c = page.New( parent, args ) |
|
|
|
|
|
|
|
|
|
|
|
local clist = vgui.Create( "DPanel", p ) |
|
|
|
local clist = vgui.Create( "DPanel", p ) |
|
|
|
clist:SetSize( 200 * resScale, sh - padding*10 ) |
|
|
|
clist:SetSize( 200 * resScale, sh - padding*10 ) |
|
|
@ -32,13 +32,26 @@ local pages = { |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return p |
|
|
|
|
|
|
|
end, |
|
|
|
|
|
|
|
charCreate = function( parent ) |
|
|
|
|
|
|
|
local pW, pH = parent:GetSize() |
|
|
|
|
|
|
|
local args = { |
|
|
|
|
|
|
|
CloseButtonText = "Return", |
|
|
|
|
|
|
|
CloseButtonFont = "q_text", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
local p, c = page.New( parent, args ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c:SetSize( 85 * resScale, 25 * resScale ) |
|
|
|
|
|
|
|
local closeW, closeH = c:GetSize() |
|
|
|
|
|
|
|
c:SetPos( padding*4, (pH - closeH) - padding*4 ) |
|
|
|
|
|
|
|
|
|
|
|
return p |
|
|
|
return p |
|
|
|
end |
|
|
|
end |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function menu.open( dt ) |
|
|
|
function menu.open( dt ) |
|
|
|
local sw, sh = ScrW(), ScrH() |
|
|
|
|
|
|
|
local padding = 10 * resScale |
|
|
|
|
|
|
|
if( !f ) then |
|
|
|
if( !f ) then |
|
|
|
local f = vgui.Create( "DFrame" ) |
|
|
|
local f = vgui.Create( "DFrame" ) |
|
|
|
f:SetTitle( "Character Menu" ) |
|
|
|
f:SetTitle( "Character Menu" ) |
|
|
@ -47,27 +60,10 @@ function menu.open( dt ) |
|
|
|
surface.SetDrawColor( 0, 0, 0, 190 ) |
|
|
|
surface.SetDrawColor( 0, 0, 0, 190 ) |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
f:IsDraggable( false ) |
|
|
|
f:MakePopup() |
|
|
|
f:MakePopup() |
|
|
|
|
|
|
|
|
|
|
|
pages.charSelect() -- test |
|
|
|
local char = pages.charCreate( f ) -- test |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- local txt = vgui.Create( "DTextEntry", f ) |
|
|
|
|
|
|
|
-- txt:SetText( "Enter name here" ) |
|
|
|
|
|
|
|
-- txt:SetSize( 250, 25 ) |
|
|
|
|
|
|
|
-- local txtW, txtH = txt:GetSize() |
|
|
|
|
|
|
|
-- txt:SetPos( sw/2 - txtW/2, sh/2 - txtH/2 ) |
|
|
|
|
|
|
|
-- local txtX, txtY = txt:GetPos() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- local b = vgui.Create( "DButton", f ) |
|
|
|
|
|
|
|
-- b:SetText( "Create Char" ) |
|
|
|
|
|
|
|
-- b:SizeToContents() |
|
|
|
|
|
|
|
-- local bW, bH = b:GetSize() |
|
|
|
|
|
|
|
-- b:SetPos( sw/2 - bW/2, txtY - bH ) |
|
|
|
|
|
|
|
-- b.DoClick = function() |
|
|
|
|
|
|
|
-- net.RunNetworkedFunc( "createChar", { name = txt:GetValue() } ) |
|
|
|
|
|
|
|
-- end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|