[PR #4162] [CLOSED] Debug: the F3 + F6 debug options screen #5453

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4162
Author: @masa-masa-0314
Created: 10/30/2026
Status: ❌ Closed

Base: main ← Head: feat/debug-options-screen


📝 Commits (3)

  • defca83 Debug: the F3 + F6 debug options screen
  • 2b0b0b9 Debug: each entry's status decides what the overlay draws
  • aa4fe6f Debug: the looking-at, light, biome, difficulty and day entries

📊 Changes

10 files changed (+1119 additions, -44 deletions)

View changed files

📝 crates/horizon-client-render/src/options_file.rs (+2 -0)
➕ crates/horizon-client/src/debug_options.rs (+481 -0)
📝 crates/horizon-client/src/game.rs (+33 -0)
📝 crates/horizon-client/src/game/agent.rs (+1 -0)
📝 crates/horizon-client/src/game/control.rs (+1 -0)
➕ crates/horizon-client/src/game/debug_entries.rs (+146 -0)
📝 crates/horizon-client/src/game/debug_keys.rs (+100 -43)
➕ crates/horizon-client/src/game/debug_options_screen.rs (+352 -0)
📝 crates/horizon-client/src/game/screens.rs (+2 -1)
📝 crates/horizon-client/src/lib.rs (+1 -0)

📄 Description

🤖 Opened by masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally.

What and why

F3 + F6 did nothing: DebugAction::DebugOptions was consumed and no screen drawn ("Screens and
overlays Horizon does not draw yet"). This adds vanilla's DebugOptionsScreen.

The screen lists DebugScreenEntries — all 46 entries, sorted by DebugEntryCategory and then id,
each under debug.options.category.text / .renderer — with the three state buttons
OptionEntry builds (debug.entry.always, debug.entry.overlay, options.off), the chosen one
drawn pressed. Above them debug.options.title, the warning subtitle (debug.options.warning,
wrapped to the list's width as MultiLineTextWidget.setMaxWidth does) and the search box
(updateSearch filters the ids and drops a heading with no rows); below them the default and
performance profile buttons (profileButton.active = !isUsingProfile) and Done, laid out at
HeaderAndFooterLayout's 61/33 with the list's 310 width and 60-wide state buttons. Escape or Done
closes, the wheel scrolls, and the search box takes typed text.

An entry Horizon can actually switch drives the F3 key behind it: entity_hitboxes (F3 + B) and
chunk_borders (F3 + G). The rest are listed italic with their buttons disabled — vanilla's
rendering for an entry whose isAllowed is false — because Horizon's overlay draws its text block
as a whole rather than per entry.

Vanilla reference

  • net/minecraft/client/gui/screens/debug/DebugOptionsScreen (init, OptionEntry,
    CategoryEntry, AbstractOptionEntry, OptionList, addProfileButton).
  • net/minecraft/client/gui/components/debug/DebugScreenEntries (ids, registration order and
    DebugEntryCategory sort keys), DebugScreenEntryStatus (the three states and their labels),
    DebugScreenProfile.
  • ContainerObjectSelectionList / HeaderAndFooterLayout for the row and layout metrics.

Self-check

rustfmt: pass
clippy -p horizon-client --all-targets -D warnings: pass
horizon-client lib: 748 passed, 0 failed (5 new: the entry list, the search, the switches,
  the button layout, the scroll)

Verified on a real client (--control + horizon-ctl): F3 + F6 reports screen = debug-options,
ui lists the ordered three-button rows and the footer, clicking a state button of entity_hitboxes
selects it, the performance profile leaves the two switchable renderers off, and Done returns to
playing.

Screenshots

The screen as rendered (horizon-ctl screenshot) shows the title, wrapped warning, search box, the
Debug Screen Text category, the italic disabled rows and the three buttons per row; the screenshot
is not attached because this repository takes no binary assets in PR text.

🤖 Generated with ZCode

Follow-up commit: 2b0b0b91b

The statuses now gate what the overlay draws, entry by entry. The overlay used to be one block of
lines assembled in place, so only the two renderers could be switched. Each entry Horizon draws
(fps, game_version, tps, system_specs, player_position, player_section_position,
simple_performance_impactors, 3d_crosshair) now asks Entries::draws(id) before reporting its
lines, and the two renderer entries keep driving F3 + B / F3 + G. The choices are saved beside the
other options (debugEntries: id=2 for never, id=1 for in the overlay — DebugScreenEntryList.save)
and read back at startup. The profiles now mean what they mean in vanilla: Default turns the drawn
entries back on, Performance turns them off.

Verified with the overlay captured at both ends: with every entry on, the corner shows
116 fps T: 120 (fifo) @144Hz and fancy-clouds B: …; with every drawn entry saved as =2 and the
game restarted, the overlay keeps only its chart footer line. Eight unit tests cover the entry list,
the search, the effects, the saved-text round trip, the profiles and the button layout.


🔄 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/4162 **Author:** [@masa-masa-0314](https://github.com/masa-masa-0314) **Created:** 10/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/debug-options-screen` --- ### 📝 Commits (3) - [`defca83`](https://github.com/horizon-rust/horizon/commit/defca8334f2083f565fc0b7554fdae6df5250162) Debug: the F3 + F6 debug options screen - [`2b0b0b9`](https://github.com/horizon-rust/horizon/commit/2b0b0b91b1dcaa15b9e944dc725ce24a116d9dee) Debug: each entry's status decides what the overlay draws - [`aa4fe6f`](https://github.com/horizon-rust/horizon/commit/aa4fe6f00ee8b29ea910f0bb6e456a207e6e6671) Debug: the looking-at, light, biome, difficulty and day entries ### 📊 Changes **10 files changed** (+1119 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/options_file.rs` (+2 -0) ➕ `crates/horizon-client/src/debug_options.rs` (+481 -0) 📝 `crates/horizon-client/src/game.rs` (+33 -0) 📝 `crates/horizon-client/src/game/agent.rs` (+1 -0) 📝 `crates/horizon-client/src/game/control.rs` (+1 -0) ➕ `crates/horizon-client/src/game/debug_entries.rs` (+146 -0) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+100 -43) ➕ `crates/horizon-client/src/game/debug_options_screen.rs` (+352 -0) 📝 `crates/horizon-client/src/game/screens.rs` (+2 -1) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally. ## What and why F3 + F6 did nothing: `DebugAction::DebugOptions` was consumed and no screen drawn ("Screens and overlays Horizon does not draw yet"). This adds vanilla's `DebugOptionsScreen`. The screen lists `DebugScreenEntries` — all 46 entries, sorted by `DebugEntryCategory` and then id, each under `debug.options.category.text` / `.renderer` — with the three state buttons `OptionEntry` builds (`debug.entry.always`, `debug.entry.overlay`, `options.off`), the chosen one drawn pressed. Above them `debug.options.title`, the warning subtitle (`debug.options.warning`, wrapped to the list's width as `MultiLineTextWidget.setMaxWidth` does) and the search box (`updateSearch` filters the ids and drops a heading with no rows); below them the default and performance profile buttons (`profileButton.active = !isUsingProfile`) and Done, laid out at `HeaderAndFooterLayout`'s 61/33 with the list's 310 width and 60-wide state buttons. Escape or Done closes, the wheel scrolls, and the search box takes typed text. An entry Horizon can actually switch drives the F3 key behind it: `entity_hitboxes` (F3 + B) and `chunk_borders` (F3 + G). The rest are listed italic with their buttons disabled — vanilla's rendering for an entry whose `isAllowed` is false — because Horizon's overlay draws its text block as a whole rather than per entry. ## Vanilla reference - `net/minecraft/client/gui/screens/debug/DebugOptionsScreen` (`init`, `OptionEntry`, `CategoryEntry`, `AbstractOptionEntry`, `OptionList`, `addProfileButton`). - `net/minecraft/client/gui/components/debug/DebugScreenEntries` (ids, registration order and `DebugEntryCategory` sort keys), `DebugScreenEntryStatus` (the three states and their labels), `DebugScreenProfile`. - `ContainerObjectSelectionList` / `HeaderAndFooterLayout` for the row and layout metrics. ## Self-check ``` rustfmt: pass clippy -p horizon-client --all-targets -D warnings: pass horizon-client lib: 748 passed, 0 failed (5 new: the entry list, the search, the switches, the button layout, the scroll) ``` Verified on a real client (`--control` + `horizon-ctl`): F3 + F6 reports `screen = debug-options`, `ui` lists the ordered three-button rows and the footer, clicking a state button of `entity_hitboxes` selects it, the performance profile leaves the two switchable renderers off, and Done returns to `playing`. ## Screenshots The screen as rendered (`horizon-ctl screenshot`) shows the title, wrapped warning, search box, the Debug Screen Text category, the italic disabled rows and the three buttons per row; the screenshot is not attached because this repository takes no binary assets in PR text. 🤖 Generated with ZCode ## Follow-up commit: `2b0b0b91b` The statuses now gate what the overlay draws, entry by entry. The overlay used to be one block of lines assembled in place, so only the two renderers could be switched. Each entry Horizon draws (`fps`, `game_version`, `tps`, `system_specs`, `player_position`, `player_section_position`, `simple_performance_impactors`, `3d_crosshair`) now asks `Entries::draws(id)` before reporting its lines, and the two renderer entries keep driving F3 + B / F3 + G. The choices are saved beside the other options (`debugEntries`: `id=2` for never, `id=1` for in the overlay — `DebugScreenEntryList.save`) and read back at startup. The profiles now mean what they mean in vanilla: Default turns the drawn entries back on, Performance turns them off. Verified with the overlay captured at both ends: with every entry on, the corner shows `116 fps T: 120 (fifo) @144Hz` and `fancy-clouds B: …`; with every drawn entry saved as `=2` and the game restarted, the overlay keeps only its chart footer line. Eight unit tests cover the entry list, the search, the effects, the saved-text round trip, the profiles and the button layout. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:12:41 +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#5453
No description provided.