feat(menus): the game's menu prompts are clickable #3219
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3219
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:feat/clickable-prompts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The system screens' overlay (title screen, file select, Options, the save screen) and the pause menu show button prompts at the bottom right: "Select (A)", "Back (B)", Options' "Default Settings (Y)". With the mouse, only Back could be clicked, by a fixed box. This makes shown prompts for A, B, X, Y, L, ZL, R and ZR clickable, the game's and any a mod shows, with nothing for a mod to do: a click on a prompt presses its button when no menu button is under the click.
How: the game's guide fills (sites
menu.guideSet,menu.pauseGuideSet, and the engine's callbacks) note each guide's key; a click that lands on no menu button but on a shown guide's pane taps that guide's key. The Widescreen mod tells the clicks how the system overlay is drawn while it covers a wider picture, so the hit boxes follow it at 21:9.Read first:
note_guide,prompt_atandpane_rectingame/crates/game-core/src/menus.rs; the two sites ingame/sites/sites.toml;set_system_overlay_unitsingame/mods/widescreen/src/ui.rs.Windows only, like the menus' mouse itself: on Linux the game's menus take no mouse yet (
MOUSE_MENUSiscfg!(windows)onmain, andtickreturns before the mouse), so there is nothing for a prompt click to join there. Linux follows when the menus' mouse comes to Linux, which is not this PR.This is part 2 of #2642 (the core part, which comes first). Part 1, a mod API to set a screen's prompts (
ui.prompts.set/reset), is not in here. See #2642.Testing
Tested: Windows 11, RTX 3080 (NVIDIA 621.47), 3440x1440 (21:9), played by hand with the mouse in a build of
mainf359e2621with this commit: clicking the prompts at the bottom right pressed their buttons. Again the same day with the Widescreen fix (separate PR) on top, Ultrawide menus Centred: the clicks still landed on the prompts where they are drawn.cargo fmt --check,cargo testandcargo clippybefore the button priority fix, this PC (Windows 11, Rust 1.99.1 gnullvm):game-core411 passed,sysmod-widescreen61,sites46 + 6, none failed; clippy names nothing in these crates (its warnings aremain's).Still to test:
Measurements
Not measured: a guide fill notes one key in a small table; the hit test runs only on a mouse click in a menu.
Risks
The menus' mouse only (Windows): a click that lands on a menu button is that button, including where it overlaps a prompt or the old fixed Back box; a click off the buttons on a shown prompt for a supported key presses that prompt's button; the old fixed Back box applies when no supported prompt is found. No setting, save or cache changes; a revert is enough.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). Not run whole yet: the crates' tests above.main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
docs/user/graphics-and-controls.md, the menus' mouse).Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 3080 (NVIDIA 621.47), 3440x1440 (21:9), by hand with the mouse on main
f359e2621+ this: clicking the bottom-right prompts pressed their buttons; again with the Widescreen fix on top (Ultrawide menus Centred), the clicks still landed on the prompts.Possibly related, for context:
WIP: feat(menus): the game's menu prompts are clickableto feat(menus): the game's menu prompts are clickableRecommendation: Request changes. Prompt hit boxes take priority over overlapping menu buttons, contrary to the described behavior. The feature also cannot work on Linux because the menu mouse path returns before processing clicks.
The change records overlay guide keys and maps clicks on their panes to button presses, including a widescreen coordinate adjustment. It adds useful mouse access on Windows, but changes click priority and leaves Linux without the advertised behavior.
Blocking (2): must change before merging.
game/crates/game-core/src/menus.rs:418: A prompt rectangle suppresses menu-button hit testing before the buttons are checked, reversing the priority promised by the change. (more on the line) Do: Find the button under the mouse first, and use prompt hit testing only when no button was hit. Add a test with overlapping button and guide rectangles.game/crates/game-core/src/menus.rs:1151: The new prompt click handling is unreachable on Linux. (more on the line) Do: Implement and enable the menu mouse path on Linux, including its host pointer handling, or explicitly narrow the feature and its Linux testing claim to Windows.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
@fixcan do L1 and L2.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the Windows configuration tested: the author reports that bottom-right prompt clicks pressed their buttons at 3440×1440, including with the separate Widescreen fix. Coverage of individual screens, controller icons and Linux remains incomplete; this is not a performance change.
Other systems: The mouse menu path is Windows-only, so Linux cannot use the new click handling. The author tested one NVIDIA Windows ultrawide setup; the remaining screen and controller cases have not been reported. The change does not alter saves, renderer interfaces or GPU settings.
Switches: None added, changed or removed. The existing HOS_MENU_TRACE switch gains prompt diagnostics.
Reviewed:
9b715c57ddagainstf359e26213: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards and the screenshot maintenance rules; docs/review-checklist.md and the sibling Tooling checkout were absent. Reviewed the complete diff and commit, menus code and related memory and input paths, the widescreen coordinate calculation, site declarations, tests, documentation change and site ownership entries. The remaining unchanged portions of the large sites and widescreen files were skimmed.; nothing run (a code review).Checked and fine:
Testing: No commands that build, run tests or execute project code were run, as requested. CI is still running; the author reports an in-game Windows ultrawide run.
Overlaps and merge order: The description identifies this as part 2 of #2642 and refers to a separate Widescreen fix; their merge status was not available in the supplied evidence.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as dyst took it out of WIP. Nothing was run; a maintainer decides.
@ -266,3 +416,3 @@});list_boxes(h);if on_back_prompt(h.x, h.y) {if on_back_prompt(h.x, h.y) || prompt_at(h.x, h.y).is_some() {L1 (blocking): A prompt rectangle suppresses menu-button hit testing before the buttons are checked, reversing the priority promised by the change.
When: When a shown guide pane overlaps a menu button's hit box, hit_test returns with hit equal to zero. The click then taps the guide's key instead of focusing and selecting the button.
Do: Find the button under the mouse first, and use prompt hit testing only when no button was hit. Add a test with overlapping button and guide rectangles.
@ -1002,1 +1149,3 @@host_sys::input::tap("0:B/80");// A prompt at the bottom right, off the buttons: a guide the overlays' fills noted taps its key (Back's B,// a mod's X ...); else the "Back" prompt's fixed box (B), on every screen with one (the title's load list, the// pause menu, the map).L2 (blocking): The new prompt click handling is unreachable on Linux.
When: On Linux, MOUSE_MENUS is false and tick returns before mouse_tick, so clicking Select, Back or another prompt never reaches this code.
Do: Implement and enable the menu mouse path on Linux, including its host pointer handling, or explicitly narrow the feature and its Linux testing claim to Windows.
Checks on this PC (Windows 11, Rust 1.99.1 gnullvm), on the head
9b715c57d:cargo fmt --checkclean forgame-core,sysmod-widescreenandsites;cargo test:game-core411 passed,sysmod-widescreen61,sites46 + 6, none failed;cargo clippy --all-targetsnothing in these crates (the warnings it prints are main's, inbuild-core,build-assetsandhost-sys). (game-coreandsysmod-widescreenwere run with #3218 on top;siteson this commit alone.)On BeanBot's review (
9b715c57d):mainalready checks the fixed Back box before the buttons inhit_test; this PR adds the other shown prompts to that same check.main(MOUSE_MENUS = cfg!(windows), and the user docs say "(Windows)"), so prompt clicks are too. The Linux line is gone from Still to test, and the description says so. Bringing the menus' mouse to Linux is separate work, deferred.@rebase
I rebased this pull request onto
main(b6330a5b0b): the new head is16e316fbfd.Conflicts resolved
Nothing was built or run: read the resolution before merging.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
9b715c57dd16e316fbfdRecommendation: Request changes. A prompt hit still takes priority over a menu button when their rectangles overlap, contrary to the promised behavior. The remaining 16:9 and controller-icon cases also need an in-game run.
Makes menu button prompts clickable on Windows and adjusts system-overlay hit coordinates for widescreen layouts. It adds guide tracking and hit testing, with an unresolved button-priority conflict.
Blocking (1): must change before merging.
game/crates/game-core/src/menus.rs:418: A prompt rectangle suppresses menu-button hit testing before the buttons are checked, reversing the priority promised by the change. When: When a shown guide pane overlaps a menu button's hit box, hit_test returns with hit equal to zero. The click then taps the guide's key instead of focusing and selecting the button. Do: Find the button under the mouse first, and use prompt hit testing only when no button was hit. Add a test with overlapping button and guide rectangles.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
@fixcan do L1.Since the last review (on
9b715c57dd)Withdrawn (it was wrong): L2 (The new prompt click handling is unreachable on Linux.)
Still open: L1 (A prompt rectangle suppresses menu-button hit testing before the buttons are checked, reve…); L3 (The reported run does not cover the individual menu and controller-icon cases listed as st…)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes: the author reports that prompt clicks pressed their buttons on Windows at 3440×1440, including with the widescreen fix. The individual 16:9 menu and controller-icon cases remain untested.
Other systems: Linux retains the existing disabled mouse-menu path. Widescreen overlay coordinates are adjusted and were exercised in the reported Windows run; controller icon changes and 16:9 menus remain to be tested.
Switches: No switches added, changed or removed. The existing HOS_MENU_TRACE switch also logs prompt information when enabled; its default remains off.
Reviewed:
16e316fbfdagainstb6330a5b0b: Read the diff, commit summary, AGENTS.md, CONTRIBUTING.md, pull request template, and relevant menu hit-testing and platform paths. Skimmed the changed code files, site declarations and recorded test reports; the full changed code files were not read in full. The referenced Tooling AGENTS.md and docs/review-checklist.md were not present.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run project code were executed. The author reports Windows in-game testing and crate checks; CI is still running.
Overlaps and merge order: None identified; the description references a separate widescreen fix used in testing.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.
@fix
16e316fbfd3ea3b9e0aaRecommendation: Approve. The code is ready: only testing is left (a run of the change itself). The reported Windows run shows prompt clicks working at 21:9, but the listed 16:9 menu cases and clicking with a controller connected remain untested. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
3ea3b9e0aa. I rebased it ontomain(b80297399b). I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
The change makes supported menu button prompts clickable and gives menu buttons priority where their hit boxes overlap prompts. The fix preserves prompt clicks when no button is under the pointer.
Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
Checks: they run again on this head; a failure shows on the pull request.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven for all listed cases: the author reports successful prompt clicks on Windows at 21:9, including with centred widescreen menus; the individual 16:9 and controller-icon cases remain to be tested.
Other systems: Menu mouse input remains Windows-only. The widescreen mod supplies the system overlay's coordinate scaling; the reported 21:9 run covers its centred mode. Controller-connected behavior remains untested.
Switches: None added, changed or removed by the prompt-click change.
Reviewed:
3ea3b9e0aaagainstb80297399b: Read the repository's AGENTS.md, CONTRIBUTING.md and pull request template, the fix diff, and the prompt, hit-test and relevant test code in menus.rs. Skimmed the feature diff and the remaining menus.rs code; the full base-to-head diff also contains unrelated commits and was not read in full. The referenced Tooling AGENTS.md and docs/review-checklist.md were unavailable.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run tests were executed. The author reports an in-game 21:9 Windows run and crate checks before the button-priority fix; CI has not run on this head.
Overlaps and merge order: None found in the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.