[PR #4270] [MERGED] Keep the mouse wheel off the hotbar while a book or lectern is open #5532

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4270
Author: @DenisHumen
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/lectern-scroll


📝 Commits (1)

  • c7cfd91 Keep the mouse wheel off the hotbar while a book or lectern is open

📊 Changes

1 file changed (+15 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+15 -0)

📄 Description

🤖 Opened by DenisHumen's AI agent (Claude Code, Opus 5.5), not by DenisHumen personally.

What

The mouse wheel no longer changes the selected hotbar slot while a book or lectern is open. The same applies to the other screens Horizon draws on top of gameplay while screen stays Playing: a sign being edited, a server dialog, the code of conduct, and the link and server-pack prompts. A new Game::screen_over_playing lists those screens, and the hotbar/spectator wheel branch now checks it.

Why (vanilla 26.3)

MouseHandler.onScroll: if there is an overlay, the wheel is ignored. If minecraft.screen is not null, the wheel goes to screen.mouseScrolled. The hotbar (ScrollWheelHandler → Inventory.setSelectedSlot) or the spectator menu only gets it when no screen is open. LecternScreen and BookViewScreen are both screens, so vanilla never moves the hotbar under them. Horizon only checked self.screen == Screen::Playing, which stays true while these screens are shown.

Checked

In game with horizon-ctl (creative world, offscreen, scratch HORIZON_HOME): I placed a lectern, put a written book on it, opened it, then ran scroll-at 100 100 -3.

  • Before (upstream/main bb6406719): the lectern screen stays open and the selected slot goes from 1 to 4.
  • After: the slot stays at 1 with the lectern screen open. It also stays put with a held written book open (use-item). After book done, the same scroll moves the slot from 1 to 4 as normal.

Fixes #4253

pr_ready

pr_ready (tools/pr_ready.py --base upstream/main on DenisPC, against upstream/main at bb6406719, 4 min 12 s)

Check Result
Scope ✅ 1 files, +15 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (1 min 3 s)
rustfmt ✅ (7 s)
clippy ❌ failed (14 s)
tests: horizon-client ❌ 726 passed, 1 failed (2 min 41 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ❌ 362 affected, (1 s)

These red rows also fail on this Windows machine without this change:

  • clippy: clippy 1.96 lints in code this PR doesn't touch. cargo clippy -p horizon-client --all-targets -- -D warnings -A clippy::manual_range_contains -A clippy::nonminimal_bool -A clippy::overly_complex_bool_expr passes.
  • tests: title::tests::each_world_preset_writes_its_own_generator fails on Windows (NotADirectory).
  • Parity: tools/parity.py needs fcntl, so it can't run on Windows. CI runs it with run-parity.

🤖 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/4270 **Author:** [@DenisHumen](https://github.com/DenisHumen) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/lectern-scroll` --- ### 📝 Commits (1) - [`c7cfd91`](https://github.com/horizon-rust/horizon/commit/c7cfd91f14b67f143f7f2cd7cf34943a20a8a6c1) Keep the mouse wheel off the hotbar while a book or lectern is open ### 📊 Changes **1 file changed** (+15 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+15 -0) </details> ### 📄 Description > 🤖 Opened by DenisHumen's AI agent (Claude Code, Opus 5.5), not by DenisHumen personally. ## What The mouse wheel no longer changes the selected hotbar slot while a book or lectern is open. The same applies to the other screens Horizon draws on top of gameplay while `screen` stays `Playing`: a sign being edited, a server dialog, the code of conduct, and the link and server-pack prompts. A new `Game::screen_over_playing` lists those screens, and the hotbar/spectator wheel branch now checks it. ## Why (vanilla 26.3) `MouseHandler.onScroll`: if there is an overlay, the wheel is ignored. If `minecraft.screen` is not null, the wheel goes to `screen.mouseScrolled`. The hotbar (`ScrollWheelHandler` → `Inventory.setSelectedSlot`) or the spectator menu only gets it when no screen is open. `LecternScreen` and `BookViewScreen` are both screens, so vanilla never moves the hotbar under them. Horizon only checked `self.screen == Screen::Playing`, which stays true while these screens are shown. ## Checked In game with `horizon-ctl` (creative world, offscreen, scratch `HORIZON_HOME`): I placed a lectern, put a written book on it, opened it, then ran `scroll-at 100 100 -3`. - Before (upstream/main bb6406719): the lectern screen stays open and the selected slot goes from 1 to 4. - After: the slot stays at 1 with the lectern screen open. It also stays put with a held written book open (`use-item`). After `book done`, the same scroll moves the slot from 1 to 4 as normal. Fixes #4253 ## pr_ready **pr_ready** (`tools/pr_ready.py --base upstream/main` on DenisPC, against upstream/main at bb6406719, 4 min 12 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +15 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (1 min 3 s) | | rustfmt | ✅ (7 s) | | clippy | ❌ failed (14 s) | | tests: horizon-client | ❌ 726 passed, 1 failed (2 min 41 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ❌ 362 affected, (1 s) | These red rows also fail on this Windows machine without this change: - clippy: clippy 1.96 lints in code this PR doesn't touch. `cargo clippy -p horizon-client --all-targets -- -D warnings -A clippy::manual_range_contains -A clippy::nonminimal_bool -A clippy::overly_complex_bool_expr` passes. - tests: `title::tests::each_world_preset_writes_its_own_generator` fails on Windows (NotADirectory). - Parity: `tools/parity.py` needs `fcntl`, so it can't run on Windows. CI runs it with `run-parity`. 🤖 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 05:13:14 +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#5532
No description provided.