From ed6ed763ed5ab15e80769be7dabe204723bf039a Mon Sep 17 00:00:00 2001 From: Fesiug Date: Mon, 1 Jan 2024 17:56:49 -0500 Subject: [PATCH] UI has commands, spawnmenu dumbed for now --- .../entities/entities/benny_npc_human.lua | 1 - .../benny/gamemode/modules/gui/cl_deadeye.lua | 2 +- .../gamemode/modules/gui/cl_debuginv.lua | 10 ++-- .../gamemode/modules/gui/cl_mainmenu.lua | 8 ++- .../gamemode/modules/gui/cl_settings.lua | 6 ++- .../gamemode/modules/gui/cl_spawnmenu.lua | 51 ++++++++++++++++++- .../benny/gamemode/modules/gui/cl_spscore.lua | 6 ++- 7 files changed, 73 insertions(+), 11 deletions(-) diff --git a/gamemodes/benny/entities/entities/benny_npc_human.lua b/gamemodes/benny/entities/entities/benny_npc_human.lua index 31b2da4..530742a 100644 --- a/gamemodes/benny/entities/entities/benny_npc_human.lua +++ b/gamemodes/benny/entities/entities/benny_npc_human.lua @@ -423,7 +423,6 @@ function ENT:Think() if self:GetState() == "combat" then for ent, data in pairs( self.bEnemyMemory ) do if !IsValid(ent) then - print("wtf") self.bEnemyMemory[ent] = nil continue end diff --git a/gamemodes/benny/gamemode/modules/gui/cl_deadeye.lua b/gamemodes/benny/gamemode/modules/gui/cl_deadeye.lua index fe8a164..d888f22 100644 --- a/gamemodes/benny/gamemode/modules/gui/cl_deadeye.lua +++ b/gamemodes/benny/gamemode/modules/gui/cl_deadeye.lua @@ -411,6 +411,6 @@ end if IsValid( GOD ) then OpenDeadeye() end -concommand.Add("benny_dev_deadeye", function() +concommand.Add("benny_ui_deadeye", function() OpenDeadeye() end) \ No newline at end of file diff --git a/gamemodes/benny/gamemode/modules/gui/cl_debuginv.lua b/gamemodes/benny/gamemode/modules/gui/cl_debuginv.lua index 9834665..fbab68f 100644 --- a/gamemodes/benny/gamemode/modules/gui/cl_debuginv.lua +++ b/gamemodes/benny/gamemode/modules/gui/cl_debuginv.lua @@ -168,9 +168,7 @@ local function regen_items( itemlist ) end end end -concommand.Add("benny_debug_inv", function() - OpenDebugInv() -end) + function OpenDebugInv() if IsValid( base ) then base:Remove() return end base = vgui.Create("BFrame") @@ -184,4 +182,8 @@ function OpenDebugInv() itemlist:Dock( FILL ) regen_items( itemlist ) -end \ No newline at end of file +end + +concommand.Add("benny_ui_inv", function() + OpenDebugInv() +end) \ No newline at end of file diff --git a/gamemodes/benny/gamemode/modules/gui/cl_mainmenu.lua b/gamemodes/benny/gamemode/modules/gui/cl_mainmenu.lua index 0a7cb99..58a5083 100644 --- a/gamemodes/benny/gamemode/modules/gui/cl_mainmenu.lua +++ b/gamemodes/benny/gamemode/modules/gui/cl_mainmenu.lua @@ -68,7 +68,7 @@ function CreateMainMenu() draw.SimpleText( "BENNY", "Benny_72", ss(32), self:GetTall()/2 - ss(58 + (28*0)), schema_c("fg") ) end - local bump = -ss(16) + local bump = -ss(32) for i=#meow, 1, -1 do local label = meow[i] local spacer = label == "" @@ -90,4 +90,8 @@ function CreateMainMenu() bump = bump - (spacer and 12 or (16+4)) end -end \ No newline at end of file +end + +concommand.Add("benny_ui_mainmenu", function() + CreateMainMenu() +end) \ No newline at end of file diff --git a/gamemodes/benny/gamemode/modules/gui/cl_settings.lua b/gamemodes/benny/gamemode/modules/gui/cl_settings.lua index 1c864f3..89c6cdf 100644 --- a/gamemodes/benny/gamemode/modules/gui/cl_settings.lua +++ b/gamemodes/benny/gamemode/modules/gui/cl_settings.lua @@ -76,4 +76,8 @@ function OpenSettingsMenu() genpan( Base, Sect, conf[2] ) end -end \ No newline at end of file +end + +concommand.Add("benny_ui_settings", function() + OpenSettingsMenu() +end) \ No newline at end of file diff --git a/gamemodes/benny/gamemode/modules/gui/cl_spawnmenu.lua b/gamemodes/benny/gamemode/modules/gui/cl_spawnmenu.lua index 2c13657..c36625f 100644 --- a/gamemodes/benny/gamemode/modules/gui/cl_spawnmenu.lua +++ b/gamemodes/benny/gamemode/modules/gui/cl_spawnmenu.lua @@ -266,7 +266,50 @@ function OpenSMenu() surface.DrawOutlinedRect( 0, 0, w, h, ss(0.5) ) end + -- PROTO: Do regen stats. + do + local BAR_NAME = statlist:Add( "DLabel" ) + BAR_NAME:SetTall( ss(18) ) + BAR_NAME:Dock( TOP ) + BAR_NAME:DockMargin( 0, 0, 0, ss(2) ) + function BAR_NAME:Paint( w, h ) + surface.SetDrawColor( schema("fg") ) + surface.DrawRect( 0, 0, w, h ) + + local rang = WeaponGet( pan_active ) + draw.SimpleText( rang.Name, "Benny_18", ss(2), ss(2), schema_c("bg") ) + return true + end + end + + do + local BAR_DESC = statlist:Add( "DLabel" ) + BAR_DESC:SetTall( ss(18) ) + BAR_DESC:Dock( TOP ) + BAR_DESC:DockMargin( 0, 0, 0, ss(2) ) + local lastheight = 0 + function BAR_DESC:Paint( w, h ) + surface.SetDrawColor( schema("fg") ) + surface.DrawRect( 0, 0, w, h ) + + local rang = WeaponGet( pan_active ) + local multiline = multlinetext( rang.Description, w-ss(2), "Benny_12" ) + for i, v in ipairs( multiline ) do + local line = i-1 + local height = ss( 14 + (#multiline-1)*12 ) + if lastheight != height then + BAR_DESC:SetTall( height ) + lastheight = height + end + draw.SimpleText( v, "Benny_12", ss(2), ss(2+12*line), schema_c("bg") ) + end + + return true + end + end + for i, us in ipairs( mewer ) do + do continue end local fucker = statlist:Add( "DLabel" ) fucker:SetTall( ss(us.Size) ) fucker:Dock( TOP ) @@ -334,6 +377,7 @@ function OpenSMenu() fucker:Dock( TOP ) fucker:DockMargin( 0, 0, 0, ss(2) ) function fucker:Paint( w, h ) + do return true end if pan_active then local hm = WeaponGet( pan_active ) surface.SetDrawColor( schema("fg") ) @@ -351,6 +395,7 @@ function OpenSMenu() fucker:Dock( TOP ) fucker:DockMargin( 0, 0, 0, ss(2) ) function fucker:Paint( w, h ) + do return true end if pan_active then local hm = WeaponGet( pan_active ) surface.SetDrawColor( schema("fg") ) @@ -432,4 +477,8 @@ function OpenSMenu() end end -end \ No newline at end of file +end + +concommand.Add("benny_ui_spawnmenu", function() + OpenSMenu() +end) \ No newline at end of file diff --git a/gamemodes/benny/gamemode/modules/gui/cl_spscore.lua b/gamemodes/benny/gamemode/modules/gui/cl_spscore.lua index 220dab2..c25ca78 100644 --- a/gamemodes/benny/gamemode/modules/gui/cl_spscore.lua +++ b/gamemodes/benny/gamemode/modules/gui/cl_spscore.lua @@ -3,4 +3,8 @@ function OpenScorePanel() -end \ No newline at end of file +end + +concommand.Add("benny_ui_score", function() + OpenScorePanel() +end) \ No newline at end of file