[PR #392] [MERGED] Shift + double-click moves every matching stack #2529

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

📋 Pull Request Information

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

Base: main ← Head: fix/shift-double-click


📝 Commits (2)

  • b9e9265 Run the creative item tabs' clicks as CreativeModeInventoryScreen does
  • a061c40 Move every matching stack on a Shift double click

📊 Changes

6 files changed (+481 additions, -61 deletions)

View changed files

📝 crates/horizon-client/examples/menu_fixture.rs (+11 -2)
📝 crates/horizon-client/src/creative.rs (+182 -0)
📝 crates/horizon-client/src/game.rs (+115 -49)
📝 crates/horizon-client/src/menu.rs (+144 -5)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaMenuOracle.java (+16 -0)
📝 tools/test_menu_click_parity.py (+13 -5)

📄 Description

Shift + double-click now moves every matching stack, as in vanilla (#275: "Shift double click not transferring all stacks of that specific item type between your inventory and the container at once").

Vanilla

AbstractContainerScreen.mouseReleased: on a double click with Shift held, when canTakeItemForPickAll(EMPTY, slot) allows the clicked slot, every slot that mayPickup, has an item, is in the same container as the clicked slot and canItemQuickReplace(target, lastQuickMoved, true) is QUICK_MOVEd. lastQuickMoved is a copy of what the last Shift click moved: set by the press QUICK_MOVE with an empty hand, and by the release QUICK_MOVE that ends a click holding a stack.

What changed

  • Menu::quick_move_all runs that loop on the menu engine; can_take_for_pick_all is now one helper shared with PICKUP_ALL.
  • inventory_press tracks lastQuickMoved and the double click for Shift presses too. Like Horizon's existing PICKUP_ALL, it acts on the second press and skips that press's release. Screens the menu engine doesn't model (the workstations) keep their own single shift-click.

How tested

  • test_menu_click_parity generates a new QUICK_MOVE_ALL op (with lastQuickMoved: mostly a stack already in the menu). The Java oracle runs the screen's loop with the real Slot.mayPickup, Slot.container, canTakeItemForPickAll and AbstractContainerMenu.canItemQuickReplace, over every menu except the *_be furnaces (the fixture syncs their block entity once per op): 8000/8000 cases match.

Self-check:

cargo fmt --all --check                                   ok
cargo clippy --workspace --all-targets -- -D warnings     ok
cargo test -p horizon-client                              ok (689 + 44 + 15 + 2 + 2 + 2 on the integration commit)
tools/test_menu_click_parity.py                           8000/8000 cases match
tools/parity.py --changed origin/main                     80 passed, 0 failed (56 min), one run over an integration commit of all the inventory PRs (this one included)

Stacked on #391. Part of #275.

🤖 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/392 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/shift-double-click` --- ### 📝 Commits (2) - [`b9e9265`](https://github.com/horizon-rust/horizon/commit/b9e926588bca6e8c8ca972fa718262e85a0832f9) Run the creative item tabs' clicks as CreativeModeInventoryScreen does - [`a061c40`](https://github.com/horizon-rust/horizon/commit/a061c40fde9ceb5b24c6bad8734f6da09ebbe87f) Move every matching stack on a Shift double click ### 📊 Changes **6 files changed** (+481 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/menu_fixture.rs` (+11 -2) 📝 `crates/horizon-client/src/creative.rs` (+182 -0) 📝 `crates/horizon-client/src/game.rs` (+115 -49) 📝 `crates/horizon-client/src/menu.rs` (+144 -5) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaMenuOracle.java` (+16 -0) 📝 `tools/test_menu_click_parity.py` (+13 -5) </details> ### 📄 Description Shift + double-click now moves every matching stack, as in vanilla (#275: "Shift double click not transferring all stacks of that specific item type between your inventory and the container at once"). ## Vanilla `AbstractContainerScreen.mouseReleased`: on a double click with Shift held, when `canTakeItemForPickAll(EMPTY, slot)` allows the clicked slot, every slot that `mayPickup`, has an item, is in the **same container** as the clicked slot and `canItemQuickReplace(target, lastQuickMoved, true)` is QUICK_MOVEd. `lastQuickMoved` is a copy of what the last Shift click moved: set by the press QUICK_MOVE with an empty hand, and by the release QUICK_MOVE that ends a click holding a stack. ## What changed - `Menu::quick_move_all` runs that loop on the menu engine; `can_take_for_pick_all` is now one helper shared with PICKUP_ALL. - `inventory_press` tracks `lastQuickMoved` and the double click for Shift presses too. Like Horizon's existing PICKUP_ALL, it acts on the second press and skips that press's release. Screens the menu engine doesn't model (the workstations) keep their own single shift-click. ## How tested - `test_menu_click_parity` generates a new `QUICK_MOVE_ALL` op (with `lastQuickMoved`: mostly a stack already in the menu). The Java oracle runs the screen's loop with the real `Slot.mayPickup`, `Slot.container`, `canTakeItemForPickAll` and `AbstractContainerMenu.canItemQuickReplace`, over every menu except the `*_be` furnaces (the fixture syncs their block entity once per op): **8000/8000 cases match**. Self-check: ``` cargo fmt --all --check ok cargo clippy --workspace --all-targets -- -D warnings ok cargo test -p horizon-client ok (689 + 44 + 15 + 2 + 2 + 2 on the integration commit) tools/test_menu_click_parity.py 8000/8000 cases match tools/parity.py --changed origin/main 80 passed, 0 failed (56 min), one run over an integration commit of all the inventory PRs (this one included) ``` Stacked on #391. Part of #275. 🤖 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:56:57 +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#2529
No description provided.