prevent opening the menu on confirm dialog + fix config error message on crash (#1278)

This commit is contained in:
Greenlamp2 2024-05-23 20:26:12 +02:00 committed by GitHub
parent 79af115278
commit c86a51ba89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -123,10 +123,10 @@ export class UiInputs {
case Mode.PARTY:
case Mode.SUMMARY:
case Mode.STARTER_SELECT:
case Mode.CONFIRM:
case Mode.OPTION_SELECT:
this.scene.ui.setOverlayMode(Mode.MENU);
break;
case Mode.CONFIRM:
case Mode.MENU:
case Mode.SETTINGS:
case Mode.ACHIEVEMENTS:

View File

@ -171,8 +171,8 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler {
return false;
}
}
const option = this.config.options[this.cursor + (this.scrollCursor - (this.scrollCursor ? 1 : 0))];
if (option.handler()) {
const option = this.config?.options[this.cursor + (this.scrollCursor - (this.scrollCursor ? 1 : 0))];
if (option?.handler()) {
if (!option.keepOpen) {
this.clear();
}