Skip to content

Max GUI scale/Splitscreen HUD squish convars

Zwip-Zwap Zapony requested to merge (removed):gui_scale_convars into master

This merge requests adds 3 new convars, related to HUD/GUI scaling:

  • "gui_maxscale" - The global max singleplayer HUD/menu GUI/title screen logo scale multiplier. For example, a window size of 1920x1080 would by default have a GUI scale of 5, but this convar can limit it to less than 5 if a user wants, although not more than 5 unless the window size is increased.

  • "gui_maxscale_splitscreen" - The max HUD scale multiplier specifically for splitscreen graphics (anything with V_PERPLAYER while in splitscreen). Note that this is currently limited to no more than "gui_maxscale", but I don't see why one would want the HUD to be bigger in splitscreen, so that's probably fine.

  • "gui_squish_splitscreen" - Whether or not to squish the splitscreen HUD to half height, as in v2.2.0. Defaults to squishing.

Minor extra goodie: MAXGUISCALE is a new (non-Lua/-SOC-accessible) constant, defined at compile-time based on BASEVIDWIDTH/MAXVIDWIDTH and BASEVIDHEIGHT/MAXVIDHEIGHT, to avoid "6" being a magic number in GUI-scale-related contexts. There are likely many things that still use "6" instead of MAXGUISCALE, however.

The "maxscale" convars can range from 0 up to MAXGUISCALE, with 0 (the default) disabling the limit. The splitscreen HUD squishing is also enabled by default, matching v2.2.0 behaviour/appearance. Note that the "maxscale" convars are absolute multiplier limiters, not a ratio of the current window size, which is part of the reason that they're console-exclusive "advanced" things rather than something accessible through options menus.

I've tested this in both the Software and OpenGL renderers with local 64-bit builds, and all vanilla HUD/GUI drawing seems appropriately affected. Lua HUD stuff is untested, but as long as it ultimately goes through the same GUI-drawing functions as vanilla GUI, it should work.

Merge request reports