|
|
@ -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,26 +561,34 @@ 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 |
|
|
|
|
|
|
|
-- create char button |
|
|
|
if( table.Count( dt.cont ) < Quantum.CharacterLimit ) then |
|
|
|
local cr = vgui.Create( "DButton", p ) |
|
|
|
-- create char button |
|
|
|
cr:SetText("Create New Character") |
|
|
|
local cr = vgui.Create( "DButton", p ) |
|
|
|
cr:SetFont( "q_button" ) |
|
|
|
cr:SetText("Create New Character") |
|
|
|
cr:SetTextColor( Color( 0, 0, 0, 255 ) ) |
|
|
|
cr:SetFont( "q_button" ) |
|
|
|
cr:SizeToContents() |
|
|
|
cr:SetTextColor( Color( 0, 0, 0, 255 ) ) |
|
|
|
cr.w, cr.h = cr:GetSize() |
|
|
|
cr:SizeToContents() |
|
|
|
cr:SetPos( Quantum.Client.CharMenuList.x + ( Quantum.Client.CharMenuList.w/2 - cr.w/2 ), Quantum.Client.CharMenuList.y + ( ( Quantum.Client.CharMenuList.h - cr.h ) - padding*2 ) ) |
|
|
|
cr.w, cr.h = cr:GetSize() |
|
|
|
cr.Paint = function( self ) |
|
|
|
cr:SetPos( Quantum.Client.CharMenuList.x + ( Quantum.Client.CharMenuList.w/2 - cr.w/2 ), Quantum.Client.CharMenuList.y + ( ( Quantum.Client.CharMenuList.h - cr.h ) - padding*2 ) ) |
|
|
|
theme.sharpbutton( self ) |
|
|
|
cr.Paint = function( self ) |
|
|
|
end |
|
|
|
theme.sharpbutton( self ) |
|
|
|
cr.Think = function( self ) |
|
|
|
end |
|
|
|
if( table.Count(Quantum.Client.Chars) >= Quantum.CharacterLimit ) then |
|
|
|
cr.DoClick = function() |
|
|
|
self:SetVisible( false ) |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
else |
|
|
|
p:SetVisible( false ) |
|
|
|
self:SetVisible( true ) |
|
|
|
local crPage = pages.charCreate( f ) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
cr.DoClick = function() |
|
|
|
|
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
|
|
|
|
p:SetVisible( false ) |
|
|
|
|
|
|
|
local crPage = pages.charCreate( f ) |
|
|
|
|
|
|
|
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 |
|
|
|