Character creation stuff

master
AlmTech 5 years ago
parent 25ddf37908
commit cb0bb65ea2
  1. 5
      gamemode/engine/derma/lib/cl_menu_theme.lua
  2. 29
      gamemode/engine/derma/menus/menu_character.lua

@ -58,8 +58,9 @@ function theme.button( b, color )
draw.RoundedBox( 4, padding_s/2, padding_s/2, w - padding_s, h - padding_s, clr ) -- inner draw.RoundedBox( 4, padding_s/2, padding_s/2, w - padding_s, h - padding_s, clr ) -- inner
end end
function theme.sharpbutton( b ) function theme.sharpbutton( b, inClr )
local w, h = b:GetSize() local w, h = b:GetSize()
inClr = inClr || Color( 235, 64, 52, 255 )
if( b:IsHovered() ) then if( b:IsHovered() ) then
surface.SetDrawColor( 205, 205, 205, 255 ) surface.SetDrawColor( 205, 205, 205, 255 )
@ -70,7 +71,7 @@ function theme.sharpbutton( b )
surface.DrawRect( 0, 0, w, h ) surface.DrawRect( 0, 0, w, h )
surface.SetDrawColor( 235, 64, 52, 255 ) surface.SetDrawColor( inClr )
surface.DrawRect( padding_s/2, padding_s/2, w - padding_s, h - padding_s ) surface.DrawRect( padding_s/2, padding_s/2, w - padding_s, h - padding_s )
end end

@ -47,8 +47,37 @@ local pages = {
local inputs = {} local inputs = {}
-- 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_button" )
gbuttons.male:SizeToContents()
gbuttons.male.w, gbuttons.male.h = gbuttons.male:GetSize()
gbuttons.male:SetPos( 0, 0 )
local selectedGenderButton = gbuttons.male -- select itself
gbuttons.male.Paint = function( self )
if( selectedGenderButton == self ) then
theme.sharpbutton( self, Color( 255, 255, 255 ) )
end
end
gbuttons.female = vgui.Create( "DButton", ip )
gbuttons.female:SetText( "F" )
gbuttons.female:SetTextColor( Color( 0, 0, 0, 255 ) )
gbuttons.female:SetFont( "q_button" )
gbuttons.female.Paint = function( self ) theme.sharpbutton( self ) end
gbuttons.female:SizeToContents()
gbuttons.female.w, gbuttons.female.h = gbuttons.female:GetSize()
gbuttons.female:SetPos( 50, 0 )
gbuttons.female.DoClick = function( self )
end
return p, c return p, c
end end

Loading…
Cancel
Save