Wire main menu Options/Quit through the cutscene, fix locale crashes
Options and Quit now route through main_menu.jsonc markers the same way New Game does, with a new QUIT_GAME cutscene item type ending the process directly once quit is confirmed via MODAL_OPTIONS_MARKERS (whose "message" field is now optional, defaulting to "" like "title"). Fixes two crashes surfaced along the way: - uiModalLocalize asserted on an empty locale key instead of treating it as "nothing to show" - hit as soon as a modal omitted a title or message. - assetLocaleGetString's new empty-message-ID guard broke the PO format's own header-read convention (messageId "") used internally by assetLocaleLoaderAsync, crashing on every boot. Extracted the shared lookup into assetLocaleGetStringLookup and added a dedicated assetLocaleGetHeader for that internal read, leaving assetLocaleGetString's validation untouched for every real caller. Also replaced every raw assetLocaleGetString/WithVA call across the UI with the locale/localemanager.h helpers (adding localeManagerGetString for the plain, non-formatting case), so app code no longer bypasses them. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"type": "MARKER",
|
||||
"name": "MAIN_MENU_IDLE"
|
||||
},
|
||||
{
|
||||
"type": "UI_SHOW",
|
||||
"name": "main_menu"
|
||||
},
|
||||
|
||||
// Options button goes here - no options screen yet, so this is just
|
||||
// an alias landing right back on the idle loop below.
|
||||
{
|
||||
"type": "MARKER",
|
||||
"name": "OPTIONS"
|
||||
},
|
||||
{
|
||||
"type": "IDLE"
|
||||
},
|
||||
@@ -88,6 +99,35 @@
|
||||
{
|
||||
"type": "MARKER",
|
||||
"name": "LOADED"
|
||||
},
|
||||
|
||||
// Quit Game button goes here. Cancelling jumps back to
|
||||
// MAIN_MENU_IDLE; confirming falls through to QUIT_GAME, which
|
||||
// ends the process directly.
|
||||
{
|
||||
"type": "MARKER",
|
||||
"name": "QUIT"
|
||||
},
|
||||
{
|
||||
"type": "MODAL_OPTIONS_MARKERS",
|
||||
"title": "main_menu.quit_confirm",
|
||||
"options": [
|
||||
{
|
||||
"text": "ui.confirm.confirm",
|
||||
"marker": "QUIT_CONFIRMED"
|
||||
},
|
||||
{
|
||||
"text": "ui.confirm.cancel",
|
||||
"marker": "MAIN_MENU_IDLE"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "MARKER",
|
||||
"name": "QUIT_CONFIRMED"
|
||||
},
|
||||
{
|
||||
"type": "QUIT_GAME"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user