From 87eec886bf0da073fae29c1fbd485e0225626a56 Mon Sep 17 00:00:00 2001 From: AlmTech Date: Wed, 30 Oct 2019 21:17:08 +0100 Subject: [PATCH] Added class label in character selection --- gamemode/engine/derma/menus/menu_character.lua | 18 +++++++++++++++++- gamemode/engine/lib/server/sv_character.lua | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gamemode/engine/derma/menus/menu_character.lua b/gamemode/engine/derma/menus/menu_character.lua index 6f10fda..8a7c1f5 100644 --- a/gamemode/engine/derma/menus/menu_character.lua +++ b/gamemode/engine/derma/menus/menu_character.lua @@ -432,13 +432,29 @@ function menu.open( dt ) txt:SetPos( padding, cpanels[count].h/4 - txtH/2 ) local txtX, txtY = txt:GetPos() + local lvlTxt + if( v.job.level >= 0 ) then + lvlTxt = "Level " .. v.job.level .. " " + else + lvlTxt = "" + end + local lvl = vgui.Create( "DLabel", cpanels[count] ) - lvl:SetText( "Level " .. v.job.level .. " " .. v.job.title ) + lvl:SetText( lvlTxt .. v.job.title ) lvl:SetFont( "q_text2" ) lvl:SetTextColor( Color( 180, 180, 180, 225 ) ) lvl:SizeToContents() local lvlW, lvlH = lvl:GetSize() lvl:SetPos( txtX, txtY + lvlH ) + local lvlX, lvlY = lvl:GetPos() + + local class = vgui.Create( "DLabel", cpanels[count] ) + class:SetText( v.class ) + class:SetFont( "q_text2" ) + class:SetTextColor( Color( 252, 186, 3, 180 ) ) + class:SizeToContents() + local classW, classH = class:GetSize() + class:SetPos( txtX, lvlY + classH ) end if( selectedChar && p.mdl ~= nil ) then diff --git a/gamemode/engine/lib/server/sv_character.lua b/gamemode/engine/lib/server/sv_character.lua index ef4fdfa..79170cc 100644 --- a/gamemode/engine/lib/server/sv_character.lua +++ b/gamemode/engine/lib/server/sv_character.lua @@ -18,7 +18,7 @@ local function CreateCharTable( args ) money = args.money || Quantum.Server.Settings.StarterMoney, inventory = args.inventory || {}, -- create new inventory later jobs = args.jobs || { - [1] = { title = "Hobo", level = -1 }, + [1] = { title = "Unemployed", level = -1 }, }, skills = args.skills || { crafting = 0,