Add firemode bar

This commit is contained in:
Fesiug 2023-12-21 03:50:11 -05:00
parent 1b6ba1365c
commit d0cbbf06d4
1 changed files with 25 additions and 21 deletions

View File

@ -334,11 +334,13 @@ function OpenSMenu()
fucker:Dock( TOP ) fucker:Dock( TOP )
fucker:DockMargin( 0, 0, 0, ss(2) ) fucker:DockMargin( 0, 0, 0, ss(2) )
function fucker:Paint( w, h ) function fucker:Paint( w, h )
local hm = WeaponGet( pan_active ) if pan_active then
surface.SetDrawColor( schema("fg") ) local hm = WeaponGet( pan_active )
surface.DrawRect( 0, 0, w, h ) surface.SetDrawColor( schema("fg") )
surface.DrawRect( 0, 0, w, h )
draw.SimpleText( BENNY_GetStat( hm, "Ammo" ) .. " rounds", "Benny_12", ss(2), ss(2), schema_c("bg") ) draw.SimpleText( BENNY_GetStat( hm, "Ammo" ) .. " rounds", "Benny_12", ss(2), ss(2), schema_c("bg") )
end
return true return true
end end
end end
@ -349,27 +351,29 @@ function OpenSMenu()
fucker:Dock( TOP ) fucker:Dock( TOP )
fucker:DockMargin( 0, 0, 0, ss(2) ) fucker:DockMargin( 0, 0, 0, ss(2) )
function fucker:Paint( w, h ) function fucker:Paint( w, h )
local hm = WeaponGet( pan_active ) if pan_active then
surface.SetDrawColor( schema("fg") ) local hm = WeaponGet( pan_active )
surface.DrawRect( 0, 0, w, h ) surface.SetDrawColor( schema("fg") )
surface.DrawRect( 0, 0, w, h )
local fm = BENNY_GetStat( hm, "Firemodes" ) local fm = BENNY_GetStat( hm, "Firemodes" )
local fms = "" local fms = ""
for i,v in ipairs( fm) do for i,v in ipairs( fm) do
local m =v.Mode local m =v.Mode
if m == math.huge then if m == math.huge then
fms = fms .. "AUTO" fms = fms .. "AUTO"
elseif m == 1 then elseif m == 1 then
fms = fms .. "SEMI" fms = fms .. "SEMI"
else else
fms = fms .. m .. "-BURST" fms = fms .. m .. "-BURST"
end end
if i != #fm then if i != #fm then
fms = fms .. " / " fms = fms .. " / "
end
end end
draw.SimpleText( fms, "Benny_12", ss(2), ss(2), schema_c("bg") )
end end
draw.SimpleText( fms, "Benny_12", ss(2), ss(2), schema_c("bg") )
return true return true
end end
end end