Fix being able to overwrite data without a confirmation

pull/137/head^2
Flashfyre 2024-04-15 10:35:57 -04:00
parent 6e59b4dd77
commit 398f2c5be0
1 changed files with 4 additions and 2 deletions

View File

@ -114,8 +114,10 @@ export default class SaveSlotSelectUiHandler extends MessageUiHandler {
ui.showText(null, 0); ui.showText(null, 0);
}, false, 0, 19, 2000); }, false, 0, 19, 2000);
}); });
} else } else if (this.sessionSlots[this.cursor].hasData === false)
saveAndCallback(); saveAndCallback();
else
return false;
break; break;
} }
success = true; success = true;
@ -210,7 +212,6 @@ class SessionSlot extends Phaser.GameObjects.Container {
super(scene, 0, slotId * 56); super(scene, 0, slotId * 56);
this.slotId = slotId; this.slotId = slotId;
this.hasData = false;
this.setup(); this.setup();
} }
@ -282,6 +283,7 @@ class SessionSlot extends Phaser.GameObjects.Container {
return new Promise<boolean>(resolve => { return new Promise<boolean>(resolve => {
this.scene.gameData.getSession(this.slotId).then(async sessionData => { this.scene.gameData.getSession(this.slotId).then(async sessionData => {
if (!sessionData) { if (!sessionData) {
this.hasData = false;
this.loadingLabel.setText('Empty'); this.loadingLabel.setText('Empty');
resolve(false); resolve(false);
return; return;