[PR #414] [MERGED] F3 overlay like vanilla: on top of menus, debug GUI scale, default entries #2546

Closed
opened 2026-11-02 15:57:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/f3-on-top


📝 Commits (1)

📊 Changes

7 files changed (+548 additions, -114 deletions)

View changed files

📝 crates/horizon-client/src/crash.rs (+2 -1)
📝 crates/horizon-client/src/debug_chart.rs (+4 -0)
➕ crates/horizon-client/src/debug_overlay.rs (+340 -0)
📝 crates/horizon-client/src/game.rs (+3 -111)
📝 crates/horizon-client/src/game/debug_keys.rs (+197 -1)
📝 crates/horizon-client/src/gfx.rs (+1 -1)
📝 crates/horizon-client/src/lib.rs (+1 -0)

📄 Description

Fixes #363
Fixes #376
Fixes #377

What vanilla does

DebugScreenOverlay.extractRenderState, called from Gui.extractRenderState after the screen and the toasts:

  • On top, menus included (#363). The overlay is drawn last, over any screen, and whether or not a level exists. F1 hides it only when no screen is open (!hud.isHidden() || screen != null).
  • Size (#376). It lays out at the debugGuiScale option. The default is 0, meaning half the largest automatic scale, applied only when that is below the GUI scale. For the issue's 854×709 window at GUI scale 2, F3 draws at scale 1.
  • Content (#377). The default profile (DebugScreenEntries.PROFILES) enables fps, game_version, memory, player_position, player_section_position, simple_performance_impactors, system_specs, tps (plus 3d_crosshair, which is #375). They are sorted by identifier (DebugScreenEntryList.rebuildCurrentList). Priority lines alternate between the columns, regular lines split half and half, groups split by halves, and the chart keys go under the left column.

Fix

  • New debug_overlay module: Displayer (addPriorityLine / addLine / addToGroup and the column split), scale (the debugGuiScale rules), draw (extractLines: background 0x90505050, then text 0xFFE0E0E0, right column right-aligned), and the position lines (DebugEntryPosition, DebugEntrySectionPosition).
  • Game::draw_debug_overlay runs from hud() after everything else, the title, options screens, menus and toasts included. The charts and the lightmap view use the same scale.
  • Entries:
    • {fps} fps T: {limit|inf} ({present mode}) @{Hz}Hz
    • Minecraft 26.3 (26.3/horizon) (horizon is the brand Horizon sends)
    • XYZ / Block / Chunk: x y z [lx lz in r.X.Z.mca] / Facing: … (yaw / pitch) / <dimension> FC: <forced chunks> / Section-relative. These are hidden with reduced debug info, except section-relative, as in vanilla.
    • fancy-clouds B: n, Filtering: None, Terrain Rendering: multidrawindirect|naive (from the renderer)
    • CPU, Display: WxH (vendor), Window: WxH (density), the GPU name with (iGPU) / (dGPU), and the backend with its driver
    • Integrated server @ {smoothed}/{target} ms{status}, 0 tx, 0 rx. The smoothing is vanilla's (smoothedTickTimeMillis * 0.8 + tick * 0.2). Frozen, stepping and sprinting follow /tick.
  • Horizon's own lines are gone (chunks/sections drawn, pending jobs, light, biome, day). In vanilla these are optional entries, not the default profile.

Left out on purpose: Java: … and the memory group (Mem / Allocation rate / Allocated) are JVM heap figures that Horizon has no equivalent for. Single player counts no packets, so tx/rx read 0. The remote "brand" server line needs the server brand, which the client doesn't keep yet. #375 (3D crosshair) is a separate PR.

Verified

  • Unit tests, 11 passing in cargo test -p horizon-client --lib -- debug_overlay debug_chart:
    • columns_follow_the_vanilla_split rebuilds the issue's vanilla screenshot line for line.
    • position_lines_match_vanilla uses the screenshot's numbers: Chunk: 6 6 -4 [6 28 in r.0.-1.mca], Section-relative: 12 08 12, and the rest.
    • debug_scale_is_half_the_automatic_scale checks 854×709 at GUI 2 → scale 1, 1920×1080 at GUI 4 → 2, and that a smaller GUI scale is kept.
  • In the game, offscreen at 1280×720 (GUI scale 3, so F3 draws at 1), screenshots checked:
    • In a world, both columns as in vanilla.
    • Over the pause menu (#363).
    • Over the creative inventory and over a "New Recipes Unlocked" toast.
    • On the title screen after Save and Quit (left column: fps, impactors, system specs, chart keys; right: version, terrain rendering).

Self-check (combined branch of the batch's seven PRs, #406 #407 #409 #414 #416 #421 #423, on origin/main d28521f7; Mac mini):

  • cargo fmt --all --check: ok
  • cargo clippy --workspace --all-targets -- -D warnings: ok
  • cargo test -p horizon-client: 775 passed, 0 failed
  • tools/parity.py --changed origin/main (82 harnesses, including the new world_reopen): 82 pass.
    • The first pass found two #407 regressions, both fixed in #407 and rerun green: command_parse (suggestions were pruned in brigadier itself rather than only in the player's chat) and dedicated_server (dedicated-server guests lost their ops-based commands).
    • 34 harnesses passed on the combined commit before those two #407 fixes. The other 48 plus the two reruns passed after them.
  • Not run: the Linux and Windows checks (this batch was developed and checked on the Mac mini only).

🤖 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/414 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/f3-on-top` --- ### 📝 Commits (1) - [`77127cc`](https://github.com/horizon-rust/horizon/commit/77127ccfede459c0e250c5dbf924ef53e1afdef1) F3 overlay like vanilla's DebugScreenOverlay (#363, #376, #377) ### 📊 Changes **7 files changed** (+548 additions, -114 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/crash.rs` (+2 -1) 📝 `crates/horizon-client/src/debug_chart.rs` (+4 -0) ➕ `crates/horizon-client/src/debug_overlay.rs` (+340 -0) 📝 `crates/horizon-client/src/game.rs` (+3 -111) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+197 -1) 📝 `crates/horizon-client/src/gfx.rs` (+1 -1) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) </details> ### 📄 Description Fixes #363 Fixes #376 Fixes #377 ## What vanilla does `DebugScreenOverlay.extractRenderState`, called from `Gui.extractRenderState` after the screen and the toasts: - **On top, menus included (#363).** The overlay is drawn last, over any screen, and whether or not a level exists. F1 hides it only when no screen is open (`!hud.isHidden() || screen != null`). - **Size (#376).** It lays out at the `debugGuiScale` option. The default is 0, meaning half the largest automatic scale, applied only when that is below the GUI scale. For the issue's 854×709 window at GUI scale 2, F3 draws at scale 1. - **Content (#377).** The default profile (`DebugScreenEntries.PROFILES`) enables `fps, game_version, memory, player_position, player_section_position, simple_performance_impactors, system_specs, tps` (plus `3d_crosshair`, which is #375). They are sorted by identifier (`DebugScreenEntryList.rebuildCurrentList`). Priority lines alternate between the columns, regular lines split half and half, groups split by halves, and the chart keys go under the left column. ## Fix - New `debug_overlay` module: `Displayer` (`addPriorityLine` / `addLine` / `addToGroup` and the column split), `scale` (the `debugGuiScale` rules), `draw` (`extractLines`: background 0x90505050, then text 0xFFE0E0E0, right column right-aligned), and the position lines (`DebugEntryPosition`, `DebugEntrySectionPosition`). - `Game::draw_debug_overlay` runs from `hud()` after everything else, the title, options screens, menus and toasts included. The charts and the lightmap view use the same scale. - Entries: - `{fps} fps T: {limit|inf} ({present mode}) @{Hz}Hz` - `Minecraft 26.3 (26.3/horizon)` (`horizon` is the brand Horizon sends) - XYZ / Block / `Chunk: x y z [lx lz in r.X.Z.mca]` / `Facing: … (yaw / pitch)` / `<dimension> FC: <forced chunks>` / `Section-relative`. These are hidden with reduced debug info, except section-relative, as in vanilla. - `fancy-clouds B: n`, `Filtering: None`, `Terrain Rendering: multidrawindirect|naive` (from the renderer) - `CPU`, `Display: WxH (vendor)`, `Window: WxH (density)`, the GPU name with `(iGPU)` / `(dGPU)`, and the backend with its driver - `Integrated server @ {smoothed}/{target} ms{status}, 0 tx, 0 rx`. The smoothing is vanilla's (`smoothedTickTimeMillis * 0.8 + tick * 0.2`). Frozen, stepping and sprinting follow `/tick`. - Horizon's own lines are gone (chunks/sections drawn, pending jobs, light, biome, day). In vanilla these are optional entries, not the default profile. **Left out on purpose:** `Java: …` and the memory group (`Mem` / `Allocation rate` / `Allocated`) are JVM heap figures that Horizon has no equivalent for. Single player counts no packets, so tx/rx read 0. The remote `"brand" server` line needs the server brand, which the client doesn't keep yet. #375 (3D crosshair) is a separate PR. ## Verified - Unit tests, 11 passing in `cargo test -p horizon-client --lib -- debug_overlay debug_chart`: - `columns_follow_the_vanilla_split` rebuilds the issue's vanilla screenshot line for line. - `position_lines_match_vanilla` uses the screenshot's numbers: `Chunk: 6 6 -4 [6 28 in r.0.-1.mca]`, `Section-relative: 12 08 12`, and the rest. - `debug_scale_is_half_the_automatic_scale` checks 854×709 at GUI 2 → scale 1, 1920×1080 at GUI 4 → 2, and that a smaller GUI scale is kept. - In the game, offscreen at 1280×720 (GUI scale 3, so F3 draws at 1), screenshots checked: - In a world, both columns as in vanilla. - Over the pause menu (#363). - Over the creative inventory and over a "New Recipes Unlocked" toast. - On the title screen after Save and Quit (left column: fps, impactors, system specs, chart keys; right: version, terrain rendering). **Self-check** (combined branch of the batch's seven PRs, #406 #407 #409 #414 #416 #421 #423, on origin/main d28521f7; Mac mini): - `cargo fmt --all --check`: ok - `cargo clippy --workspace --all-targets -- -D warnings`: ok - `cargo test -p horizon-client`: 775 passed, 0 failed - `tools/parity.py --changed origin/main` (82 harnesses, including the new `world_reopen`): 82 pass. - The first pass found two #407 regressions, both fixed in #407 and rerun green: `command_parse` (suggestions were pruned in brigadier itself rather than only in the player's chat) and `dedicated_server` (dedicated-server guests lost their ops-based commands). - 34 harnesses passed on the combined commit before those two #407 fixes. The other 48 plus the two reruns passed after them. - Not run: the Linux and Windows checks (this batch was developed and checked on the Mac mini only). 🤖 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 15:57:06 +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#2546
No description provided.