[PR #4021] [MERGED] Drag the stonecutter and villager trade scrollers #5363

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4021
Author: @phexuss
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/station-scrollbar-drag


📝 Commits (1)

  • 0801c95 Drag the stonecutter and villager trade scrollers

📊 Changes

3 files changed (+201 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+2 -2)
📝 crates/horizon-client/src/game/stations.rs (+125 -16)
📝 crates/horizon-client/src/game/trading.rs (+74 -2)

📄 Description

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

What and why

Part of #3518 (rows StonecutterScreen.mouseDragged and MerchantScreen.mouseDragged).

The stonecutter's and the villager trade screen's scrollers only moved with the mouse wheel: pressing and dragging them did nothing. This ports vanilla's mouseClicked (a press on the scroller's track holds it) and mouseDragged (the held scroller follows the cursor) for both screens, and lets go on mouse release. The stonecutter now keeps scrollOffs as a float like vanilla, so the wheel and the drag share it and the scroller is drawn at 41 * scrollOffs.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

StonecutterScreen.mouseClicked, mouseDragged, mouseScrolled, getOffscreenRows, isScrollBarActive; MerchantScreen.mouseClicked, mouseDragged. No harness: unit tests cover the scroller geometry (track bounds, cursor-to-offset, offset-to-row). Not checked in game, and written without the decompiled sources at hand, so a reviewer comparing against them is welcome.

Self-check

pr_ready (tools/pr_ready.py --quick on vm, against origin/main at 2204e3951, 1 min 48 s)

Check Result
Scope ✅ 3 files, +201 −20
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 475 passed (35 s)
rustfmt ✅ (6 s)
tests: horizon-client ✅ 889 passed (44 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 ➖ not run (--quick): CI's parity job picks the affected harnesses

The clippy failure is manual_range_contains from the local toolchain (Rust 1.97) in files this PR doesn't touch (horizon-world/src/worldgen/aquifer/noise_based.rs, game/dragon.rs). With that lint allowed, cargo clippy -p horizon-client --bins --tests -- -D warnings is clean.

🤖 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/4021 **Author:** [@phexuss](https://github.com/phexuss) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/station-scrollbar-drag` --- ### 📝 Commits (1) - [`0801c95`](https://github.com/horizon-rust/horizon/commit/0801c954b5bca84cc82d52e5b4a3cb36beab59cb) Drag the stonecutter and villager trade scrollers ### 📊 Changes **3 files changed** (+201 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+2 -2) 📝 `crates/horizon-client/src/game/stations.rs` (+125 -16) 📝 `crates/horizon-client/src/game/trading.rs` (+74 -2) </details> ### 📄 Description > 🤖 Opened by phexuss's AI agent (Claude Code, Claude Opus 5.5), not by phexuss personally. ## What and why Part of #3518 (rows `StonecutterScreen.mouseDragged` and `MerchantScreen.mouseDragged`). The stonecutter's and the villager trade screen's scrollers only moved with the mouse wheel: pressing and dragging them did nothing. This ports vanilla's `mouseClicked` (a press on the scroller's track holds it) and `mouseDragged` (the held scroller follows the cursor) for both screens, and lets go on mouse release. The stonecutter now keeps `scrollOffs` as a float like vanilla, so the wheel and the drag share it and the scroller is drawn at `41 * scrollOffs`. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `StonecutterScreen.mouseClicked`, `mouseDragged`, `mouseScrolled`, `getOffscreenRows`, `isScrollBarActive`; `MerchantScreen.mouseClicked`, `mouseDragged`. No harness: unit tests cover the scroller geometry (track bounds, cursor-to-offset, offset-to-row). Not checked in game, and written without the decompiled sources at hand, so a reviewer comparing against them is welcome. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on vm, against origin/main at 2204e3951, 1 min 48 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +201 −20 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 475 passed (35 s) | | rustfmt | ✅ (6 s) | | tests: horizon-client | ✅ 889 passed (44 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | The clippy failure is `manual_range_contains` from the local toolchain (Rust 1.97) in files this PR doesn't touch (`horizon-world/src/worldgen/aquifer/noise_based.rs`, `game/dragon.rs`). With that lint allowed, `cargo clippy -p horizon-client --bins --tests -- -D warnings` is clean. 🤖 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:12:03 +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#5363
No description provided.