Improved theme stuff & character classes

master
AlmTech 5 years ago
parent d9a4366d55
commit 1c8a37a29a
  1. 29
      gamemode/engine/derma/menus/menu_character.lua
  2. 6
      gamemode/settings/sh_settings.lua

@ -24,7 +24,13 @@ local function getClassModels( class )
end end
end end
local function getMaxModel( tbl, index ) return tbl[math.Clamp( index, 1, #tbl )] end local function getMaxModel( tbl, index ) return tbl[math.Clamp( index, 1, #tbl )] end
local function renderSelectedButton( b, sel )
if( sel ) then
b:SetTextColor( Color( 252, 248, 212 ) )
else
b:SetTextColor( Color( 255, 255, 255 ) )
end
end
local pages = { local pages = {
charCreate = function( parent ) charCreate = function( parent )
@ -116,10 +122,7 @@ local pages = {
gbuttons.female:SetFont( "q_button2" ) gbuttons.female:SetFont( "q_button2" )
gbuttons.female.Paint = function( self, w, h ) gbuttons.female.Paint = function( self, w, h )
theme.sharpbutton( self ) theme.sharpbutton( self )
if( selectedGenderButton == self ) then renderSelectedButton( self, selectedGenderButton == self )
surface.SetDrawColor( 100, 100, 100, 100 )
surface.DrawRect( 0, 0, w, h )
end
end end
gbuttons.female:SizeToContents() gbuttons.female:SizeToContents()
gbuttons.female.w, gbuttons.female.h = gbuttons.female:GetSize() gbuttons.female.w, gbuttons.female.h = gbuttons.female:GetSize()
@ -144,10 +147,7 @@ local pages = {
gbuttons.male.Paint = function( self, w, h ) gbuttons.male.Paint = function( self, w, h )
theme.sharpbutton( self ) theme.sharpbutton( self )
if( selectedGenderButton == self ) then renderSelectedButton( self, selectedGenderButton == self )
surface.SetDrawColor( 100, 100, 100, 100 )
surface.DrawRect( 0, 0, w, h )
end
end end
gbuttons.male.DoClick = function( self ) gbuttons.male.DoClick = function( self )
if( selectedGenderButton ~= self ) then if( selectedGenderButton ~= self ) then
@ -167,7 +167,7 @@ local pages = {
local classButtons = {} local classButtons = {}
local classCount = 0 local classCount = 0
for n, class in pairs( Quantum.Classes ) do for id, class in pairs( Quantum.Classes ) do
classCount = classCount + 1 -- keep count classCount = classCount + 1 -- keep count
classButtons[classCount] = vgui.Create( "DButton", cscroll ) classButtons[classCount] = vgui.Create( "DButton", cscroll )
classButtons[classCount].class = class classButtons[classCount].class = class
@ -181,8 +181,8 @@ local pages = {
classButtons[classCount]:SetPos( cscroll.w/2 - classButtons[classCount].w/2, (classCount-1) * ( padding + classButtons[classCount].h ) ) classButtons[classCount]:SetPos( cscroll.w/2 - classButtons[classCount].w/2, (classCount-1) * ( padding + classButtons[classCount].h ) )
classButtons[classCount].Paint = function( self ) theme.sharpbutton( self, Color( 0, 0, 0, 0 ) ) end classButtons[classCount].Paint = function( self ) theme.sharpbutton( self, Color( 0, 0, 0, 0 ) ) end
classButtons[classCount].DoClick = function( self ) classButtons[classCount].DoClick = function( self )
if( inputs.class ~= class ) then if( inputs.class ~= id ) then
inputs.class = class inputs.class = id
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
end end
end end
@ -198,8 +198,9 @@ local pages = {
mdl:SetLookAt( eyepos ) mdl:SetLookAt( eyepos )
mdl.Think = function( self ) mdl.Think = function( self )
if( self:GetModel() ~= getMaxModel( getClassModels( inputs.class )[inputs.gender], inputs.modelIndex ) ) then --getClassModels(inputs.class)
self:SetModel( getMaxModel( getClassModels( inputs.class )[inputs.gender], inputs.modelIndex ) ) if( self:GetModel() ~= getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) ) then
self:SetModel( getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) )
end end
end end

@ -29,6 +29,10 @@ Quantum.Models = {
"models/player/group01/female_05.mdl", "models/player/group01/female_05.mdl",
"models/player/group01/female_06.mdl" "models/player/group01/female_06.mdl"
} }
},
Nobleman = {
Male = { "models/player/breen.mdl" },
Female = { "models/player/alyx.mdl" }
} }
} }
} }
@ -42,7 +46,7 @@ Quantum.Classes = {
Nobleman = { Nobleman = {
Name = "Nobleman", Name = "Nobleman",
Desc = "A nobleman is someone who originates from a family of wealth and power and tend to look down upon those who are not 'fit' in their eyes. They often expects everyone to do their bidding without question.", Desc = "A nobleman is someone who originates from a family of wealth and power and tend to look down upon those who are not 'fit' in their eyes. They often expects everyone to do their bidding without question.",
Models = Quantum.Models.Player.Citizen -- change this to better models Models = Quantum.Models.Player.Nobleman -- change this to better models
}, },
Worker = { Worker = {
Name = "Worker", Name = "Worker",

Loading…
Cancel
Save