[PR #1197] [MERGED] Locator bar HUD and waypoint styles #3412

Closed
opened 2026-11-03 04:09:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/locator-bar


📝 Commits (6)

  • c77863f Armour trims on worn armour (player, LAN guests, armour stands)
  • 38276fb Locator bar HUD and waypoint styles
  • c8d8a35 Merge feat/armour-trims-worn (#1194) into feat/locator-bar
  • 901a5b8 Merge origin/main into feat/armour-trims-worn
  • 9e11394 Merge feat/armour-trims-worn (now with main) into feat/locator-bar
  • bdbe591 Locator bar: drop the live-backdrop check main removed

📊 Changes

12 files changed (+1531 additions, -24 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+61 -5)
📝 crates/horizon-client/src/game/armor_stands.rs (+175 -6)
📝 crates/horizon-client/src/game/lan.rs (+5 -2)
📝 crates/horizon-client/src/game/lan_waypoints.rs (+11 -2)
➕ crates/horizon-client/src/game/locator_bar.rs (+126 -0)
📝 crates/horizon-client/src/game/mounts.rs (+22 -7)
📝 crates/horizon-client/src/game/packs.rs (+2 -0)
📝 crates/horizon-client/src/game/remote.rs (+18 -0)
📝 crates/horizon-client/src/hud.rs (+13 -2)
📝 crates/horizon-client/src/lib.rs (+2 -0)
➕ crates/horizon-client/src/locator_bar.rs (+742 -0)
➕ crates/horizon-client/src/trims.rs (+354 -0)

📄 Description

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

What

The locator bar, as 26.3 draws it: when the server tracks waypoints for the player, the bar above the hotbar replaces the experience bar and shows a dot per waypoint.

  • locator_bar.rs (new):
    • WaypointStyleManager: loads every assets/<namespace>/waypoint_style/*.json (vanilla: default, bowtie) with WaypointStyle's codec and checks (near_distance < far_distance, at least one sprite). An unknown style falls back to MISSING.
    • ClientWaypointManager: track, update and untrack from ClientboundTrackedWaypointPacket.
    • LocatorBar.extractRenderState, farthest waypoint first:
      • It skips the camera's own waypoint and anything more than 60 degrees from the view. It uses TrackedWaypoint.yawAngleToCamera for blocks, chunks and azimuths, and the entity's interpolated eyes when that entity is loaded.
      • The colour is the waypoint's own, or ARGB.setBrightness(hash, 0.9) of its UUID or name.
      • The sprite is chosen by lerpInt over the near/far distances.
      • An up or down arrow is drawn when pitchDirectionToCamera puts the waypoint off screen. The arrows are animated from their .png.mcmeta (10 ticks on, 4 off).
    • Hud.nextContextualInfoState: jump bar, then experience (for 100 ticks after a change of experience progress, as LocalPlayer.setExperienceValues sets experienceDisplayStartTick), then locator, then experience. The enchanting and anvil screens hold the experience bar while they are open.
  • Wiring:
    • Remote servers: handleWaypoint.
    • A served world: the host's own connection in lan/waypoints.rs (#692) now delivers to the host's HUD. Guests already got the packets.
    • Waypoints are cleared on connect and when the world closes. A resource reload reloads the styles.
    • The background locator_bar_background is nine-sliced (its gui.scaling metadata).

Fixes #339 (found by the resource pack audit, docs/resource-packs.md).

Screenshots (Mac mini, --offscreen, 1280x720; crop at 3x)

Host on a LAN world facing north, guest joined from a second Horizon client. Top: the guest 30 blocks above and about 38 blocks ahead (near sprite default_0, up arrow). Bottom: the guest far below and to the right (default_1, down arrow).

Full frames: above, below. On main the experience bar stays in this place and no dot is drawn. I couldn't capture the vanilla client beside it because the Mac mini session is locked. The dot placement (floor(angle * 173 / 2 / 60) from ceil((width - 9) / 2)) and the sprite choice are checked against hand-computed vanilla values in dots_sit_on_the_bar_by_angle and styles_pick_sprites_by_distance.

How tested

  • cargo fmt --all --check: clean
  • cargo clippy --workspace --all-targets -- -D warnings (pipefail): exit 0
  • cargo test -p horizon-client: all pass (lib 990 passed, 15 ignored; bin 91 passed). New tests: packets_track_update_and_untrack, styles_pick_sprites_by_distance, brightness_like_argb, dots_sit_on_the_bar_by_angle, contextual_bar_priorities, arrows_blink_through_their_frames
  • tools/parity.py --changed origin/main: I'll post the result in a comment once the batch's integration run finishes.

Not covered (noted in FEATURES.md LATER)

  • EnchantmentScreen and AnvilScreen keep the experience bar up while they're open (containerTick). That works for the local stations, but menus opened by a remote server don't go through Station, so on a remote server only experience changes show the bar.

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/1197 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/locator-bar` --- ### 📝 Commits (6) - [`c77863f`](https://github.com/horizon-rust/horizon/commit/c77863f16314af2f891ee50c770b4ce158197cf4) Armour trims on worn armour (player, LAN guests, armour stands) - [`38276fb`](https://github.com/horizon-rust/horizon/commit/38276fbc30fee22a46848691522ab1dc2bfe1d7d) Locator bar HUD and waypoint styles - [`c8d8a35`](https://github.com/horizon-rust/horizon/commit/c8d8a352732ddc2277d08d010c7f51bb1995ee1a) Merge feat/armour-trims-worn (#1194) into feat/locator-bar - [`901a5b8`](https://github.com/horizon-rust/horizon/commit/901a5b8207bf611902c8f0f59ded8dcc6dd8fa1e) Merge origin/main into feat/armour-trims-worn - [`9e11394`](https://github.com/horizon-rust/horizon/commit/9e11394600421537feb66c662a0a5444f89fb8b3) Merge feat/armour-trims-worn (now with main) into feat/locator-bar - [`bdbe591`](https://github.com/horizon-rust/horizon/commit/bdbe59155d344623d9dec6871cfac2a11891fac1) Locator bar: drop the live-backdrop check main removed ### 📊 Changes **12 files changed** (+1531 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+61 -5) 📝 `crates/horizon-client/src/game/armor_stands.rs` (+175 -6) 📝 `crates/horizon-client/src/game/lan.rs` (+5 -2) 📝 `crates/horizon-client/src/game/lan_waypoints.rs` (+11 -2) ➕ `crates/horizon-client/src/game/locator_bar.rs` (+126 -0) 📝 `crates/horizon-client/src/game/mounts.rs` (+22 -7) 📝 `crates/horizon-client/src/game/packs.rs` (+2 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+18 -0) 📝 `crates/horizon-client/src/hud.rs` (+13 -2) 📝 `crates/horizon-client/src/lib.rs` (+2 -0) ➕ `crates/horizon-client/src/locator_bar.rs` (+742 -0) ➕ `crates/horizon-client/src/trims.rs` (+354 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What The locator bar, as 26.3 draws it: when the server tracks waypoints for the player, the bar above the hotbar replaces the experience bar and shows a dot per waypoint. - `locator_bar.rs` (new): - `WaypointStyleManager`: loads every `assets/<namespace>/waypoint_style/*.json` (vanilla: `default`, `bowtie`) with `WaypointStyle`'s codec and checks (`near_distance` < `far_distance`, at least one sprite). An unknown style falls back to `MISSING`. - `ClientWaypointManager`: track, update and untrack from `ClientboundTrackedWaypointPacket`. - `LocatorBar.extractRenderState`, farthest waypoint first: - It skips the camera's own waypoint and anything more than 60 degrees from the view. It uses `TrackedWaypoint.yawAngleToCamera` for blocks, chunks and azimuths, and the entity's interpolated eyes when that entity is loaded. - The colour is the waypoint's own, or `ARGB.setBrightness(hash, 0.9)` of its UUID or name. - The sprite is chosen by `lerpInt` over the near/far distances. - An up or down arrow is drawn when `pitchDirectionToCamera` puts the waypoint off screen. The arrows are animated from their `.png.mcmeta` (10 ticks on, 4 off). - `Hud.nextContextualInfoState`: jump bar, then experience (for 100 ticks after a change of experience progress, as `LocalPlayer.setExperienceValues` sets `experienceDisplayStartTick`), then locator, then experience. The enchanting and anvil screens hold the experience bar while they are open. - Wiring: - Remote servers: `handleWaypoint`. - A served world: the host's own connection in `lan/waypoints.rs` (#692) now delivers to the host's HUD. Guests already got the packets. - Waypoints are cleared on connect and when the world closes. A resource reload reloads the styles. - The background `locator_bar_background` is nine-sliced (its `gui.scaling` metadata). Fixes #339 (found by the resource pack audit, docs/resource-packs.md). ## Screenshots (Mac mini, `--offscreen`, 1280x720; crop at 3x) Host on a LAN world facing north, guest joined from a second Horizon client. Top: the guest 30 blocks above and about 38 blocks ahead (near sprite `default_0`, up arrow). Bottom: the guest far below and to the right (`default_1`, down arrow). ![](https://raw.githubusercontent.com/ludovic111/horizon/2fb8f16a/339/zoom-locator.png) Full frames: [above](https://raw.githubusercontent.com/ludovic111/horizon/2fb8f16a/339/locator-up.png), [below](https://raw.githubusercontent.com/ludovic111/horizon/2fb8f16a/339/locator-down.png). On main the experience bar stays in this place and no dot is drawn. I couldn't capture the vanilla client beside it because the Mac mini session is locked. The dot placement (`floor(angle * 173 / 2 / 60)` from `ceil((width - 9) / 2)`) and the sprite choice are checked against hand-computed vanilla values in `dots_sit_on_the_bar_by_angle` and `styles_pick_sprites_by_distance`. ## How tested - `cargo fmt --all --check`: clean - `cargo clippy --workspace --all-targets -- -D warnings` (pipefail): exit 0 - `cargo test -p horizon-client`: all pass (lib 990 passed, 15 ignored; bin 91 passed). New tests: `packets_track_update_and_untrack`, `styles_pick_sprites_by_distance`, `brightness_like_argb`, `dots_sit_on_the_bar_by_angle`, `contextual_bar_priorities`, `arrows_blink_through_their_frames` - `tools/parity.py --changed origin/main`: I'll post the result in a comment once the batch's integration run finishes. ## Not covered (noted in FEATURES.md LATER) - `EnchantmentScreen` and `AnvilScreen` keep the experience bar up while they're open (`containerTick`). That works for the local stations, but menus opened by a remote server don't go through `Station`, so on a remote server only experience changes show the bar. 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-03 04:09:20 +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#3412
No description provided.