Skip to content

Dynamic scoreboard columns + fix DrawHudStringReverse (multibyte/color/alignment)#309

Merged
a1batross merged 2 commits intoVelaron:mainfrom
Vladislav4KZ:scoreboard-fix
Apr 4, 2026
Merged

Dynamic scoreboard columns + fix DrawHudStringReverse (multibyte/color/alignment)#309
a1batross merged 2 commits intoVelaron:mainfrom
Vladislav4KZ:scoreboard-fix

Conversation

@Vladislav4KZ
Copy link
Copy Markdown
Contributor

Fixed a null terminator bug that caused one character to be missing by starting the loop from the last character (strlen - 1). Added proper UTF-8 support with detection of multibyte character boundaries, ensuring bytes within a character are decoded and rendered in the correct order, eliminating garbled text and missing glyphs.

Reworked color code handling using a two-pass approach by first scanning forward to determine per-character colors and then rendering backward, which fixes an issue where colors were applied to text on the left.
Corrected the \R alignment logic so the right-aligned part no longer disappears and renders properly alongside the left part.

Added dynamic column width calculation for scoreboard titles using min(), allowing columns to expand leftward to fit longer localized titles like "Health" and "Money" without truncation.

Comment thread cl_dll/draw_util.cpp Outdated
Comment thread cl_dll/draw_util.cpp Outdated
@a1batross a1batross merged commit c0da586 into Velaron:main Apr 4, 2026
9 checks passed
@Vladislav4KZ Vladislav4KZ deleted the scoreboard-fix branch April 5, 2026 04:51
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.

2 participants