Repository navigation
Kill feed: names no longer cut off at the right edge with a bigger scale or your own font (part of #728) - #998
Merged
Merged
Conversation
…or font With `ds_hud_deathmsg scale` or `font` in force, the victim's width call now reserves a right margin (1/160 of the screen's width, or a quarter of the text's height when that is more). Draw anchors each line at ScreenWidth - icon - victim width, so the victim's measured width sat flush against the edge and a big last glyph or a drop shadow was cut. At scale 1 with no font the layout stays the game's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release note: Fixed: with a bigger kill feed or your own kill-feed font, the victim's name no longer runs into the right edge of the screen.
Part of #728
What was wrong
CHudDeathNotice::Drawanchors each line atScreenWidth - icon - victim width, so the victim's measured width ends exactly on the screen's edge (the game does this too). The measure is the sum of glyph advances, so a big face's last glyph (its overhang) and a drop shadow land past the edge. At the game's own 16 px face that's a pixel or two. Atscale 2+ on 2560x1440, with the engine font orfont Bahnschrift SemiBold 32 shadow, the last letter was visibly cut ("motiv", "G A U L", "element").A diag build logged every line's numbers on POST and PRE at 2560x1440 (scale 2, engine font). The anchor, the icon advance (scaled rect) and the victim's draw all agree: every victim ends at exactly x = 2560. Nothing uses the unscaled icon width. The user's "rifle lines overflow most" was the same edge cut on each line. It isn't Anniversary-only, and #860/#890 don't change it: #890's trim only swaps the rect inside the
SPR_DrawHoleshook, never the rects the layout reads.Fix
The victim's width call (the first call of each line) now goes to its own redirect,
victim_len. While ascaleor afontis in force, it adds a right margin: 1/160 of the screen width (16 px at 2560, 12 at 1920), or a quarter of the text height when that is more. The whole line moves left by that much. At scale 1 with no font, the layout is still exactly the game's.Decisions
scaleorfontis in force, so the stock layout stays byte-for-byte the game's.Test done
Test DLL:
local\test-killfeed-edge\. game_probe, Brain account. Real demo kills plusfakelines (garand, grenade, mp44, kar). Scales 1/2/2.5/3, each with the engine font and withfont Bahnschrift SemiBold 32 shadow(the WSOD25 settings):wsod25_grp1_h1_m00cat(dod_addon,-addons): every victim name is clear of the edge at scales 2/2.5/3 with both fonts. Scale 1 + engine font is unchanged (stock, flush).ktps8w1-m00cat_soul_lenn_h2: same result. Two grabs caught the scoreboard or an empty feed (demo timing), not a layout issue.cargo test -p goldsrc-hooks: 768 passed, including a newright_margintest.-D warnings(toolchain 1.98.1) is clean for i686 and host;cargo fmt --checkpasses.#1000 (outline and backgrounds) is stacked on this PR.
Screenshots and contact sheets: main checkout
local\review-images\killfeed-edge\(edge-*-sheet.png).🤖 Generated with Claude Code