[PR #3813] [CLOSED] Honor text shadow_color in HUD text, and styled item name components #5231

Closed
opened 2026-11-03 05:11:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3813
Author: @JustKarkat
Created: 10/29/2026
Status: ❌ Closed

Base: main ← Head: fix/sidebar-text-display-rendering


📝 Commits (2)

  • 976ac15 Honor text shadow_color in HUD text, and styled item name components
  • 6d428d0 Merge main into the branch; styled text keeps main's inline objects and bold guard

📊 Changes

15 files changed (+382 additions, -26 deletions)

View changed files

📝 crates/horizon-client-core/src/component.rs (+79 -0)
📝 crates/horizon-client-core/src/text.rs (+37 -1)
📝 crates/horizon-client-render/src/hud.rs (+37 -15)
📝 crates/horizon-client/src/game/stations.rs (+17 -4)
📝 crates/horizon-client/src/game/titles.rs (+3 -3)
📝 crates/horizon-items/src/item_data.rs (+67 -3)
➕ tests/visual/text-shadow-parity/README.md (+61 -0)
➕ tests/visual/text-shadow-parity/datapack/data/parity/function/clear.mcfunction (+11 -0)
➕ tests/visual/text-shadow-parity/datapack/data/parity/function/phase1_sidebar.mcfunction (+17 -0)
➕ tests/visual/text-shadow-parity/datapack/data/parity/function/phase2_titles.mcfunction (+8 -0)
➕ tests/visual/text-shadow-parity/datapack/data/parity/function/phase3_displays.mcfunction (+9 -0)
➕ tests/visual/text-shadow-parity/datapack/data/parity/function/phase4_items.mcfunction (+11 -0)
➕ tests/visual/text-shadow-parity/datapack/data/parity/function/setup.mcfunction (+9 -0)
➕ tests/visual/text-shadow-parity/datapack/pack.mcmeta (+4 -0)
📝 tools/test_text_display_render_parity.py (+12 -0)

📄 Description

🤖 Opened by JustKarkat's AI agent (ZCode), working the #3531 card on Kira. Fixes #3531.

A component's shadow_color was dropped at parse time — Horizon's Style had no field for it — so every HUD draw that styles server text fell back to the default 25%-darkened shadow, and shadow_color: 0 (NO_SHADOW) could not suppress a shadow either. Item names were flattened to plain text on decode, so bold + color components on custom_name/item_name lost their styling in tooltips and the held-item name popup.

What this changes, per vanilla 26.3:

  • Style.shadow_color, decoded from ExtraCodecs.ARGB_COLOR_CODEC's forms: the packed ARGB int and the [r, g, b, a] float list the scoreboard command writes (issue's shadow_color:[1.0,0.0,0.0,1.0] repro). Serialized back as the int, inherited by applyTo, and kept by legacy colour codes (applyLegacyFormat leaves it alone; §r returns to the span's own style).
  • HudBatch::styled_text computes each glyph's shadow like Font.PreparedTextBuilder.getShadowColor: an explicit colour wins, its alpha scaled by the text's while that is translucent; otherwise the default ARGB.scaleRGB(color, 0.25) only when one is drawn; 0 is none. The shadow pass runs regardless of the draw call's flag, matching BakedSheetGlyph.hasShadow. This covers the sidebar (whose title, rows and team suffixes are the reported surface), titles, the action bar, chat, boss bars and floating text displays.
  • custom_name keeps its raw styled component beside the plain text (stack.custom_name_tag()); a bare {"text":"..."} still saves back as the plain string exactly as vanilla's codec writes it. stack_hover_name_text serves the tooltip's name line and the hotbar popup with the component's own styles under getStyledHoverName's rarity colour and custom-name italic; the popup's change-detection compares the styled text.

Automated coverage: the issue's two repros are unit tests (shadow_colors_parse_as_ints_and_float_lists, styled_custom_names_keep_their_component), tools/test_text_display_render_parity.py gained shadow cases and passes 600/600 against the real TextDisplayRenderer (47k quads), tools/test_hotbar_parity.py 905/905, scoreboard 500/500, and tools/pr_ready.py is green. All 119 parity harnesses the change touches pass locally; lan_integration (nightly) is the one not run by hand.

For eyeballing both halves in-game, tests/visual/text-shadow-parity/ is a datapack with four phases (sidebar, titles, floating text displays, item names) and a README of what each should look like, run side by side against vanilla.

🤖 Generated with ZCode


🔄 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/3813 **Author:** [@JustKarkat](https://github.com/JustKarkat) **Created:** 10/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/sidebar-text-display-rendering` --- ### 📝 Commits (2) - [`976ac15`](https://github.com/horizon-rust/horizon/commit/976ac15c3d34ef47285d37005d1e63bb17ebfe5c) Honor text shadow_color in HUD text, and styled item name components - [`6d428d0`](https://github.com/horizon-rust/horizon/commit/6d428d060f314289dc4902765550e6a40a0963a9) Merge main into the branch; styled text keeps main's inline objects and bold guard ### 📊 Changes **15 files changed** (+382 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-core/src/component.rs` (+79 -0) 📝 `crates/horizon-client-core/src/text.rs` (+37 -1) 📝 `crates/horizon-client-render/src/hud.rs` (+37 -15) 📝 `crates/horizon-client/src/game/stations.rs` (+17 -4) 📝 `crates/horizon-client/src/game/titles.rs` (+3 -3) 📝 `crates/horizon-items/src/item_data.rs` (+67 -3) ➕ `tests/visual/text-shadow-parity/README.md` (+61 -0) ➕ `tests/visual/text-shadow-parity/datapack/data/parity/function/clear.mcfunction` (+11 -0) ➕ `tests/visual/text-shadow-parity/datapack/data/parity/function/phase1_sidebar.mcfunction` (+17 -0) ➕ `tests/visual/text-shadow-parity/datapack/data/parity/function/phase2_titles.mcfunction` (+8 -0) ➕ `tests/visual/text-shadow-parity/datapack/data/parity/function/phase3_displays.mcfunction` (+9 -0) ➕ `tests/visual/text-shadow-parity/datapack/data/parity/function/phase4_items.mcfunction` (+11 -0) ➕ `tests/visual/text-shadow-parity/datapack/data/parity/function/setup.mcfunction` (+9 -0) ➕ `tests/visual/text-shadow-parity/datapack/pack.mcmeta` (+4 -0) 📝 `tools/test_text_display_render_parity.py` (+12 -0) </details> ### 📄 Description > 🤖 Opened by JustKarkat's AI agent (ZCode), working the [#3531](https://github.com/horizon-rust/horizon/issues/3531) card on Kira. Fixes #3531. A component's `shadow_color` was dropped at parse time — Horizon's `Style` had no field for it — so every HUD draw that styles server text fell back to the default 25%-darkened shadow, and `shadow_color: 0` (`NO_SHADOW`) could not suppress a shadow either. Item names were flattened to plain text on decode, so `bold` + `color` components on `custom_name`/`item_name` lost their styling in tooltips and the held-item name popup. What this changes, per vanilla 26.3: - `Style.shadow_color`, decoded from `ExtraCodecs.ARGB_COLOR_CODEC`'s forms: the packed ARGB int and the `[r, g, b, a]` float list the scoreboard command writes (issue's `shadow_color:[1.0,0.0,0.0,1.0]` repro). Serialized back as the int, inherited by `applyTo`, and kept by legacy colour codes (`applyLegacyFormat` leaves it alone; `§r` returns to the span's own style). - `HudBatch::styled_text` computes each glyph's shadow like `Font.PreparedTextBuilder.getShadowColor`: an explicit colour wins, its alpha scaled by the text's while that is translucent; otherwise the default `ARGB.scaleRGB(color, 0.25)` only when one is drawn; `0` is none. The shadow pass runs regardless of the draw call's flag, matching `BakedSheetGlyph.hasShadow`. This covers the sidebar (whose title, rows and team suffixes are the reported surface), titles, the action bar, chat, boss bars and floating text displays. - `custom_name` keeps its raw styled component beside the plain text (`stack.custom_name_tag()`); a bare `{"text":"..."}` still saves back as the plain string exactly as vanilla's codec writes it. `stack_hover_name_text` serves the tooltip's name line and the hotbar popup with the component's own styles under `getStyledHoverName`'s rarity colour and custom-name italic; the popup's change-detection compares the styled text. Automated coverage: the issue's two repros are unit tests (`shadow_colors_parse_as_ints_and_float_lists`, `styled_custom_names_keep_their_component`), `tools/test_text_display_render_parity.py` gained shadow cases and passes 600/600 against the real `TextDisplayRenderer` (47k quads), `tools/test_hotbar_parity.py` 905/905, scoreboard 500/500, and `tools/pr_ready.py` is green. All 119 parity harnesses the change touches pass locally; `lan_integration` (nightly) is the one not run by hand. For eyeballing both halves in-game, `tests/visual/text-shadow-parity/` is a datapack with four phases (sidebar, titles, floating text displays, item names) and a README of what each should look like, run side by side against vanilla. 🤖 Generated with [ZCode](https://zcode.dev) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:08 +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#5231
No description provided.