Skip to content

Add a controller-accessible Quit option to the Gameplay menu - #1255

Merged
hckrman101 merged 3 commits into
NotRexed:mainfrom
bronze-ff:feat/controller-quit-menu
Nov 9, 2026
Merged

hckrman101 merged 3 commits into
NotRexed:mainfrom
bronze-ff:feat/controller-quit-menu

Conversation

@bronze-ff

Copy link
Copy Markdown
Contributor

Add a Quit row to the Insert menu's Gameplay tab. The first activation shows Confirm. A second activation closes the game through the normal window-close path. B or Esc cancels the confirmation. The same action is available with Enter and mouse clicks.

This addresses the in-menu exit requested in #1203 and tracked in #1007.

Validation

  • Built from source and ran the game on CachyOS with Hyprland/Wayland, SDL3, and an RTX 5060.
  • Used a virtual USB Xbox Series controller through Linux uinput. View + Menu opened the overlay, RB selected Gameplay, and the D-pad selected Quit. Holding A left the game running with Confirm displayed. B cancelled it. Two separate A presses then closed the game with exit code 0 through the normal window-close handler.
  • Passed the three focused source regressions for menu hit testing, the rumble menu, and background input on Linux. Steam Game Mode and a physical controller still need a hardware check.

Assisted by OpenAI Codex.

bronze-ff and others added 3 commits November 9, 2026 15:58
Assisted-by: OpenAI Codex
Co-Authored-By: OpenAI Codex <codex@openai.com>
…t-menu

# Conflicts:
#	gpu/vk/vk_menu.cpp
#	host/posix/display_sdl.c
Review of NotRexed#1255: the window's own close (rx_close_asked, then
hos_window_closed_exit) does not force the pipeline cache, so Quit now calls
save() and pipeline_cache_save(true) before posting WM_CLOSE, as the restart
question's Restart now does. A comment by the table says Quit and Cheats
stay its last two rows, since kQuitRow and kCheatsRow count back from its
end (rows[] is not constexpr, so a static_assert on the name cannot check it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bronze-ff

Copy link
Copy Markdown
Contributor Author

Thanks for the review! Both points are in a7b27de:

  • Saving first: Quit now does save() and pipeline_cache_save(true) before WM_CLOSE, the same as Restart now. Details are in the inline thread.
  • Row order: a static_assert on the name won't compile here, because rows[] isn't constexpr (its rows point at opts). A comment by the table now says Quit and Cheats stay its last two rows, since kQuitRow and kCheatsRow count back from its end.

Re-tested on CachyOS (RTX 5060, Hyprland) with a virtual Xbox Series controller, on a build of main a1c4bcd plus this branch. The menu tests pass (test_menu_hit, test_menu_restart, test_rumble_menu, test_input_background). In the game, View + Menu, RB and D-pad up reach Quit. Holding A shows Confirm without quitting, B cancels, and A twice exits with code 0.

About the Restart option you asked for: I'll send it as a separate PR, since CONTRIBUTING asks for one topic per pull request. It will reuse the same confirm step and the restart question's Restart now path (WM_APP + 9).

@bronze-ff

Copy link
Copy Markdown
Contributor Author

The Restart option is now #1266. It is built on this branch, and only its last commit is new.

@hckrman101
hckrman101 merged commit dad7f51 into NotRexed:main Nov 9, 2026
10 checks passed
wyatt-poole added a commit to wyatt-poole/Hookshot that referenced this pull request Nov 10, 2026
Conflicts in gpu/vk/vk_menu.cpp with main's Audio output row (NotRexed#1240) and
the Restart/Quit confirm (NotRexed#1266, NotRexed#1255): tx_deadzone and tx_audio_output
both kept; Esc on the Motion page goes back before the pending confirm
is cancelled; the Motion row opens its page after the Cheats row's test
in main's confirm chain. TAB_MOTION is now TAB_COUNT itself (one past
the strip), and tab_selected is sized by it, so a tab added before
TAB_COUNT (NotRexed#1270) moves the Motion page along instead of colliding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BsKC8mjbyEUFAv6uy3SQiW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant