Repository navigation
Conversation
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>
Restart starts the game again from the Insert menu, with the same confirm step as Quit: the first press shows Confirm, a second one restarts, B or Esc cancels. It saves first and posts WM_APP + 9, the restart question's Restart now path (host/hos_relaunch.c: execve in place on Linux, a new process on Windows). quit_pending becomes pending, the row waiting for its second press, so the two rows share the confirm state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hckrman101
left a comment
There was a problem hiding this comment.
Thanks for this, it's exactly the Restart option I was after. Reviewed the new commit on top of #1255 (so this should merge after it).
What I checked and it holds up:
- One shared
pendingpointer means Quit and Restart can never both be armed, and a press on one can't confirm the other. Moving to another row, switching tab, closing the menu, B/Esc or right click all clear it. A click on the other row clears and then arms that row, so it still needs its own second press. kRestartRow/kQuitRow/kCheatsRowstill count back from the end and are right. Cheats being hidden only affectsrow_shown, not the indices, and the comment now says the last three rows.- The restart goes through the same save +
pipeline_cache_save(true)+WM_APP + 9path as the restart question's Restart now. On Linux that ends inexecvein place with the original args/env, on Windows a new process withHOS_RESTART_OF, and the old one closes the window first. No host change needed. - Help text and the Confirm label look fine.
One small nit inline, nothing blocking.
| if (&r == &rows[kRestartRow]) { // (the restart question's Restart now: the window closes, then the game starts again) | ||
| logf("menu: restart"); | ||
| open_now = false, changed = true; | ||
| PostMessageA(app_window(), WM_APP + 9, 0, 0); |
There was a problem hiding this comment.
Nit: Quit guards with if (const HWND window = app_window()) but this one posts straight to app_window() (same as the existing Restart now). Harmless if the window is always there, but a null check would match Quit. The save/cache/post sequence is also now written twice (here and in the restart question), so a tiny shared helper could keep them in step. Fine to leave as is.
There was a problem hiding this comment.
Thanks! The null check is in ff0651a: the Restart row now posts WM_APP + 9 only when app_window() returns a window, the same as Quit.
I left the shared helper out on purpose. It would also change the restart question's existing Restart now, and I'd rather keep this PR to the new row. I can send the helper as its own small PR if the maintainer wants it.
Re-checked on CachyOS: the renderer builds, and test_menu_hit, test_menu_restart, test_rumble_menu and test_input_background pass.
Review of NotRexed#1266: Quit posts WM_CLOSE only when app_window() has a window; Restart now does the same before WM_APP + 9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds a Restart row to the Insert menu's Gameplay tab, next to Quit, as asked in #1255's review. It is a separate PR because CONTRIBUTING asks for one topic per pull request.
Depends on #1255. This branch is built on top of it, so until #1255 is merged the diff here also shows its commits. Only the last commit, 224d744, is new.
What it does
save()andpipeline_cache_save(true), thenWM_APP + 9. On Linux the game restarts in place withexecve. On Windows it starts a new process (host/hos_relaunch.c). No new message or platform code.quit_pendingbecomespending, a pointer to the row waiting for its second press, so the two rows share one confirm state. The comment by the table now covers all three rows that count back from its end.Validation
On CachyOS (RTX 5060, Hyprland/Wayland), on a build of main a1c4bcd plus this branch:
test_menu_hit,test_menu_restart,test_rumble_menuandtest_input_backgroundpass.menu: restart, thendisplay: window closed for a restart, then a new start that reaches the title video.Not tested: Windows, a physical controller, Steam Game Mode.
🤖 Generated with Claude Code