Attach a convar to the HUD scale
This commit is contained in:
parent
163cc29d78
commit
a8b4b3955b
|
@ -17,8 +17,10 @@ hook.Add( "HUDShouldDraw", "HideHUD", function( name )
|
||||||
if ( hide[ name ] ) then return false end
|
if ( hide[ name ] ) then return false end
|
||||||
end )
|
end )
|
||||||
|
|
||||||
|
local HSCALE = CreateClientConVar( "benny_hud_scale", 1, true, false, "HUD scaling", 0, 4 )
|
||||||
|
|
||||||
function ss( scale )
|
function ss( scale )
|
||||||
return math.Round( scale * ( ScrH() / 480 ) )
|
return math.Round( scale * ( ScrH() / 480 ) * HSCALE:GetFloat() )
|
||||||
end
|
end
|
||||||
|
|
||||||
local function genfonts()
|
local function genfonts()
|
||||||
|
@ -63,6 +65,10 @@ local function genfonts()
|
||||||
end
|
end
|
||||||
genfonts()
|
genfonts()
|
||||||
|
|
||||||
|
cvars.AddChangeCallback("benny_hud_scale", function(convar_name, value_old, value_new)
|
||||||
|
genfonts()
|
||||||
|
end, "benny_hud_scale_callback")
|
||||||
|
|
||||||
schemes = {
|
schemes = {
|
||||||
["benny"] = {
|
["benny"] = {
|
||||||
fg = Color( 255, 238, 169 ),
|
fg = Color( 255, 238, 169 ),
|
||||||
|
|
Loading…
Reference in New Issue