From 8aa6fde2812155e9993069f6c8c7a84dd16372cf Mon Sep 17 00:00:00 2001 From: Kyle Werle Date: Sun, 18 Oct 2026 23:51:39 -0500 Subject: [PATCH 1/4] Scale the ammo panel's fonts with the panel The ammo panel scales with the screen but its fonts were picked from yres bands, so the text and rounds changed size against the box with resolution (the rounds and fire mode glyph smallest at 4K) and each piece sat on its own line. The weapon name, rounds, fire mode glyph and reserve now use proportional fonts sized from the panel, with the glyph, rounds and reserve standing on AUX POWER's baseline. Sizes match stock at 1080p, except the fire mode glyph, which gets its own font so it can be bigger than the rounds. OVERHEAT moves to the weapon name's line, since its old -22 offset was in raw pixels. The header defaults match HudLayout.res. Also drops the glyph's and the reserve's GetTextSize calls, whose results were never read. Checked in game at 1080p and 4K: the layout matches within a pixel, including the BALC heat bar and OVERHEAT. --- game/neo/resource/ClientScheme.res | 46 ++++++++++++------------- game/neo/scripts/HudLayout.res | 16 ++++----- src/game/client/neo/ui/neo_hud_ammo.cpp | 16 ++++----- src/game/client/neo/ui/neo_hud_ammo.h | 19 +++++----- 4 files changed, 46 insertions(+), 51 deletions(-) diff --git a/game/neo/resource/ClientScheme.res b/game/neo/resource/ClientScheme.res index 95680e932d..fe15dd9e63 100644 --- a/game/neo/resource/ClientScheme.res +++ b/game/neo/resource/ClientScheme.res @@ -2568,53 +2568,51 @@ Scheme //"additive" "1" } } + // The ammo panel's fonts, looked up proportional so they scale with the panel at every resolution NHudBullets { "1" { "name" "NOCR" - "tall" "38" - "weight" "0" - "range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A - "yres" "480 599" - "additive" "1" - } - "2" - { - "name" "NOCR" - "tall" "40" + "tall" "21" "weight" "0" "range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A - "yres" "600 767" + "antialias" "1" "additive" "1" } - "3" + } + NHudFireMode + { + "1" { "name" "NOCR" - "tall" "44" + "tall" "25" "weight" "0" "range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A - "yres" "768 1023" "antialias" "1" "additive" "1" } - "4" + } + NHudAmmoReserve + { + "1" { - "name" "NOCR" - "tall" "50" - "weight" "0" + "name" "Neuropol2" + "tall" "11" + "weight" "600" "range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A - "yres" "1024 1199" "antialias" "1" "additive" "1" } - "5" + } + NHudAmmoName + { + "1" { - "name" "NOCR" - "tall" "68" - "weight" "0" + "name" "Neuropol2" + "tall" "9" + "weight" "600" "range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A - "yres" "1200 6000" "antialias" "1" "additive" "1" } diff --git a/game/neo/scripts/HudLayout.res b/game/neo/scripts/HudLayout.res index b5b2842d54..f6f5d5f800 100644 --- a/game/neo/scripts/HudLayout.res +++ b/game/neo/scripts/HudLayout.res @@ -847,19 +847,19 @@ "text_xpos" "194" "text_ypos" "2" "digit_as_number" "0" - "digit_xpos" "24" - "digit_ypos" "6" - "digit_max_width" "150" + "digit_xpos" "30" + "digit_ypos" "10" + "digit_max_width" "146" "digit2_xpos" "194" - "digit2_ypos" "16" + "digit2_ypos" "19" "icon_xpos" "3" - "icon_ypos" "5" + "icon_ypos" "8" "ammo_text_color" "255 255 255 100" "ammo_color" "255 255 255 150" "emptied_ammo_color" "255 255 255 50" - "heatbar_xpos" "23" - "heatbar_ypos" "12" - "heatbar_w" "172" + "heatbar_xpos" "30" + "heatbar_ypos" "16" + "heatbar_w" "146" "heatbar_h" "11" "heat_color" "255 50 50 200" } diff --git a/src/game/client/neo/ui/neo_hud_ammo.cpp b/src/game/client/neo/ui/neo_hud_ammo.cpp index b8038ac8ab..1251e47787 100644 --- a/src/game/client/neo/ui/neo_hud_ammo.cpp +++ b/src/game/client/neo/ui/neo_hud_ammo.cpp @@ -73,9 +73,10 @@ void CNEOHud_Ammo::ApplySchemeSettings(vgui::IScheme* pScheme) LoadControlSettings("scripts/HudLayout.res"); - m_hSmallTextFont = pScheme->GetFont("NHudOCRSmall"); - m_hBulletFont = pScheme->GetFont("NHudBullets"); - m_hTextFont = pScheme->GetFont("NHudOCR"); + m_hSmallTextFont = pScheme->GetFont("NHudAmmoName", true); + m_hBulletFont = pScheme->GetFont("NHudBullets", true); + m_hFireModeFont = pScheme->GetFont("NHudFireMode", true); + m_hTextFont = pScheme->GetFont("NHudAmmoReserve", true); surface()->GetScreenSize(m_resX, m_resY); SetBounds(0, 0, m_resX, m_resY); @@ -137,8 +138,6 @@ void CNEOHud_Ammo::DrawAmmo() const wchar_t unicodeClipsText[maxLen]{ L'\0' }; g_pVGuiLocalize->ConvertANSIToUnicode(clipsText, unicodeClipsText, sizeof(unicodeClipsText)); - int clipsTextWidth, clipsTextHeight; - surface()->GetTextSize(m_hTextFont, unicodeClipsText, clipsTextWidth, clipsTextHeight); surface()->DrawSetTextFont(m_hTextFont); surface()->GetTextSize(m_hTextFont, unicodeClipsText, fontWidth, fontHeight); @@ -147,7 +146,6 @@ void CNEOHud_Ammo::DrawAmmo() const } const char* ammoChar = nullptr; - int fireModeWidth = 0, fireModeHeight = 0; int magSizeMax = 0; int magSizeCurrent = 0; @@ -175,11 +173,9 @@ void CNEOHud_Ammo::DrawAmmo() const wchar_t unicodeFireModeText[2]{ L'\0' }; g_pVGuiLocalize->ConvertANSIToUnicode(fireModeText, unicodeFireModeText, sizeof(unicodeFireModeText)); - surface()->DrawSetTextFont(m_hBulletFont); + surface()->DrawSetTextFont(m_hFireModeFont); surface()->DrawSetTextPos(icon_xpos + xpos, icon_ypos + ypos); surface()->DrawPrintText(unicodeFireModeText, V_wcslen(unicodeFireModeText)); - - surface()->GetTextSize(m_hBulletFont, unicodeFireModeText, fireModeWidth, fireModeHeight); } } else { @@ -302,7 +298,7 @@ void CNEOHud_Ammo::DrawHeatMeter(C_NEOBaseCombatWeapon* activeWep) const if (activeWep->GetPrimaryAmmoCount() == 0) { surface()->DrawSetTextFont(m_hSmallTextFont); - surface()->DrawSetTextPos(heatbar_xpos + xpos, (heatbar_ypos + ypos) - 22); + surface()->DrawSetTextPos(heatbar_xpos + xpos, text_ypos + ypos); surface()->DrawPrintText(L"OVERHEAT", 8); } diff --git a/src/game/client/neo/ui/neo_hud_ammo.h b/src/game/client/neo/ui/neo_hud_ammo.h index 7ea1901233..13c9e7a891 100644 --- a/src/game/client/neo/ui/neo_hud_ammo.h +++ b/src/game/client/neo/ui/neo_hud_ammo.h @@ -33,6 +33,7 @@ class CNEOHud_Ammo : public CNEOHud_ChildElement, public CHudElement, public vgu vgui::HFont m_hSmallTextFont = 0; vgui::HFont m_hTextFont = 0; vgui::HFont m_hBulletFont = 0; + vgui::HFont m_hFireModeFont = 0; int m_resX, m_resY; int m_smallFontWidth, m_smallFontHeight; @@ -54,22 +55,22 @@ class CNEOHud_Ammo : public CNEOHud_ChildElement, public CHudElement, public vgu CPanelAnimationVarAliasType(int, text_xpos, "text_xpos", "194", "proportional_xpos"); CPanelAnimationVarAliasType(int, text_ypos, "text_ypos", "2", "proportional_ypos"); - CPanelAnimationVarAliasType(int, digit_xpos, "digit_xpos", "24", "proportional_xpos"); - CPanelAnimationVarAliasType(int, digit_ypos, "digit_ypos", "6", "proportional_ypos"); + CPanelAnimationVarAliasType(int, digit_xpos, "digit_xpos", "30", "proportional_xpos"); + CPanelAnimationVarAliasType(int, digit_ypos, "digit_ypos", "10", "proportional_ypos"); CPanelAnimationVarAliasType(bool, digit_as_number, "digit_as_number", "0", "bool"); - CPanelAnimationVarAliasType(int, digit_max_width, "digit_max_width", "150", "proportional_xpos"); + CPanelAnimationVarAliasType(int, digit_max_width, "digit_max_width", "146", "proportional_xpos"); CPanelAnimationVarAliasType(int, digit2_xpos, "digit2_xpos", "194", "proportional_xpos"); - CPanelAnimationVarAliasType(int, digit2_ypos, "digit2_ypos", "16", "proportional_ypos"); + CPanelAnimationVarAliasType(int, digit2_ypos, "digit2_ypos", "19", "proportional_ypos"); CPanelAnimationVarAliasType(int, icon_xpos, "icon_xpos", "3", "proportional_xpos"); - CPanelAnimationVarAliasType(int, icon_ypos, "icon_ypos", "5", "proportional_ypos"); + CPanelAnimationVarAliasType(int, icon_ypos, "icon_ypos", "8", "proportional_ypos"); CPanelAnimationVar(Color, ammo_text_color, "ammo_text_color", "255 255 255 100"); CPanelAnimationVar(Color, ammo_color, "ammo_color", "255 255 255 150"); CPanelAnimationVar(Color, emptied_ammo_color, "emptied_ammo_color", "255 255 255 50"); - CPanelAnimationVarAliasType(int, heatbar_xpos, "heatbar_xpos", "45", "proportional_xpos"); - CPanelAnimationVarAliasType(int, heatbar_ypos, "heatbar_ypos", "12", "proportional_ypos"); - CPanelAnimationVarAliasType(float, heatbar_w, "heatbar_w", "150", "proportional_float"); - CPanelAnimationVarAliasType(float, heatbar_h, "heatbar_h", "15", "proportional_float"); + CPanelAnimationVarAliasType(int, heatbar_xpos, "heatbar_xpos", "30", "proportional_xpos"); + CPanelAnimationVarAliasType(int, heatbar_ypos, "heatbar_ypos", "16", "proportional_ypos"); + CPanelAnimationVarAliasType(float, heatbar_w, "heatbar_w", "146", "proportional_float"); + CPanelAnimationVarAliasType(float, heatbar_h, "heatbar_h", "11", "proportional_float"); CPanelAnimationVar(Color, heat_color, "heat_color", "255 50 50 200"); private: From 13630859950f5d5e5ed3f79441ef680bc3c63c9a Mon Sep 17 00:00:00 2001 From: Kyle Werle Date: Mon, 19 Oct 2026 16:48:18 -0500 Subject: [PATCH 2/4] Scale the vitals panel's text with the panel The vitals panel's labels and numbers used NHudOCRSmall from yres bands, so at 4K they drew at about 70% of their 1080p size against the box, and next to the ammo panel's new proportional name they no longer matched. NHudAmmoName becomes NHudPanelText and both panels use it. At 1080p nothing changes. Also drops five unused size members from the ammo panel. Checked in game at 1080p and 4K: both panels match within 1.5 px. --- game/neo/resource/ClientScheme.res | 4 ++-- src/game/client/neo/ui/neo_hud_ammo.cpp | 2 +- src/game/client/neo/ui/neo_hud_ammo.h | 3 --- src/game/client/neo/ui/neo_hud_health_thermoptic_aux.cpp | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/game/neo/resource/ClientScheme.res b/game/neo/resource/ClientScheme.res index fe15dd9e63..94927490cf 100644 --- a/game/neo/resource/ClientScheme.res +++ b/game/neo/resource/ClientScheme.res @@ -2568,7 +2568,7 @@ Scheme //"additive" "1" } } - // The ammo panel's fonts, looked up proportional so they scale with the panel at every resolution + // The ammo and vitals panels' fonts, looked up proportional so they scale with the panels at every resolution NHudBullets { "1" @@ -2605,7 +2605,7 @@ Scheme "additive" "1" } } - NHudAmmoName + NHudPanelText { "1" { diff --git a/src/game/client/neo/ui/neo_hud_ammo.cpp b/src/game/client/neo/ui/neo_hud_ammo.cpp index 1251e47787..8b698b8594 100644 --- a/src/game/client/neo/ui/neo_hud_ammo.cpp +++ b/src/game/client/neo/ui/neo_hud_ammo.cpp @@ -73,7 +73,7 @@ void CNEOHud_Ammo::ApplySchemeSettings(vgui::IScheme* pScheme) LoadControlSettings("scripts/HudLayout.res"); - m_hSmallTextFont = pScheme->GetFont("NHudAmmoName", true); + m_hSmallTextFont = pScheme->GetFont("NHudPanelText", true); m_hBulletFont = pScheme->GetFont("NHudBullets", true); m_hFireModeFont = pScheme->GetFont("NHudFireMode", true); m_hTextFont = pScheme->GetFont("NHudAmmoReserve", true); diff --git a/src/game/client/neo/ui/neo_hud_ammo.h b/src/game/client/neo/ui/neo_hud_ammo.h index 13c9e7a891..069561e11c 100644 --- a/src/game/client/neo/ui/neo_hud_ammo.h +++ b/src/game/client/neo/ui/neo_hud_ammo.h @@ -36,9 +36,6 @@ class CNEOHud_Ammo : public CNEOHud_ChildElement, public CHudElement, public vgu vgui::HFont m_hFireModeFont = 0; int m_resX, m_resY; - int m_smallFontWidth, m_smallFontHeight; - int m_fontWidth; - int m_bulletFontWidth, m_bulletFontHeight; CPanelAnimationVarAliasType(int, xpos, "xpos", "r203", "proportional_xpos"); CPanelAnimationVarAliasType(int, ypos, "ypos", "446", "proportional_ypos"); diff --git a/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.cpp b/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.cpp index e14b34da83..4e68fb63ca 100644 --- a/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.cpp +++ b/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.cpp @@ -77,7 +77,7 @@ void CNEOHud_HTA::ApplySchemeSettings(vgui::IScheme* pScheme) LoadControlSettings("scripts/HudLayout.res"); - m_hFont = pScheme->GetFont("NHudOCRSmall"); + m_hFont = pScheme->GetFont("NHudPanelText", true); m_hFontBuildInfo = pScheme->GetFont("Default"); surface()->GetScreenSize(m_resX, m_resY); From 46a2cb5b72e5ba047948792007e7bc89e522f174 Mon Sep 17 00:00:00 2001 From: Kyle Werle Date: Mon, 19 Oct 2026 18:19:56 -0500 Subject: [PATCH 3/4] Shorten the vitals bars so three-digit numbers clear them Support's 225 integrity ran into the end of the bar (touching at 720p, about a pixel apart at 1080p and 4K). The three bars are now 86 wide instead of 90, which leaves a few units before the right-aligned number. The header defaults match HudLayout.res. --- game/neo/scripts/HudLayout.res | 6 +++--- src/game/client/neo/ui/neo_hud_health_thermoptic_aux.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/game/neo/scripts/HudLayout.res b/game/neo/scripts/HudLayout.res index f6f5d5f800..574ffbf229 100644 --- a/game/neo/scripts/HudLayout.res +++ b/game/neo/scripts/HudLayout.res @@ -881,7 +881,7 @@ "healthtext_ypos" "2" "healthbar_xpos" "86" "healthbar_ypos" "4" - "healthbar_w" "90" + "healthbar_w" "86" "healthbar_h" "6" "healthnum_xpos" "198" "healthnum_ypos" "2" @@ -891,7 +891,7 @@ "camotext_ypos" "12" "camobar_xpos" "86" "camobar_ypos" "14" - "camobar_w" "90" + "camobar_w" "86" "camobar_h" "6" "camonum_xpos" "198" "camonum_ypos" "12" @@ -901,7 +901,7 @@ "sprinttext_ypos" "22" "sprintbar_xpos" "86" "sprintbar_ypos" "24" - "sprintbar_w" "90" + "sprintbar_w" "86" "sprintbar_h" "6" "sprintnum_xpos" "198" "sprintnum_ypos" "22" diff --git a/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.h b/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.h index c13a194147..d25986adb7 100644 --- a/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.h +++ b/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.h @@ -53,7 +53,7 @@ class CNEOHud_HTA : public CNEOHud_ChildElement, public CHudElement, public vgui CPanelAnimationVarAliasType(int, healthtext_ypos, "healthtext_ypos", "2", "proportional_ypos"); CPanelAnimationVarAliasType(int, healthbar_xpos, "healthbar_xpos", "86", "proportional_xpos"); CPanelAnimationVarAliasType(int, healthbar_ypos, "healthbar_ypos", "4", "proportional_ypos"); - CPanelAnimationVarAliasType(float, healthbar_w, "healthbar_w", "93", "proportional_float"); + CPanelAnimationVarAliasType(float, healthbar_w, "healthbar_w", "86", "proportional_float"); CPanelAnimationVarAliasType(float, healthbar_h, "healthbar_h", "6", "proportional_float"); CPanelAnimationVarAliasType(int, healthnum_xpos, "healthnum_xpos", "198", "proportional_xpos"); CPanelAnimationVarAliasType(int, healthnum_ypos, "healthnum_ypos", "2", "proportional_ypos"); @@ -64,7 +64,7 @@ class CNEOHud_HTA : public CNEOHud_ChildElement, public CHudElement, public vgui CPanelAnimationVarAliasType(int, camotext_ypos, "camotext_ypos", "12", "proportional_ypos"); CPanelAnimationVarAliasType(int, camobar_xpos, "camobar_xpos", "86", "proportional_xpos"); CPanelAnimationVarAliasType(int, camobar_ypos, "camobar_ypos", "14", "proportional_ypos"); - CPanelAnimationVarAliasType(float, camobar_w, "camobar_w", "93", "proportional_float"); + CPanelAnimationVarAliasType(float, camobar_w, "camobar_w", "86", "proportional_float"); CPanelAnimationVarAliasType(float, camobar_h, "camobar_h", "6", "proportional_float"); CPanelAnimationVarAliasType(int, camonum_xpos, "camonum_xpos", "198", "proportional_xpos"); CPanelAnimationVarAliasType(int, camonum_ypos, "camonum_ypos", "12", "proportional_ypos"); @@ -75,7 +75,7 @@ class CNEOHud_HTA : public CNEOHud_ChildElement, public CHudElement, public vgui CPanelAnimationVarAliasType(int, sprinttext_ypos, "sprinttext_ypos", "22", "proportional_ypos"); CPanelAnimationVarAliasType(int, sprintbar_xpos, "sprintbar_xpos", "86", "proportional_xpos"); CPanelAnimationVarAliasType(int, sprintbar_ypos, "sprintbar_ypos", "24", "proportional_ypos"); - CPanelAnimationVarAliasType(float, sprintbar_w, "sprintbar_w", "93", "proportional_float"); + CPanelAnimationVarAliasType(float, sprintbar_w, "sprintbar_w", "86", "proportional_float"); CPanelAnimationVarAliasType(float, sprintbar_h, "sprintbar_h", "6", "proportional_float"); CPanelAnimationVarAliasType(int, sprintnum_xpos, "sprintnum_xpos", "198", "proportional_xpos"); CPanelAnimationVarAliasType(int, sprintnum_ypos, "sprintnum_ypos", "22", "proportional_ypos"); From ec0768ede04d659c1b7eb2932b32f24539afc379 Mon Sep 17 00:00:00 2001 From: Kyle Werle Date: Mon, 19 Oct 2026 19:23:23 -0500 Subject: [PATCH 4/4] Fall back to the old fonts when a custom scheme lacks the new ones A custom ClientScheme.res made before NHudPanelText, NHudFireMode and NHudAmmoReserve existed has none of them, so GetFont returned 0 and the weapon name, fire mode glyph, reserve and every vitals label and number drew blank. Each now falls back to the font it replaced, at stock's size. Checked in game at 1080p with the three entries removed: blank before, all drawn after. --- src/game/client/neo/ui/neo_hud_ammo.cpp | 14 ++++++++++++++ .../neo/ui/neo_hud_health_thermoptic_aux.cpp | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/src/game/client/neo/ui/neo_hud_ammo.cpp b/src/game/client/neo/ui/neo_hud_ammo.cpp index 8b698b8594..fc0f36b61f 100644 --- a/src/game/client/neo/ui/neo_hud_ammo.cpp +++ b/src/game/client/neo/ui/neo_hud_ammo.cpp @@ -78,6 +78,20 @@ void CNEOHud_Ammo::ApplySchemeSettings(vgui::IScheme* pScheme) m_hFireModeFont = pScheme->GetFont("NHudFireMode", true); m_hTextFont = pScheme->GetFont("NHudAmmoReserve", true); + // A custom ClientScheme.res from before these fonts existed: use the fonts they replaced + if (!m_hSmallTextFont) + { + m_hSmallTextFont = pScheme->GetFont("NHudOCRSmall"); + } + if (!m_hFireModeFont) + { + m_hFireModeFont = pScheme->GetFont("NHudBullets"); + } + if (!m_hTextFont) + { + m_hTextFont = pScheme->GetFont("NHudOCR"); + } + surface()->GetScreenSize(m_resX, m_resY); SetBounds(0, 0, m_resX, m_resY); SetFgColor(COLOR_TRANSPARENT); diff --git a/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.cpp b/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.cpp index 4e68fb63ca..579d74ee32 100644 --- a/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.cpp +++ b/src/game/client/neo/ui/neo_hud_health_thermoptic_aux.cpp @@ -78,6 +78,11 @@ void CNEOHud_HTA::ApplySchemeSettings(vgui::IScheme* pScheme) LoadControlSettings("scripts/HudLayout.res"); m_hFont = pScheme->GetFont("NHudPanelText", true); + if (!m_hFont) + { + // A custom ClientScheme.res from before NHudPanelText existed + m_hFont = pScheme->GetFont("NHudOCRSmall"); + } m_hFontBuildInfo = pScheme->GetFont("Default"); surface()->GetScreenSize(m_resX, m_resY);