[PR #2381] [MERGED] Raise the held item name and action bar above extra heart, armor and mount rows #4260

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2381
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/hud-text-above-bars


📝 Commits (1)

  • bc2dd35 Raise the held item name and action bar above extra heart, armor and mount rows

📊 Changes

6 files changed (+41 additions, -11 deletions)

View changed files

📝 crates/horizon-client/examples/probe/hud_fixture.rs (+1 -0)
📝 crates/horizon-client/examples/probe/hud_fixture/kinds.rs (+2 -2)
📝 crates/horizon-client/src/game.rs (+11 -2)
📝 crates/horizon-client/src/game/titles.rs (+6 -3)
📝 crates/horizon-client/src/hud_layout.rs (+10 -0)
📝 crates/horizon-client/src/hud_overlays.rs (+11 -4)

📄 Description

What and why

The held item name and the action bar were always drawn at fixed heights (59 and 68 pixels from the bottom). In vanilla they move up when the bars below them grow: a second row of hearts (more than 20 health with absorption), the armor row on top of a tall health stack, mount hearts, or air bubbles over the food row. In Horizon the text drew on top of those rows. The HUD now keeps Hud.leftHeight and rightHeight like vanilla and places both texts above them.

Vanilla reference

  • Hud.extractRenderState: leftHeight and rightHeight start at 39 each frame.
  • extractHealthLevel (leftHeight += (rows - 1) * rowHeight + 10), extractArmorLevel (+10 with armor), extractFoodLevel (rightHeight += 10 without a mount), extractVehicleHealth (+10 per heart row) and extractAirBubbles (+10 when shown).
  • Hud.extractSelectedItemName: y = guiHeight - max(yShift, 59) with yShift = max(leftHeight, rightHeight).
  • Hud.extractOverlayMessage: yShift = max(leftHeight, rightHeight) + (68 - 59), drawn at guiHeight - max(yShift, 68).

Self-check

cargo check -p horizon-client passes.


🔄 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/2381 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/hud-text-above-bars` --- ### 📝 Commits (1) - [`bc2dd35`](https://github.com/horizon-rust/horizon/commit/bc2dd35cc34c84b4048fcbdc704897bc266c3ecb) Raise the held item name and action bar above extra heart, armor and mount rows ### 📊 Changes **6 files changed** (+41 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/hud_fixture.rs` (+1 -0) 📝 `crates/horizon-client/examples/probe/hud_fixture/kinds.rs` (+2 -2) 📝 `crates/horizon-client/src/game.rs` (+11 -2) 📝 `crates/horizon-client/src/game/titles.rs` (+6 -3) 📝 `crates/horizon-client/src/hud_layout.rs` (+10 -0) 📝 `crates/horizon-client/src/hud_overlays.rs` (+11 -4) </details> ### 📄 Description ## What and why The held item name and the action bar were always drawn at fixed heights (59 and 68 pixels from the bottom). In vanilla they move up when the bars below them grow: a second row of hearts (more than 20 health with absorption), the armor row on top of a tall health stack, mount hearts, or air bubbles over the food row. In Horizon the text drew on top of those rows. The HUD now keeps `Hud.leftHeight` and `rightHeight` like vanilla and places both texts above them. ## Vanilla reference - `Hud.extractRenderState`: `leftHeight` and `rightHeight` start at 39 each frame. - `extractHealthLevel` (`leftHeight += (rows - 1) * rowHeight + 10`), `extractArmorLevel` (`+10` with armor), `extractFoodLevel` (`rightHeight += 10` without a mount), `extractVehicleHealth` (`+10` per heart row) and `extractAirBubbles` (`+10` when shown). - `Hud.extractSelectedItemName`: `y = guiHeight - max(yShift, 59)` with `yShift = max(leftHeight, rightHeight)`. - `Hud.extractOverlayMessage`: `yShift = max(leftHeight, rightHeight) + (68 - 59)`, drawn at `guiHeight - max(yShift, 68)`. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:52 +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#4260
No description provided.