Spacer for hints

This commit is contained in:
Fesiug 2023-12-17 21:12:28 -05:00
parent 8a31b270f0
commit 2c44acda15
1 changed files with 82 additions and 32 deletions

View File

@ -217,20 +217,34 @@ local mat_grad = Material( "benny/hud/grad.png", "mips smooth" )
local lonk = { local lonk = {
{ {
Glyph = "R", Glyph = "W",
Text1 = "RELOAD", Glyph2 = "S",
Text2 = "Reload weapon", Text1 = "MOVE",
Text2 = "Forward and backward",
}, },
{ {
Glyph = "T", Glyph = "A",
Text1 = "RELOAD (AKIMBO)", Glyph2 = "D",
Text2 = "Reload alternate weapon", Text1 = "STRAFE",
Text2 = "Left and right",
},
{
Spacer = true,
},
{
Glyph = "R",
Glyph2 = "T",
Text1 = "RELOAD",
Text2 = "Reload weapon",
}, },
{ {
Glyph = "F", Glyph = "F",
Text1 = "AIM", Text1 = "AIM",
Text2 = "Enter weapon mode", Text2 = "Enter weapon mode",
}, },
{
Spacer = true,
},
{ {
Glyph = "SPACE", Glyph = "SPACE",
Text1 = "STUNT", Text1 = "STUNT",
@ -241,11 +255,29 @@ local lonk = {
Text1 = "STANCE", Text1 = "STANCE",
Text2 = "Get down", Text2 = "Get down",
}, },
{
Spacer = true,
},
{ {
Glyph = "F1", Glyph = "F1",
Text1 = "SETTINGS",
Text2 = "Set settings",
},
{
Glyph = "F2",
Text1 = "DEV. INVENTORY",
Text2 = "Manage inventory",
},
{
Glyph = "F3",
Text1 = "DEV. SPAWN", Text1 = "DEV. SPAWN",
Text2 = "Cheat items in", Text2 = "Cheat items in",
}, },
{
Glyph = "F4",
Text1 = "CHOREOGRAPHER",
Text2 = "Manage scenes",
},
} }
-- Stew port -- Stew port
@ -376,7 +408,11 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
if _==1 then if _==1 then
tbump = tbump + ss(4) tbump = tbump + ss(4)
end end
if data.Spacer then
tbump = tbump + ss(5)
else
tbump = tbump + ss(16) tbump = tbump + ss(16)
end
if _==#lonk then if _==#lonk then
tbump = tbump + ss(4) tbump = tbump + ss(4)
end end
@ -397,7 +433,11 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
-- surface.SetDrawColor( 0, 100, 255, 32 ) -- surface.SetDrawColor( 0, 100, 255, 32 )
-- surface.DrawRect( b_x, b_y + bump, b_w, ss(16) ) -- surface.DrawRect( b_x, b_y + bump, b_w, ss(16) )
if data.Spacer then
surface.SetDrawColor( scheme["fg"] )
surface.DrawRect( b_x + ss(4), b_y + ss(2) + bump, b_w - ss(8), ss(1) )
bump = bump + ss(5)
else
draw.SimpleText( data.Text1, "Benny_12", b_x + b_w - tbw, draw.SimpleText( data.Text1, "Benny_12", b_x + b_w - tbw,
b_y + bump, b_y + bump,
scheme["fg"], TEXT_ALIGN_RIGHT, TEXT_ALIGN_TOP ) scheme["fg"], TEXT_ALIGN_RIGHT, TEXT_ALIGN_TOP )
@ -413,10 +453,19 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
draw.SimpleText( data.Glyph, "Benny_12", b_x + tbw + tbg/2, draw.SimpleText( data.Glyph, "Benny_12", b_x + tbw + tbg/2,
b_y + ss(2.6) + bump, b_y + ss(2.6) + bump,
scheme["fg"], TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP ) scheme["fg"], TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP )
if data.Glyph2 then
surface.SetDrawColor( scheme["fg"] )
surface.DrawOutlinedRect( b_x + tbw + tbg + ss(2),
b_y + ss(2) + bump, tbg, tbg, ss(1) )
draw.SimpleText( data.Glyph2, "Benny_12", b_x + tbw + tbg/2 + tbg + ss(2),
b_y + ss(2.6) + bump,
scheme["fg"], TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP )
end
else else
surface.SetFont( "Benny_10" ) surface.SetFont( "Benny_10" )
local tx = surface.GetTextSize( data.Glyph ) local tx = ss((#data.Glyph*5)+5) surface.GetTextSize( data.Glyph )
tx = math.max( tx + ss(8), tbg ) --tx = math.max( tx + ss(8), tbg )
surface.SetDrawColor( scheme["fg"] ) surface.SetDrawColor( scheme["fg"] )
surface.DrawOutlinedRect( b_x + tbw, surface.DrawOutlinedRect( b_x + tbw,
@ -426,6 +475,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
scheme["fg"], TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP ) scheme["fg"], TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP )
end end
bump = bump + ss(16) bump = bump + ss(16)
end
if _==#lonk then if _==#lonk then
bump = bump + ss(4) bump = bump + ss(4)
end end