[PR #1003] [MERGED] Apply legacy formatting codes in the scoreboard sidebar #2978

Closed
opened 2026-11-02 16:00:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1003
Author: @ludovic111
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @ludovic111

Base: main ← Head: fix/sidebar-legacy-codes


📝 Commits (1)

  • 24abdb6 Apply legacy formatting codes in the scoreboard sidebar

📊 Changes

2 files changed (+15 additions, -7 deletions)

View changed files

📝 crates/horizon-client/src/hud_overlays.rs (+6 -3)
📝 tools/hud_parity_cases.py (+9 -4)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes #937, split from #903 (rdbt's screenshot of anticheat-test.com): every line of the server's sidebar ended with § and a code letter, drawn as glyphs.

What

Vanilla 26.3's Font draws each literal through StringDecomposer.iterateFormatted: § plus the next character changes the style (ChatFormatting.getByCode; unknown codes are swallowed, §r goes back to the component's own style), and a lone § at the end is dropped. Gui.displayScoreboardSidebar draws the owner names (team prefix + name + suffix), the scores and the title that way. Horizon's hud_overlays::sidebar drew them raw. It now resolves them with Text::resolve_legacy, which the tab list and chat already use. The widths follow, so the panel is as wide as vanilla's.

Proof

tools/hud_parity_cases.py: the sidebar cases now include legacy-coded fake owners (§1§r, §a§lPro§r name, end§, §zodd§Rcase), team prefixes and suffixes (§c§lRed §r, §7(§e5§7)§), a coded title and a coded fixed number format.

  • main + the new cases: FAIL, sidebar 34/220, 2014/2200 HUD states match (e.g. Horizon draws Shown §1§r where vanilla draws Shown ).
  • this PR: PASS (tools/parity.py hud, 162 s).

Self-check (Mac mini)

cargo fmt --all --check                                   ok
cargo clippy -p horizon-client --all-targets -D warnings  ok (only crate touched)
cargo test -p horizon-client --lib hud_overlays scoreboard text::   18 passed
tools/parity.py hud                                       PASS

Not checked against anticheat-test.com itself (no packet capture). If its sidebar uses something other than legacy codes, e.g. a private-use glyph, a follow-up is needed.

Nothing needs Ludovic.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1003 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/sidebar-legacy-codes` --- ### 📝 Commits (1) - [`24abdb6`](https://github.com/horizon-rust/horizon/commit/24abdb664dfae45511fbd7c0e4733d3df3b6fea2) Apply legacy formatting codes in the scoreboard sidebar ### 📊 Changes **2 files changed** (+15 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/hud_overlays.rs` (+6 -3) 📝 `tools/hud_parity_cases.py` (+9 -4) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #937, split from #903 (rdbt's screenshot of anticheat-test.com): every line of the server's sidebar ended with `§` and a code letter, drawn as glyphs. ## What Vanilla 26.3's `Font` draws each literal through `StringDecomposer.iterateFormatted`: `§` plus the next character changes the style (`ChatFormatting.getByCode`; unknown codes are swallowed, `§r` goes back to the component's own style), and a lone `§` at the end is dropped. `Gui.displayScoreboardSidebar` draws the owner names (team prefix + name + suffix), the scores and the title that way. Horizon's `hud_overlays::sidebar` drew them raw. It now resolves them with `Text::resolve_legacy`, which the tab list and chat already use. The widths follow, so the panel is as wide as vanilla's. ## Proof `tools/hud_parity_cases.py`: the sidebar cases now include legacy-coded fake owners (`§1§r`, `§a§lPro§r name`, `end§`, `§zodd§Rcase`), team prefixes and suffixes (`§c§lRed §r`, ` §7(§e5§7)§`), a coded title and a coded fixed number format. - main + the new cases: **FAIL**, `sidebar 34/220`, `2014/2200 HUD states match` (e.g. Horizon draws `Shown §1§r` where vanilla draws `Shown `). - this PR: **PASS** (`tools/parity.py hud`, 162 s). ## Self-check (Mac mini) ``` cargo fmt --all --check ok cargo clippy -p horizon-client --all-targets -D warnings ok (only crate touched) cargo test -p horizon-client --lib hud_overlays scoreboard text:: 18 passed tools/parity.py hud PASS ``` Not checked against anticheat-test.com itself (no packet capture). If its sidebar uses something other than legacy codes, e.g. a private-use glyph, a follow-up is needed. Nothing needs Ludovic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:00:34 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2978
No description provided.