Skip to content

Fit the ammo and vitals panels together at every resolution - #2265

Merged
sunzenshen merged 6 commits into
NeotokyoRebuild:masterfrom
KyleWerle:basic-hud-ammo
Oct 24, 2026
Merged

sunzenshen merged 6 commits into
NeotokyoRebuild:masterfrom
KyleWerle:basic-hud-ammo

Conversation

@KyleWerle

@KyleWerle KyleWerle commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

pr-hud-jitte-1080 The ammo and vitals panels scale with the screen, but their fonts come from `yres` bands in `ClientScheme.res`, so the text and rounds change size against the box as the resolution changes. At 4K the rounds, the fire mode glyph and the vitals text draw at well under their 1080p size, and in the ammo panel the name, glyph, rounds and reserve each sit on a different line.

Both panels now use proportional fonts (NHudPanelText for the weapon name and the vitals, plus NHudBullets, NHudFireMode and NHudAmmoReserve), so they look the same at every resolution, and the glyph, rounds and reserve stand on one baseline.

  • At 1080p the text is the size it was. The fire mode glyph gets its own font so it can be bigger than the rounds.
  • NHudOCRSmall and NHudOCR aren't changed, so the rest of the HUD, the scoreboard and the menus aren't touched.
  • OVERHEAT moves up to the weapon name's line. Its old - 22 offset was in raw pixels, so at 4K it drew on top of the heat bar.
  • The vitals bars are 4 units shorter. Support's 225 integrity ran into the end of the bar at 720p.
  • The + overflow rule is unchanged. At the new size it kicks in at PZ 34, SMAC 33 and SRM 33.

Just a warning for custom HUDs:

  • An NHudWeapon or NHudHealth override still draws, but its positions will sit off with the new font sizes.
  • A custom ClientScheme.res without the new font entries falls back to the fonts they replaced, at their old sizes. One that restyles NHudBullets with the old pixel sizes will draw the rounds far too big, since it's now looked up proportional.
  • Restyling NHudOCRSmall no longer changes the weapon name or the vitals text, unless the scheme has no NHudPanelText.

Checked in game at 720p, 1080p and 4K with every class and the BALC in a Juggernaut round (cold, warm and overheated). Both panels match within a pixel and a half across the three.

Toolchain

  • Windows MSVC VS2022
  • Linux: GCC syntax pass only on the two changed .cpp files, not built or run

Linked Issues

None.

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.
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.
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.
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.
@KyleWerle
KyleWerle marked this pull request as ready for review October 20, 2026 05:41
@sunzenshen
sunzenshen requested a review from a team October 20, 2026 16:58
@AdamTadeusz

Copy link
Copy Markdown
Contributor
hl2_win64 2026-10-23 16-53-13_1 Looks good at 4K 👍

@sunmachine
sunmachine self-requested a review October 24, 2026 01:32

@sunmachine sunmachine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh 👍 Bueno.

@sunmachine

Copy link
Copy Markdown
Contributor

No workflow files changed, approving the runner for external contributor. 👍

@KyleWerle KyleWerle closed this Oct 24, 2026
@KyleWerle KyleWerle reopened this Oct 24, 2026
@sunzenshen
sunzenshen merged commit b115e5f into NeotokyoRebuild:master Oct 24, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants