[PR #266] [MERGED] Add the F3+F4 game mode switcher #2449

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

📋 Pull Request Information

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

Base: main ← Head: fix/gamemode-switcher


📝 Commits (1)

  • 25858f6 Add the F3+F4 game mode switcher

📊 Changes

10 files changed (+304 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/debug_keys.rs (+17 -0)
📝 crates/horizon-client/src/game.rs (+6 -0)
📝 crates/horizon-client/src/game/agent.rs (+1 -0)
📝 crates/horizon-client/src/game/control.rs (+2 -0)
📝 crates/horizon-client/src/game/debug_keys.rs (+32 -4)
➕ crates/horizon-client/src/game/gamemode_switcher.rs (+86 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+26 -0)
➕ crates/horizon-client/src/game_mode_switcher.rs (+119 -0)
📝 crates/horizon-client/src/lib.rs (+1 -0)
📝 crates/horizon-protocol/src/packets/play.rs (+14 -0)

📄 Description

F3+F4 currently consumes the shortcut without opening anything. This adds the non-pausing game mode switcher: hold the debug modifier, cycle with the switch-mode key or move over an icon, then release the modifier to apply. Escape cancels. The initial selection uses the previous mode, with the vanilla Creative/Survival fallback.

The screen uses the existing Minecraft background, slot sprites, translated labels and item renderer. Keyboard bindings are respected, gameplay input is suppressed while open, and screenshots/fullscreen remain available. Remote clients send the typed change-game-mode packet; Horizon hosts check the guest's permission and apply the mode through the existing guest-state path.

Closes #209. This addresses the F3+F4 item from #258; the other debug shortcuts remain separate work.

Validation:

  • Three selection/hover regressions and the rebound debug-modifier release regression pass.
  • Existing debug-key tests: 10 passed. Protocol suite: 45 passed, including exact packet bytes and round trips for all four modes.
  • Client/protocol Clippy with all targets and warnings denied; formatting, diff and public-tree checks pass.
  • Checked the relevant screen, nested icon/slot classes and packet against the locally pinned 26.3 jars. No recovered source or game assets are included.

No game window or live server test was run. Manual testing should cover cycling, mouse selection, release-to-apply, Escape cancellation, permission denial and server-confirmed changes. Debug mouse bindings remain outside Horizon's existing keyboard-only debug dispatcher.


🔄 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/266 **Author:** [@Online5277](https://github.com/Online5277) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/gamemode-switcher` --- ### 📝 Commits (1) - [`25858f6`](https://github.com/horizon-rust/horizon/commit/25858f63ae6f1551a0c8769ab177dfc61f497db8) Add the F3+F4 game mode switcher ### 📊 Changes **10 files changed** (+304 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/debug_keys.rs` (+17 -0) 📝 `crates/horizon-client/src/game.rs` (+6 -0) 📝 `crates/horizon-client/src/game/agent.rs` (+1 -0) 📝 `crates/horizon-client/src/game/control.rs` (+2 -0) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+32 -4) ➕ `crates/horizon-client/src/game/gamemode_switcher.rs` (+86 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+26 -0) ➕ `crates/horizon-client/src/game_mode_switcher.rs` (+119 -0) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) 📝 `crates/horizon-protocol/src/packets/play.rs` (+14 -0) </details> ### 📄 Description F3+F4 currently consumes the shortcut without opening anything. This adds the non-pausing game mode switcher: hold the debug modifier, cycle with the switch-mode key or move over an icon, then release the modifier to apply. Escape cancels. The initial selection uses the previous mode, with the vanilla Creative/Survival fallback. The screen uses the existing Minecraft background, slot sprites, translated labels and item renderer. Keyboard bindings are respected, gameplay input is suppressed while open, and screenshots/fullscreen remain available. Remote clients send the typed change-game-mode packet; Horizon hosts check the guest's permission and apply the mode through the existing guest-state path. Closes #209. This addresses the F3+F4 item from #258; the other debug shortcuts remain separate work. Validation: - Three selection/hover regressions and the rebound debug-modifier release regression pass. - Existing debug-key tests: 10 passed. Protocol suite: 45 passed, including exact packet bytes and round trips for all four modes. - Client/protocol Clippy with all targets and warnings denied; formatting, diff and public-tree checks pass. - Checked the relevant screen, nested icon/slot classes and packet against the locally pinned 26.3 jars. No recovered source or game assets are included. No game window or live server test was run. Manual testing should cover cycling, mouse selection, release-to-apply, Escape cancellation, permission denial and server-confirmed changes. Debug mouse bindings remain outside Horizon's existing keyboard-only debug dispatcher. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:56:15 +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#2449
No description provided.