From c3461ec7c935e521db79a4789c25e621dc2cbcf6 Mon Sep 17 00:00:00 2001 From: Fesiug Date: Sat, 11 Nov 2023 21:44:04 -0500 Subject: [PATCH] Ammo HUD changes --- .../benny/gamemode/modules/player/cl_hud.lua | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/gamemodes/benny/gamemode/modules/player/cl_hud.lua b/gamemodes/benny/gamemode/modules/player/cl_hud.lua index 0f49e9d..c08be18 100644 --- a/gamemodes/benny/gamemode/modules/player/cl_hud.lua +++ b/gamemodes/benny/gamemode/modules/player/cl_hud.lua @@ -275,32 +275,41 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function() surface.DrawText( text ) local bx = 1 - local by = 0 local count = math.max( wep:Clip1(), wep:BClass( false ).Ammo ) - local size = ss(8) + local size = ss(10) + local by = ss(2) if count>90 then size = ss(2) - by = by - ss(9-3) + by = -ss(6) elseif count>60 then size = ss(2) - by = by - ss(6) + by = -ss(6) elseif count>30 then - size = ss(3) - by = by - ss(5) + size = ss(4) + by = -ss(4) end for i=1, count do surface.SetDrawColor( scheme["fg"] ) - surface.DrawOutlinedRect( sw - b - ss(3+4) - ( ss(5) * (bx-1) ), sh - b - ss(8+4) - by, ss(3), size, ss(0.5) ) + local a_x, a_y = sw - b - ss(3+4) - ( ss(5) * (bx-1) ), sh - b - ss(8+4) - by, ss(3) + if count>90 then + -- surface.DrawLine( a_x, a_y, a_x, a_y + size ) + surface.DrawLine( a_x, a_y, a_x, a_y + size ) + surface.DrawLine( a_x + ss(2)+1, a_y, a_x + ss(2)+1, a_y + size ) + else + surface.DrawOutlinedRect( a_x, a_y, ss(3), size, ss(0.5) ) + end if i <= wep:Clip1() then - surface.DrawRect( sw - b - ss(3+4) - ( ss(5) * (bx-1) ), sh - b - ss(8+4) - by, ss(3), size ) + surface.DrawRect( a_x, a_y, ss(3), size ) end if i%30 == 0 then if count>90 then by = by + ss(3) elseif count>60 then - by = by + ss(3) + by = by + ss(4) + elseif count>30 then + by = by + ss(6) else - by = by + ss(5) + by = by + ss(10) end bx = 0 end @@ -670,7 +679,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function() surface.DrawRect( r_x, r_y, r_w, r_h ) do -- Time - local tt = string.FormattedTime( (CurTime() % 60) ) + local tt = string.FormattedTime( 60-(CurTime() % 60) ) local d1, d2 if tt.m > 0 then d1 = tt.m -- .. ":" @@ -680,7 +689,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function() end else d1 = tt.s -- .. "." - d2 = math.Round( tt.ms ) + d2 = math.floor( tt.ms ) end d1 = string.format( "%02i", d1 ) @@ -720,9 +729,9 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function() surface.SetFont( "Benny_12") surface.SetTextPos( s_x + ss(2), s_y + ss(1) ) - surface.DrawText( i==1 and "PLASOF" or "CIA" ) + surface.DrawText( i==1 and "HALO" or "CIA" ) - local score = "12000" + local score = i==1 and "100" or "12000" surface.SetTextPos( s_x + s_w - surface.GetTextSize( score ) - ss(2), s_y + ss(1) ) surface.DrawText( score ) end