fix: prevent camp save click-through

This commit is contained in:
2026-07-29 11:42:11 +09:00
parent 289599149b
commit 4321ba591e
3 changed files with 152 additions and 41 deletions

View File

@@ -11842,6 +11842,7 @@ export class CampScene extends Phaser.Scene {
musicVolume: this.campSoundscape.music.volume,
ambienceVolume: this.campSoundscape.ambience.volume
});
this.input.setTopOnly(true);
this.input.keyboard?.on('keydown-ESC', (event: KeyboardEvent) => this.handleEscapeKey(event));
this.input.keyboard?.on('keydown-ENTER', (event: KeyboardEvent) => this.handleSortieEnterKey(event));
this.input.keyboard?.on('keydown', (event: KeyboardEvent) => {
@@ -13388,9 +13389,13 @@ export class CampScene extends Phaser.Scene {
_localY: number,
event?: { stopPropagation: () => void }
) => {
event?.stopPropagation();
soundDirector.playSelect();
this.hideCampSaveSlotPanel();
this.deferCampSavePointerAction(
event,
() => {
soundDirector.playSelect();
this.hideCampSaveSlotPanel();
}
);
}
);
shade.on(
@@ -13462,9 +13467,13 @@ export class CampScene extends Phaser.Scene {
_localY: number,
event?: { stopPropagation: () => void }
) => {
event?.stopPropagation();
soundDirector.playSelect();
this.hideCampSaveSlotPanel();
this.deferCampSavePointerAction(
event,
() => {
soundDirector.playSelect();
this.hideCampSaveSlotPanel();
}
);
});
this.trackCampSaveSlot(close);
}
@@ -13537,8 +13546,10 @@ export class CampScene extends Phaser.Scene {
_localY: number,
event?: { stopPropagation: () => void }
) => {
event?.stopPropagation();
this.requestSaveCampToSlot(summary.slot);
this.deferCampSavePointerAction(
event,
() => this.requestSaveCampToSlot(summary.slot)
);
};
[row, title, keycap, keyText, detail, meta, saveLabel].forEach((object) => {
object.setInteractive({ useHandCursor: true });
@@ -13614,9 +13625,13 @@ export class CampScene extends Phaser.Scene {
_localY: number,
event?: { stopPropagation: () => void }
) => {
event?.stopPropagation();
soundDirector.playSelect();
this.hideCampSaveConfirm();
this.deferCampSavePointerAction(
event,
() => {
soundDirector.playSelect();
this.hideCampSaveConfirm();
}
);
}
);
shade.on(
@@ -13690,8 +13705,10 @@ export class CampScene extends Phaser.Scene {
_localY: number,
event?: { stopPropagation: () => void }
) => {
event?.stopPropagation();
this.confirmCampSaveOverwrite();
this.deferCampSavePointerAction(
event,
() => this.confirmCampSaveOverwrite()
);
});
this.trackCampSaveConfirm(confirm);
@@ -13706,9 +13723,13 @@ export class CampScene extends Phaser.Scene {
_localY: number,
event?: { stopPropagation: () => void }
) => {
event?.stopPropagation();
soundDirector.playSelect();
this.hideCampSaveConfirm();
this.deferCampSavePointerAction(
event,
() => {
soundDirector.playSelect();
this.hideCampSaveConfirm();
}
);
});
this.trackCampSaveConfirm(cancel);
}
@@ -13805,6 +13826,20 @@ export class CampScene extends Phaser.Scene {
this.pendingSaveSlot = undefined;
}
private deferCampSavePointerAction(
event:
| { stopPropagation: () => void }
| undefined,
action: () => void
) {
event?.stopPropagation();
queueMicrotask(() => {
if (this.sys.isActive()) {
action();
}
});
}
private settleVictoryRewardArrival(report: CampaignVictoryRewardReport) {
if (report.outcome !== 'victory') {
this.pendingVictoryRewardReport = undefined;
@@ -14911,6 +14946,12 @@ export class CampScene extends Phaser.Scene {
}
private setSortiePrepStep(step: SortiePrepStep) {
if (
this.saveSlotObjects.length > 0 ||
this.saveSlotConfirmObjects.length > 0
) {
return;
}
if (step !== 'briefing') {
this.thirdCampPreparationBrowserOpen = false;
}