menu: quit and restart the game from the F1 drawer, through the game's own shutdown #57

Manually merged
github merged 2 commits from github-bot/gh-57 into main 2026-12-05 20:02:41 +00:00 AGit
Owner

@⁠Kal0s-design on GitHub · 2026-12-05 19:31 UTC · original
Kal0s-design:port/menu-quit-restart → main · +124 −10 · 10 files · 2 commits · merged 2026-12-05 19:58 UTC

Two upstream ReVIctory commits by SovietBearz0r, authors kept, that add "Quit game" and "Restart game" to the F1 drawer and make both go through the game's own shutdown.

767d145 adds the two entries. Restart also asks for a new run, and the exit path then leaves victory_core::restart::AGAIN (75) instead of the game's code. The launcher's play job loops on exactly that code, so a run restarted from the menu comes back on its own, while one started from a shell just ends with 75. The flag and the code live in victory-core so the menu and the game's exit share one definition. 913da76 then fixes how they close the game. They post WM_SYSCOMMAND with SC_CLOSE to our window, which lifecycle turns into the game's shutdown, so its saves run and the pipeline cache is written and the next run starts warm. Before, they posted WM_CLOSE to every window found, which lifecycle didn't see. Each run of a restart also gets its own play log and rereads the settings the game's menu saved during the run.

The point is mostly the cache. Closing the window the hard way loses the pipelines made in that session, which is a common reason people see stutter again on the next start.

Both applied cleanly in order on current main. Merged with the test fixes from #48, victory, victory-core (19), victory-hle and victory-gpu pass, including the commits' own tests for the exit code mapping and the launcher's decision, and clippy -D warnings reports nothing new. I didn't run the game, so the in-game flow itself is untested by me.

AI-assisted: yes

🤖 Generated with Claude Code

**@⁠Kal0s-design** on GitHub · 2026-12-05 19:31 UTC · [original](https://github.com/VGLALALA/ReVictory-RDNA3/pull/57) `Kal0s-design:port/menu-quit-restart` → `main` · +124 −10 · 10 files · 2 commits · merged 2026-12-05 19:58 UTC Two upstream ReVIctory commits by SovietBearz0r, authors kept, that add "Quit game" and "Restart game" to the F1 drawer and make both go through the game's own shutdown. 767d145 adds the two entries. Restart also asks for a new run, and the exit path then leaves victory_core::restart::AGAIN (75) instead of the game's code. The launcher's play job loops on exactly that code, so a run restarted from the menu comes back on its own, while one started from a shell just ends with 75. The flag and the code live in victory-core so the menu and the game's exit share one definition. 913da76 then fixes how they close the game. They post WM_SYSCOMMAND with SC_CLOSE to our window, which lifecycle turns into the game's shutdown, so its saves run and the pipeline cache is written and the next run starts warm. Before, they posted WM_CLOSE to every window found, which lifecycle didn't see. Each run of a restart also gets its own play log and rereads the settings the game's menu saved during the run. The point is mostly the cache. Closing the window the hard way loses the pipelines made in that session, which is a common reason people see stutter again on the next start. Both applied cleanly in order on current main. Merged with the test fixes from #48, victory, victory-core (19), victory-hle and victory-gpu pass, including the commits' own tests for the exit code mapping and the launcher's decision, and clippy -D warnings reports nothing new. I didn't run the game, so the in-game flow itself is untested by me. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The drawer footer gets "Quit game" and "Restart game". Both post
WM_CLOSE to the title's window, so the title's own shutdown (and its
save) runs; Restart also asks for a new run, and the CRT exit path then
leaves `victory_core::restart::AGAIN` (75) instead of the title's code.
The launcher's play job loops on exactly that code, so a run restarted
from the menu comes back on its own. Started from a shell instead,
Restart ends the run with 75 and nothing restarts it.

The flag and code live in victory-core so the menu (victory-gpu) and the
title's exit (victory-hle) share one definition; the code mapping and the
launcher's decision have tests.

(cherry picked from commit 767d1459b0ab10f6912da5d76a3b6ad3d60a4128)
- panel: Quit and Restart post WM_SYSCOMMAND with SC_CLOSE to our window
  (overlay::input::window), which lifecycle turns into the title's shutdown:
  its saves run and the pipeline cache is written, so the next run is warm.
  It no longer enumerates windows and posts WM_CLOSE, which lifecycle does
  not see.
- lifecycle: end_title ends the process with restart::exit_code(0), so a run
  restarted from the menu leaves AGAIN (75) for the launcher; Quit leaves 0.
- launcher: every run of a restart gets a fresh stamp and reloads what was
  kept, so it has its own play log and the settings the game's menu saved
  during the run are read again.
- doc typo fixed.

(cherry picked from commit 913da769f0976511310a5c4eddd1eb5a539c0144)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 19:34:10 +00:00
github manually merged commit a894d36eb1 into main 2026-12-05 20:02:41 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.