|
|
@ -18,12 +18,51 @@ local padding_s = 4 * resScale |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local pages = { |
|
|
|
local pages = { |
|
|
|
charSelect = function( parent ) |
|
|
|
charCreate = function( parent ) |
|
|
|
|
|
|
|
local pW, pH = parent:GetSize() |
|
|
|
local args = { |
|
|
|
local args = { |
|
|
|
CloseButtonText = "Quit", |
|
|
|
CloseButtonText = "Return", |
|
|
|
CloseButtonFont = "q_text2" |
|
|
|
CloseButtonFont = "q_text", |
|
|
|
} |
|
|
|
} |
|
|
|
local p, c = page.New( parent, args ) |
|
|
|
local p, c = page.New( parent, args ) |
|
|
|
|
|
|
|
p:SetVisible( true ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c:SetSize( 85 * resScale, 25 * resScale ) |
|
|
|
|
|
|
|
local closeW, closeH = c:GetSize() |
|
|
|
|
|
|
|
c:SetPos( padding*4, (pH - closeH) - padding*4 ) |
|
|
|
|
|
|
|
c.DoClick = function() |
|
|
|
|
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
|
|
|
|
parent.page:SetVisible( true ) |
|
|
|
|
|
|
|
p:Remove() |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return p, c |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function menu.open( dt ) |
|
|
|
|
|
|
|
Quantum.Client.IsInMenu = true -- hide the hud |
|
|
|
|
|
|
|
if( !f ) then |
|
|
|
|
|
|
|
local f = vgui.Create( "DFrame" ) |
|
|
|
|
|
|
|
f:SetTitle( "" ) |
|
|
|
|
|
|
|
f:SetSize( sw, sh ) |
|
|
|
|
|
|
|
f.Paint = function( self, w, h ) |
|
|
|
|
|
|
|
surface.SetDrawColor( 0, 0, 0, 120 ) |
|
|
|
|
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
f:SetDraggable( false ) |
|
|
|
|
|
|
|
f:MakePopup() |
|
|
|
|
|
|
|
function f:OnClose() |
|
|
|
|
|
|
|
Quantum.Client.IsInMenu = false -- show the hud when closed |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local args = { |
|
|
|
|
|
|
|
CloseButtonText = "Quit", |
|
|
|
|
|
|
|
CloseButtonFont = "q_text" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
local p, c = page.New( f, args ) |
|
|
|
|
|
|
|
f.page = p |
|
|
|
|
|
|
|
f.page:SetVisible( true ) |
|
|
|
|
|
|
|
|
|
|
|
local clist = vgui.Create( "DScrollPanel", p ) |
|
|
|
local clist = vgui.Create( "DScrollPanel", p ) |
|
|
|
clist:SetSize( 380 * resScale, sh - padding*15 ) |
|
|
|
clist:SetSize( 380 * resScale, sh - padding*15 ) |
|
|
@ -43,7 +82,7 @@ local pages = { |
|
|
|
c.Paint = function( self ) theme.button( self ) end |
|
|
|
c.Paint = function( self ) theme.button( self ) end |
|
|
|
c.DoClick = function() |
|
|
|
c.DoClick = function() |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
parent:Close() |
|
|
|
f:Close() |
|
|
|
end |
|
|
|
end |
|
|
|
--- |
|
|
|
--- |
|
|
|
|
|
|
|
|
|
|
@ -109,54 +148,22 @@ local pages = { |
|
|
|
-- create char button |
|
|
|
-- create char button |
|
|
|
local cr = vgui.Create( "DButton", p ) |
|
|
|
local cr = vgui.Create( "DButton", p ) |
|
|
|
cr:SetText("Create New Character") |
|
|
|
cr:SetText("Create New Character") |
|
|
|
cr:SetFont( "q_text2" ) |
|
|
|
cr:SetFont( "q_text" ) |
|
|
|
cr:SetTextColor( Color( 0, 0, 0, 255 ) ) |
|
|
|
cr:SetTextColor( Color( 0, 0, 0, 255 ) ) |
|
|
|
cr:SizeToContents() |
|
|
|
cr:SizeToContents() |
|
|
|
cr.w, cr.h = cr:GetSize() |
|
|
|
cr.w, cr.h = cr:GetSize() |
|
|
|
cr:SetPos( clist.x + ( clist.w/2 - cr.w/2 ), clist.y + ( ( clist.h - cr.h ) - padding*2 ) ) |
|
|
|
cr:SetPos( clist.x + ( clist.w/2 - cr.w/2 ), clist.y + ( ( clist.h - cr.h ) - padding*2 ) ) |
|
|
|
cr.Paint = function( self ) |
|
|
|
cr.Paint = function( self ) |
|
|
|
theme.button( self ) |
|
|
|
theme.sharpbutton( self ) |
|
|
|
end |
|
|
|
end |
|
|
|
cr.DoClick = function() |
|
|
|
cr.DoClick = function() |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
|
|
|
|
p:SetVisible( false ) |
|
|
|
|
|
|
|
local crPage = pages.charCreate( f ) |
|
|
|
end |
|
|
|
end |
|
|
|
cr.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) 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 |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function menu.open( dt ) |
|
|
|
cr.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end |
|
|
|
Quantum.Client.IsInMenu = true -- hide the hud |
|
|
|
|
|
|
|
if( !f ) then |
|
|
|
|
|
|
|
local f = vgui.Create( "DFrame" ) |
|
|
|
|
|
|
|
f:SetTitle( "Character Menu" ) |
|
|
|
|
|
|
|
f:SetSize( sw, sh ) |
|
|
|
|
|
|
|
f.Paint = function( self, w, h ) |
|
|
|
|
|
|
|
surface.SetDrawColor( 0, 0, 0, 120 ) |
|
|
|
|
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
f:SetDraggable( false ) |
|
|
|
|
|
|
|
f:MakePopup() |
|
|
|
|
|
|
|
function f:OnClose() |
|
|
|
|
|
|
|
Quantum.Client.IsInMenu = false -- show the hud when closed |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local charSel = pages.charSelect( f ) -- test |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|