Fixes and checks

This commit is contained in:
Fesiug 2024-01-08 03:39:20 -05:00
parent 0188306894
commit 9779bf5b48
2 changed files with 23 additions and 18 deletions

View File

@ -276,8 +276,10 @@ function OpenSMenu()
surface.SetDrawColor( schema("fg") ) surface.SetDrawColor( schema("fg") )
surface.DrawRect( 0, 0, w, h ) surface.DrawRect( 0, 0, w, h )
if pan_active then
local rang = WeaponGet( pan_active ) local rang = WeaponGet( pan_active )
draw.SimpleText( rang.Name, "Benny_18", ss(2), ss(2), schema_c("bg") ) draw.SimpleText( rang.Name, "Benny_18", ss(2), ss(2), schema_c("bg") )
end
return true return true
end end
end end
@ -292,6 +294,7 @@ function OpenSMenu()
surface.SetDrawColor( schema("fg") ) surface.SetDrawColor( schema("fg") )
surface.DrawRect( 0, 0, w, h ) surface.DrawRect( 0, 0, w, h )
if pan_active then
local rang = WeaponGet( pan_active ) local rang = WeaponGet( pan_active )
local multiline = multlinetext( rang.Description, w-ss(2), "Benny_12" ) local multiline = multlinetext( rang.Description, w-ss(2), "Benny_12" )
for i, v in ipairs( multiline ) do for i, v in ipairs( multiline ) do
@ -303,6 +306,7 @@ function OpenSMenu()
end end
draw.SimpleText( v, "Benny_12", ss(2), ss(2+12*line), schema_c("bg") ) draw.SimpleText( v, "Benny_12", ss(2), ss(2+12*line), schema_c("bg") )
end end
end
return true return true
end end
@ -455,8 +459,12 @@ function OpenSMenu()
end end
function button:DoRightClick() function button:DoRightClick()
if ItemDef("mag_"..New.ClassName) then
RunConsoleCommand( "benny_debug_give", "mag_" .. New.ClassName ) RunConsoleCommand( "benny_debug_give", "mag_" .. New.ClassName )
chat.AddText( "Gave " .. WeaponGet("mag_"..New.ClassName).Name ) chat.AddText( "Gave " .. ItemDef("mag_"..New.ClassName).Name )
else
chat.AddText( "That item doesn't exist. " .. "mag_"..New.ClassName )
end
end end
function button:Think() function button:Think()

View File

@ -290,14 +290,12 @@ local col_1a = Color(100, 100, 255, 200)
local col_2 = Color(0, 0, 0, 255) local col_2 = Color(0, 0, 0, 255)
local col_3 = Color(255, 127, 127, 255) local col_3 = Color(255, 127, 127, 255)
local col_4 = Color(255, 222, 222, 255) local col_4 = Color(255, 222, 222, 255)
local heartbeatcol = Color(255, 255, 255, 255)
local mat_dot = Material("benny/hud/xhair/dotx.png", "smooth") local mat_dot = Material("benny/hud/xhair/dotx.png", "smooth")
local mat_long = Material("benny/hud/xhair/long.png", "smooth") local mat_long = Material("benny/hud/xhair/long.png", "smooth")
local mat_dot_s = Material("benny/hud/xhair/dot_s.png", "mips smooth") local mat_dot_s = Material("benny/hud/xhair/dot_s.png", "mips smooth")
local mat_long_s = Material("benny/hud/xhair/long_s.png", "mips smooth") local mat_long_s = Material("benny/hud/xhair/long_s.png", "mips smooth")
local spacer_long = 3 -- screenscaled local spacer_long = 3 -- screenscaled
local spacer = 1 -- screenscaled local spacer = 1 -- screenscaled
local gap = 0
local trash_vec, trash_ang = Vector(), Angle() local trash_vec, trash_ang = Vector(), Angle()
@ -343,8 +341,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
surface.DrawOutlinedRect( b_x + b_s, b_y + b_s, ss(142-8), b_bh, ss( 0.5 ) ) surface.DrawOutlinedRect( b_x + b_s, b_y + b_s, ss(142-8), b_bh, ss( 0.5 ) )
surface.DrawRect( b_x + b_s + ss(1), b_y + b_s + ss(1), ss(142*hp-8-2), b_bh - ss(2) ) surface.DrawRect( b_x + b_s + ss(1), b_y + b_s + ss(1), ss(142*hp-8-2), b_bh - ss(2) )
heartbeatcol.a = math.ease.OutQuint(1-ti)*255 surface.SetDrawColor( 255, 255, 255, math.ease.OutQuint(1-ti)*255 )
surface.SetDrawColor( heartbeatcol )
surface.SetMaterial( mat_grad ) surface.SetMaterial( mat_grad )
surface.DrawTexturedRect( b_x + b_s + ss(1), b_y + b_s + ss(1), ss(142*hp*ti-8-2), b_bh - ss(2) ) surface.DrawTexturedRect( b_x + b_s + ss(1), b_y + b_s + ss(1), ss(142*hp*ti-8-2), b_bh - ss(2) )
@ -603,7 +600,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
cam.Start3D() cam.Start3D()
local lool = ( EyePos() + ( EyeAngles():Forward()*8192 ) + ( dispersion * EyeAngles():Up()*8192 ) ) :ToScreen() local lool = ( EyePos() + ( EyeAngles():Forward()*8192 ) + ( dispersion * EyeAngles():Up()*8192 ) ) :ToScreen()
cam.End3D() cam.End3D()
gap = ( (ScrH()/2) - lool.y ) local gap = ( (ScrH()/2) - lool.y )
do do
local tr1 = util.TraceLine({ local tr1 = util.TraceLine({