Skip to content

Commit

Permalink
feat: Font resize cvar
Browse files Browse the repository at this point in the history
  • Loading branch information
Lythium4848 committed Mar 16, 2024
1 parent 90d37c9 commit b4ad1af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/pulsarui/core/cl_fonts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ do
PulsarUI.ScaledFonts = PulsarUI.ScaledFonts or {}
local scaledFonts = PulsarUI.ScaledFonts

local fontSizeCvar = CreateClientConVar("pulsar_ui_font_resize", "1", true, false, "How many times bigger should we make all fonts registed with PulsarUI. Please rejoin the server after running this.", 1, 2)

function PulsarUI.RegisterFont(name, font, size, weight)
local resizeAmount = fontSizeCvar:GetFloat()
size = size * resizeAmount

scaledFonts[name] = {
font = font,
size = size,
resize = resizeAmount,
weight = weight
}

Expand Down Expand Up @@ -90,4 +96,4 @@ do
function PulsarUI.GetRealFont(font)
return registeredFonts[font]
end
end
end

0 comments on commit b4ad1af

Please sign in to comment.