|
|
@ -37,60 +37,120 @@ local pages = { |
|
|
|
p:Remove() |
|
|
|
p:Remove() |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local banner = vgui.Create( "DImage", p ) |
|
|
|
|
|
|
|
banner:SetImage( Quantum.Client.ServerBannerPath ) |
|
|
|
|
|
|
|
banner:SizeToContents() |
|
|
|
|
|
|
|
banner.w, banner.h = banner:GetSize() |
|
|
|
|
|
|
|
banner:SetSize( (banner.w * resScale)/2.8, (banner.h * resScale)/2.8 ) |
|
|
|
|
|
|
|
banner.w, banner.h = banner:GetSize() |
|
|
|
|
|
|
|
banner:SetPos( (p.w - banner.w) + padding*2, 0 ) |
|
|
|
|
|
|
|
|
|
|
|
local ip = vgui.Create( "DPanel", p ) -- input panel |
|
|
|
local ip = vgui.Create( "DPanel", p ) -- input panel |
|
|
|
ip:SetSize( 400 * resScale, p.h * 0.9 ) |
|
|
|
ip:SetSize( 400 * resScale, p.h * 0.9 ) |
|
|
|
ip.w, ip.h = ip:GetSize() |
|
|
|
ip.w, ip.h = ip:GetSize() |
|
|
|
ip:SetPos( padding*4, p.h/2 - ip.h/2 ) |
|
|
|
ip:SetPos( padding*4, p.h/2 - ip.h/2 ) |
|
|
|
ip.Paint = function( self ) theme.blurpanel(self) end |
|
|
|
ip.Paint = function( self ) theme.blurpanel(self) end |
|
|
|
|
|
|
|
ip.x, ip.y = ip:GetPos() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local header = vgui.Create( "DLabel", p ) |
|
|
|
|
|
|
|
header:SetText( "Character Creation" ) |
|
|
|
|
|
|
|
header:SetFont( "q_header" ) |
|
|
|
|
|
|
|
header:SetTextColor( Color( 255, 255, 255, 255 ) ) |
|
|
|
|
|
|
|
header:SizeToContents() |
|
|
|
|
|
|
|
header.w, header.h = header:GetSize() |
|
|
|
|
|
|
|
header:SetPos( (ip.x + ip.w/2) - header.w/2, header.h/2 ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- character model panel |
|
|
|
|
|
|
|
local mdl = vgui.Create( "DModelPanel", p ) |
|
|
|
|
|
|
|
mdl:SetSize( 600 * resScale, 1000 * resScale ) |
|
|
|
|
|
|
|
mdl.w, mdl.h = mdl:GetSize() |
|
|
|
|
|
|
|
mdl:SetPos( p.w/2 - mdl.w/2, p.h/2 - mdl.h/2 ) |
|
|
|
|
|
|
|
mdl:SetFOV( 55 ) |
|
|
|
|
|
|
|
function mdl:LayoutEntity( ent ) return end |
|
|
|
|
|
|
|
|
|
|
|
local inputs = {} |
|
|
|
local inputs = {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local name = vgui.Create( "DTextEntry", p ) |
|
|
|
|
|
|
|
name:SetText( "" ) |
|
|
|
|
|
|
|
name:SetFont( "q_button2" ) |
|
|
|
|
|
|
|
name:SetTextColor( Color( 255, 255, 255, 255 ) ) |
|
|
|
|
|
|
|
name:SetSize( 300 * resScale, 40 * resScale ) |
|
|
|
|
|
|
|
name.w, name.h = name:GetSize() |
|
|
|
|
|
|
|
name:SetPos( p.w/2 - name.w/2, p.h*0.85 - name.h/2 ) |
|
|
|
|
|
|
|
name.Paint = function( self ) |
|
|
|
|
|
|
|
theme.blurpanel( self ) |
|
|
|
|
|
|
|
self:DrawTextEntryText( Color( 255, 255, 255, 255 ), Color( 150, 150, 150, 255 ), Color( 100, 100, 100, 255 ) ) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
--function name:OnChange() inputs.name = self:GetValue() end |
|
|
|
|
|
|
|
|
|
|
|
-- input panel contens -- |
|
|
|
-- input panel contens -- |
|
|
|
local gbuttons = {} |
|
|
|
|
|
|
|
gbuttons.male = vgui.Create( "DButton", ip ) |
|
|
|
|
|
|
|
gbuttons.male:SetText( "M" ) |
|
|
|
|
|
|
|
gbuttons.male:SetTextColor( Color( 0, 0, 0, 255 ) ) |
|
|
|
|
|
|
|
gbuttons.male:SetFont( "q_button2" ) |
|
|
|
|
|
|
|
gbuttons.male:SizeToContents() |
|
|
|
|
|
|
|
gbuttons.male.w, gbuttons.male.h = gbuttons.male:GetSize() |
|
|
|
|
|
|
|
gbuttons.male:SetPos( (ip.w/2 - padding) - gbuttons.male.w/2, ip.h/2 - gbuttons.male.h/2 ) |
|
|
|
|
|
|
|
gbuttons.male.x, gbuttons.male.y = gbuttons.male:GetPos() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local selectedGenderButton = gbuttons.male -- select itself |
|
|
|
local rheader = vgui.Create( "DLabel", ip ) |
|
|
|
|
|
|
|
rheader:SetText("Select Race") |
|
|
|
|
|
|
|
rheader:SetFont( "q_button2" ) |
|
|
|
|
|
|
|
rheader:SetTextColor( Color( 255, 255, 255, 255 ) ) |
|
|
|
|
|
|
|
rheader:SizeToContents() |
|
|
|
|
|
|
|
rheader.w, rheader.h = rheader:GetSize() |
|
|
|
|
|
|
|
rheader:SetPos( ip.w/2 - rheader.w/2, rheader.h ) |
|
|
|
|
|
|
|
rheader.x, rheader.y = rheader:GetPos() |
|
|
|
|
|
|
|
|
|
|
|
gbuttons.male.Paint = function( self, w, h ) |
|
|
|
local gbuttons = {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gbuttons.female = vgui.Create( "DButton", ip ) |
|
|
|
|
|
|
|
local selectedGenderButton = gbuttons.female -- select itself |
|
|
|
|
|
|
|
gbuttons.female:SetText( "Female" ) |
|
|
|
|
|
|
|
gbuttons.female:SetTextColor( Color( 0, 0, 0, 255 ) ) |
|
|
|
|
|
|
|
gbuttons.female:SetFont( "q_button2" ) |
|
|
|
|
|
|
|
gbuttons.female.Paint = function( self, w, h ) |
|
|
|
theme.sharpbutton( self ) |
|
|
|
theme.sharpbutton( self ) |
|
|
|
if( selectedGenderButton == self ) then |
|
|
|
if( selectedGenderButton == self ) then |
|
|
|
surface.SetDrawColor( 100, 100, 100, 100 ) |
|
|
|
surface.SetDrawColor( 100, 100, 100, 100 ) |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
gbuttons.male.DoClick = function( self ) |
|
|
|
gbuttons.female:SizeToContents() |
|
|
|
|
|
|
|
gbuttons.female.w, gbuttons.female.h = gbuttons.female:GetSize() |
|
|
|
|
|
|
|
gbuttons.female:SetPos( padding, rheader.y + gbuttons.female.h + padding ) |
|
|
|
|
|
|
|
gbuttons.female.x, gbuttons.female.y = gbuttons.female:GetPos() |
|
|
|
|
|
|
|
gbuttons.female.DoClick = function( self ) |
|
|
|
|
|
|
|
if( selectedGenderButton ~= self ) then |
|
|
|
selectedGenderButton = self |
|
|
|
selectedGenderButton = self |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
gbuttons.female = vgui.Create( "DButton", ip ) |
|
|
|
gbuttons.male = vgui.Create( "DButton", ip ) |
|
|
|
gbuttons.female:SetText( "F" ) |
|
|
|
gbuttons.male:SetText( "Male" ) |
|
|
|
gbuttons.female:SetTextColor( Color( 0, 0, 0, 255 ) ) |
|
|
|
gbuttons.male:SetTextColor( Color( 0, 0, 0, 255 ) ) |
|
|
|
gbuttons.female:SetFont( "q_button2" ) |
|
|
|
gbuttons.male:SetFont( "q_button2" ) |
|
|
|
gbuttons.female.Paint = function( self, w, h ) |
|
|
|
gbuttons.male:SetSize( gbuttons.female:GetSize() ) |
|
|
|
|
|
|
|
gbuttons.male.w, gbuttons.male.h = gbuttons.male:GetSize() |
|
|
|
|
|
|
|
gbuttons.male:SetPos( (ip.w/2 - padding) - gbuttons.male.w/2, ip.h/2 - gbuttons.male.h/2 ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gbuttons.male.Paint = function( self, w, h ) |
|
|
|
theme.sharpbutton( self ) |
|
|
|
theme.sharpbutton( self ) |
|
|
|
if( selectedGenderButton == self ) then |
|
|
|
if( selectedGenderButton == self ) then |
|
|
|
surface.SetDrawColor( 100, 100, 100, 100 ) |
|
|
|
surface.SetDrawColor( 100, 100, 100, 100 ) |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
surface.DrawRect( 0, 0, w, h ) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
gbuttons.female:SetSize( gbuttons.male:GetSize() ) |
|
|
|
gbuttons.male.DoClick = function( self ) |
|
|
|
gbuttons.female.w, gbuttons.female.h = gbuttons.female:GetSize() |
|
|
|
if( selectedGenderButton ~= self ) then |
|
|
|
gbuttons.female:SetPos( (ip.w/2 + padding) + gbuttons.female.w/2, gbuttons.male.y ) |
|
|
|
|
|
|
|
gbuttons.female.DoClick = function( self ) |
|
|
|
|
|
|
|
selectedGenderButton = self |
|
|
|
selectedGenderButton = self |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
surface.PlaySound( "UI/buttonclick.wav" ) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- set the model |
|
|
|
|
|
|
|
mdl:SetModel( Quantum.Models.Player.Male[1] ) -- set the char model |
|
|
|
|
|
|
|
local minv, maxv = mdl.Entity:GetRenderBounds() |
|
|
|
|
|
|
|
local eyepos = mdl.Entity:GetBonePosition( mdl.Entity:LookupBone( "ValveBiped.Bip01_Head1" ) ) |
|
|
|
|
|
|
|
eyepos:Add( Vector( 40, 0, -15 ) ) |
|
|
|
|
|
|
|
mdl:SetCamPos( eyepos - Vector( -10, 0, -2 ) ) |
|
|
|
|
|
|
|
mdl:SetLookAt( eyepos ) |
|
|
|
|
|
|
|
|
|
|
|
return p, c |
|
|
|
return p, c |
|
|
|
end |
|
|
|
end |
|
|
|
} |
|
|
|
} |
|
|
@ -126,7 +186,7 @@ function menu.open( dt ) |
|
|
|
clist:SetPos( (sw - clist.w) - padding*2, padding*6 ) |
|
|
|
clist:SetPos( (sw - clist.w) - padding*2, padding*6 ) |
|
|
|
clist.x, clist.y = clist:GetPos() |
|
|
|
clist.x, clist.y = clist:GetPos() |
|
|
|
clist.Paint = function( self, w, h ) |
|
|
|
clist.Paint = function( self, w, h ) |
|
|
|
theme.blurpanel( self, Color( 0, 0, 0, 200 ) ) |
|
|
|
theme.blurpanel( self ) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local sbar = clist:GetVBar() |
|
|
|
local sbar = clist:GetVBar() |
|
|
|