Input & F1 menu: native map drag/pivot zoom, fwui hover focus, and F1 mouse controls #2225

Manually merged
github merged 1 commit from github-bot/gh-2225 into main 2026-11-30 14:17:05 +00:00 AGit
Owner

@⁠lyufeng000 on GitHub · 2026-11-29 10:43 UTC · original
lyufeng000:input-map-menu-mouse → main · +3709 −154 · 8 files · 1 commits · merged 2026-11-30 14:12 UTC

Follow-up to #1356 and #1570 (cc @⁠JoeY54).

What it changes

Builds on the native mouse input path merged via #1570 (2f0b541b) to add full mouse support across the World Map, in-game menus, and the F1 settings overlay, while staying behind the existing VICTORY_MNK=1 (F1 > MOUSE AND KEYBOARD) and VICTORY_NATIVE_MOUSE gates:

  • Native World Map mouse controls (mousehook, gameinput, lifecycle):
    • 1:1 cursor-anchored panning by dragging with LMB (past a 4 px deadzone) or MMB via MapCam::AddTargetDelta (with stick-pan fallback if the hook is unavailable) and IDC_SIZEALL drag cursor / window capture handling.
    • Native cursor-pivot mouse wheel zoom via MapCam::ZoomStepWithPivot (plus LT/RT pulse fallback in UiMode::Map when menu mouse is active).
    • LMB click = A (select / waypoint), MMB click = X, RMB = B (back), Mouse4/Mouse5 = LB/RB tabs.
  • In-game menu mouse interaction (mousehook, gameinput, lifecycle):
    • Native fwui screen-loop hover hit-testing (VICTORY_MENU_MOUSE=1 by default, =0 disables) so moving the cursor highlights menu items directly without fighting keyboard/pad navigation.
    • LMB = A, RMB = B, wheel = fast D-pad Up/Down, Mouse4/Mouse5 = LB/RB.
    • Clean re-lock on click back into gameplay without firing or aiming.
  • F1 settings menu mouse & wheel controls (victory-gpu: lib.rs, host/menu.rs):
    • Mouse hover selection (only updates when the cursor moves so it does not fight arrow keys or controller navigation), LMB click on </>/actions, RMB back/close, and mouse wheel scrolling (SETTINGS_MENU_WHEEL).
    • Integrated with upstream's MenuKey / PAD_TOGGLES, CLEAR SHADER CACHE, and KEY BINDINGS submenu (pausing menu mouse clicks while waiting to bind a key or mouse button).
  • Launcher env preservation & docs (apps/victory/src/play.rs, README.md, docs/architecture.md):
    • Preserves VICTORY_MAP_DRAG_SENS, VICTORY_MAP_DRAG_INVERT, and VICTORY_MENU_MOUSE in play.rs KEPT and documents the controls and tuning variables.

Design notes (in response to @⁠JoeY54 on #1570)

  1. Map zoom with mouse wheel: This follow-up closes the gap you noted on #1570—in UiMode::Map, wheel input now drives native cursor-pivot zoom (MapCam::ZoomStepWithPivot) with LT/RT pulse fallback when the cursor is released.
  2. Keeping build offsets in-tree: Keeping the per-build offsets and prologue checks in-tree (as allowed by docs/asset-policy.md) is an intentional design choice for out-of-the-box usability: users can turn on F1 > MOUSE AND KEYBOARD without having to obtain or maintain an external offset file. Every hook verifies its expected instruction prologue before patching and safely falls back when checks do not match (and VICTORY_NATIVE_MOUSE=0 still falls back cleanly to mnk.rs).

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 4090 (Ryzen 9 9950X), Windows 11, Series X
  • Before: Native mouse aiming worked in gameplay, but the World Map could not be panned or zoomed with the mouse wheel while the cursor was released, in-game menus lacked hover selection, and the F1 menu only accepted keyboard/pad input.
  • After: World Map supports 1:1 drag panning and cursor-pivot wheel zoom; Pause/Shop/in-game menus support hover selection, clicks, and wheel scrolling; F1 overlay supports hover, click, right-click back/close, and wheel scrolling across main settings, save picker, and KEY BINDINGS, without breaking controller-only (pads_only) mode.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes)
  • cargo test passed for the crates it touches: yes (victory-hle: 435 passed; victory: 81 passed; victory-gpu host::menu::tests: 22 passed; clippy clean on all touched files)

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #1356, #1570
**@⁠lyufeng000** on GitHub · 2026-11-29 10:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2225) `lyufeng000:input-map-menu-mouse` → `main` · +3709 −154 · 8 files · 1 commits · merged 2026-11-30 14:12 UTC Follow-up to #1356 and #1570 (cc @⁠JoeY54). ## What it changes Builds on the native mouse input path merged via #1570 (`2f0b541b`) to add full mouse support across the World Map, in-game menus, and the F1 settings overlay, while staying behind the existing `VICTORY_MNK=1` (`F1 > MOUSE AND KEYBOARD`) and `VICTORY_NATIVE_MOUSE` gates: - **Native World Map mouse controls (`mousehook`, `gameinput`, `lifecycle`)**: - 1:1 cursor-anchored panning by dragging with `LMB` (past a 4 px deadzone) or `MMB` via `MapCam::AddTargetDelta` (with stick-pan fallback if the hook is unavailable) and `IDC_SIZEALL` drag cursor / window capture handling. - Native cursor-pivot mouse wheel zoom via `MapCam::ZoomStepWithPivot` (plus `LT`/`RT` pulse fallback in `UiMode::Map` when menu mouse is active). - `LMB` click = `A` (select / waypoint), `MMB` click = `X`, `RMB` = `B` (back), `Mouse4`/`Mouse5` = `LB`/`RB` tabs. - **In-game menu mouse interaction (`mousehook`, `gameinput`, `lifecycle`)**: - Native `fwui` screen-loop hover hit-testing (`VICTORY_MENU_MOUSE=1` by default, `=0` disables) so moving the cursor highlights menu items directly without fighting keyboard/pad navigation. - `LMB` = `A`, `RMB` = `B`, wheel = fast D-pad `Up`/`Down`, `Mouse4`/`Mouse5` = `LB`/`RB`. - Clean re-lock on click back into gameplay without firing or aiming. - **F1 settings menu mouse & wheel controls (`victory-gpu`: `lib.rs`, `host/menu.rs`)**: - Mouse hover selection (only updates when the cursor moves so it does not fight arrow keys or controller navigation), `LMB` click on `<`/`>`/actions, `RMB` back/close, and mouse wheel scrolling (`SETTINGS_MENU_WHEEL`). - Integrated with upstream's `MenuKey` / `PAD_TOGGLES`, `CLEAR SHADER CACHE`, and `KEY BINDINGS` submenu (pausing menu mouse clicks while waiting to bind a key or mouse button). - **Launcher env preservation & docs (`apps/victory/src/play.rs`, `README.md`, `docs/architecture.md`)**: - Preserves `VICTORY_MAP_DRAG_SENS`, `VICTORY_MAP_DRAG_INVERT`, and `VICTORY_MENU_MOUSE` in `play.rs` `KEPT` and documents the controls and tuning variables. ### Design notes (in response to @⁠JoeY54 on #1570) 1. **Map zoom with mouse wheel**: This follow-up closes the gap you noted on #1570—in `UiMode::Map`, wheel input now drives native cursor-pivot zoom (`MapCam::ZoomStepWithPivot`) with `LT`/`RT` pulse fallback when the cursor is released. 2. **Keeping build offsets in-tree**: Keeping the per-build offsets and prologue checks in-tree (as allowed by `docs/asset-policy.md`) is an intentional design choice for out-of-the-box usability: users can turn on `F1 > MOUSE AND KEYBOARD` without having to obtain or maintain an external offset file. Every hook verifies its expected instruction prologue before patching and safely falls back when checks do not match (and `VICTORY_NATIVE_MOUSE=0` still falls back cleanly to `mnk.rs`). ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 4090 (Ryzen 9 9950X), Windows 11, Series X - Before: Native mouse aiming worked in gameplay, but the World Map could not be panned or zoomed with the mouse wheel while the cursor was released, in-game menus lacked hover selection, and the F1 menu only accepted keyboard/pad input. - After: World Map supports 1:1 drag panning and cursor-pivot wheel zoom; Pause/Shop/in-game menus support hover selection, clicks, and wheel scrolling; F1 overlay supports hover, click, right-click back/close, and wheel scrolling across main settings, save picker, and `KEY BINDINGS`, without breaking controller-only (`pads_only`) mode. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes) - `cargo test` passed for the crates it touches: yes (`victory-hle`: 435 passed; `victory`: 81 passed; `victory-gpu` `host::menu::tests`: 22 passed; `clippy` clean on all touched files) ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #1356, #1570
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 10:44:39 +00:00
github manually merged commit 4e37019c72 into main 2026-11-30 14:17:05 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/trustno1-coder--VIctory-NVIDIA!2225
No description provided.