Add quit confirmation to main menu
Implement a quit confirmation dialog that appears when the QUIT button is selected on the main menu. The dialog displays 'EXIT GAME?' with YES/NO options. YES sends a coAction quit request to the plugin, which hides the overlay, disconnects any active server session, and sets RE::Main::quitGame to exit the game. NO returns to the main menu. Includes full keyboard (arrow keys, Enter, Escape), gamepad (dpad, A/B buttons), and mouse support. Default selection is NO.
This commit is contained in:
@@ -9,6 +9,62 @@ failed experiments, successful tests, and next steps.
|
||||
|
||||
---
|
||||
|
||||
## 2026-07-07 - Main Menu Quit Confirmation
|
||||
|
||||
### Summary
|
||||
Selecting QUIT on the custom main menu opens an `EXIT GAME?` confirmation dialog. YES quits to desktop; NO returns to the menu.
|
||||
|
||||
### Files Changed
|
||||
- `ui/views/CommonwealthOnline/main-menu/index.html`
|
||||
- `ui/views/CommonwealthOnline/main-menu/styles.css`
|
||||
- `ui/views/CommonwealthOnline/main-menu/script.js`
|
||||
- `changelog.md`
|
||||
- `docs/dev-log.md`
|
||||
|
||||
### Details
|
||||
- Added centered quit-confirm modal with YES/NO options and shared menu selection styling.
|
||||
- New `quitConfirm` view mode with keyboard, gamepad, and mouse support; B/Escape cancels like vanilla.
|
||||
- YES sends the `coAction` quit request to the plugin; NO cancels. Default selection is NO.
|
||||
|
||||
### Testing
|
||||
- Not run locally (requires Fallout 4 + built plugin).
|
||||
- Expected: QUIT → `EXIT GAME?` appears; NO/B returns to menu; YES exits game.
|
||||
|
||||
### Known Issues
|
||||
- None currently known.
|
||||
|
||||
### Next Steps
|
||||
- None currently known.
|
||||
|
||||
---
|
||||
|
||||
## 2026-07-07 - Main Menu Quit Button
|
||||
|
||||
### Summary
|
||||
The custom main menu QUIT item now sends a `coAction` to the plugin, which hides the overlay, disconnects any active server session, and sets `RE::Main::quitGame` on the game thread so Fallout 4 exits to desktop.
|
||||
|
||||
### Files Changed
|
||||
- `ui/views/CommonwealthOnline/main-menu/script.js`
|
||||
- `plugin/src/F4TPrismaUI.cpp`
|
||||
- `changelog.md`
|
||||
- `docs/dev-log.md`
|
||||
|
||||
### Details
|
||||
- JS `activateSelected()` routes `quit` through `sendCoAction({ action: "quit" })` instead of only logging via `onOpenView`.
|
||||
- C++ `RequestQuitFromMainMenu()` hides the PrismaUI overlay, calls `DisconnectFromLocalServer()`, and queues `main->quitGame = true` via `F4SE::GetTaskInterface()->AddTask`.
|
||||
|
||||
### Testing
|
||||
- Not run locally (requires Fallout 4 + built plugin).
|
||||
- Expected: select QUIT on title screen → game closes to desktop; no stuck overlay; server disconnects if connected.
|
||||
|
||||
### Known Issues
|
||||
- None currently known.
|
||||
|
||||
### Next Steps
|
||||
- None currently known (quit confirmation added in follow-up entry).
|
||||
|
||||
---
|
||||
|
||||
## 2026-07-07 - Fix: Hide Main Menu Overlay During Server Join Load
|
||||
|
||||
### Summary
|
||||
|
||||
Reference in New Issue
Block a user