|
|
@ -305,11 +305,11 @@ local pages = { |
|
|
|
local cr = vgui.Create( "DButton", p ) |
|
|
|
local cr = vgui.Create( "DButton", p ) |
|
|
|
cr:SetText( "Create Character" ) |
|
|
|
cr:SetText( "Create Character" ) |
|
|
|
cr:SetFont( "q_button2" ) |
|
|
|
cr:SetFont( "q_button2" ) |
|
|
|
cr:SetTextColor( Color( 0, 0, 0, 255 ) ) |
|
|
|
cr:SetTextColor( Color( 255, 255, 255, 255 ) ) |
|
|
|
cr:SizeToContents() |
|
|
|
cr:SizeToContents() |
|
|
|
cr.w, cr.h = cr:GetSize() |
|
|
|
cr.w, cr.h = cr:GetSize() |
|
|
|
cr:SetPos( name.x + name.w/2 - cr.w/2, name.y + cr.h + padding ) |
|
|
|
cr:SetPos( name.x + name.w/2 - cr.w/2, name.y + cr.h + padding ) |
|
|
|
cr.Paint = function( self ) theme.sharpbutton( self ) end |
|
|
|
cr.Paint = function( self ) theme.sharpblurrbutton( self ) end |
|
|
|
cr.DoClick = function( self ) |
|
|
|
cr.DoClick = function( self ) |
|
|
|
|
|
|
|
|
|
|
|
-- create char |
|
|
|
-- create char |
|
|
@ -366,7 +366,6 @@ end |
|
|
|
menu.charScroll.add = function( chars, clist, p ) |
|
|
|
menu.charScroll.add = function( chars, clist, p ) |
|
|
|
local count = 0 |
|
|
|
local count = 0 |
|
|
|
local cpanels = {} |
|
|
|
local cpanels = {} |
|
|
|
PrintTable(chars) |
|
|
|
|
|
|
|
for k, v in pairs( chars ) do |
|
|
|
for k, v in pairs( chars ) do |
|
|
|
count = count + 1 |
|
|
|
count = count + 1 |
|
|
|
cpanels[count] = vgui.Create( "DButton", clist ) |
|
|
|
cpanels[count] = vgui.Create( "DButton", clist ) |
|
|
@ -380,12 +379,16 @@ menu.charScroll.add = function( chars, clist, p ) |
|
|
|
cpanels[count].w, cpanels[count].h = cpanels[count]:GetSize() |
|
|
|
cpanels[count].w, cpanels[count].h = cpanels[count]:GetSize() |
|
|
|
cpanels[count]:SetPos( padding/2, (padding)*count + (cpanels[count].h * (count-1)) ) |
|
|
|
cpanels[count]:SetPos( padding/2, (padding)*count + (cpanels[count].h * (count-1)) ) |
|
|
|
cpanels[count].Paint = function( self, w, h ) |
|
|
|
cpanels[count].Paint = function( self, w, h ) |
|
|
|
|
|
|
|
|
|
|
|
surface.SetDrawColor( 0, 0, 0, 0 ) |
|
|
|
surface.SetDrawColor( 0, 0, 0, 0 ) |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
|
|
|
|
|
|
|
|
if( self == Quantum.Client.selectedChar ) then |
|
|
|
if( self == Quantum.Client.selectedChar ) then |
|
|
|
surface.SetDrawColor( 252, 186, 3, 100 ) |
|
|
|
surface.SetDrawColor( 252, 186, 3, 100 ) |
|
|
|
surface.DrawOutlinedRect( 0, 0, w, h ) |
|
|
|
else |
|
|
|
|
|
|
|
surface.SetDrawColor( 255, 255, 255, 100 ) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
surface.DrawOutlinedRect( 0, 0, w, h ) |
|
|
|
end |
|
|
|
end |
|
|
|
cpanels[count].DoClick = function( self ) -- if you press the char, then select it |
|
|
|
cpanels[count].DoClick = function( self ) -- if you press the char, then select it |
|
|
|
Quantum.Client.selectedChar = self |
|
|
|
Quantum.Client.selectedChar = self |
|
|
@ -558,8 +561,6 @@ function menu.open( dt ) |
|
|
|
p.mdl:SetCamPos( eyepos - Vector( -10, 0, -2 ) ) |
|
|
|
p.mdl:SetCamPos( eyepos - Vector( -10, 0, -2 ) ) |
|
|
|
p.mdl:SetLookAt( eyepos ) |
|
|
|
p.mdl:SetLookAt( eyepos ) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if( table.Count( dt.cont ) < Quantum.CharacterLimit ) then |
|
|
|
|
|
|
|
-- 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") |
|
|
@ -571,6 +572,13 @@ function menu.open( dt ) |
|
|
|
cr.Paint = function( self ) |
|
|
|
cr.Paint = function( self ) |
|
|
|
theme.sharpbutton( self ) |
|
|
|
theme.sharpbutton( self ) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
cr.Think = function( self ) |
|
|
|
|
|
|
|
if( table.Count(Quantum.Client.Chars) >= Quantum.CharacterLimit ) then |
|
|
|
|
|
|
|
self:SetVisible( false ) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
self:SetVisible( true ) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
cr.DoClick = function() |
|
|
|
cr.DoClick = function() |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
p:SetVisible( false ) |
|
|
|
p:SetVisible( false ) |
|
|
@ -578,6 +586,9 @@ function menu.open( dt ) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
cr.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end |
|
|
|
cr.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( table.Count(Quantum.Client.Chars) >= Quantum.CharacterLimit ) then |
|
|
|
|
|
|
|
cr:SetVisible( false ) -- hide if max chars are set |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
-- Delete char button |
|
|
|
-- Delete char button |
|
|
|