Style spawn protection to be more hl2ish (#39)

This commit is contained in:
Redox 2023-08-28 00:28:16 +01:00 committed by GitHub
parent 1db5ab5c23
commit a2c4bb853f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,21 +1,24 @@
local textColor = Color( 0, 100, 255 )
local outlineColor = color_black
local textColor = Color( 255, 235, 20, 255 )
local boxColor = Color( 0, 0, 0, 76 )
local TEXT_ALIGN_CENTER = TEXT_ALIGN_CENTER
local scrw = ScrW()
local scrh = ScrH()
surface.CreateFont( "SpawnProtection", {
font = "Roboto",
font = "Verdana",
size = ScreenScale( 15 ),
weight = 600,
weight = 400,
} )
local text = "Spawn protection enabled"
local function drawNotice()
local active = LocalPlayer():GetNWBool( "HasSpawnProtection", false )
if not active then return end
draw.SimpleTextOutlined( "Spawn protection enabled", "SpawnProtection", scrw * 0.5, scrh * 0.9, textColor, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, outlineColor )
draw.RoundedBox( 10, scrw * 0.355, scrh * 0.9, scrw * 0.29, scrh * 0.075, boxColor )
draw.SimpleText( text, "SpawnProtection", scrw * 0.5, scrh * 0.936, textColor, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
end
hook.Add( "HUDPaint", "DrawSpawnProtection", drawNotice )