Make final ending return explicit
This commit is contained in:
@@ -11839,9 +11839,10 @@ export class CampScene extends Phaser.Scene {
|
||||
soundDirector.playSelect();
|
||||
this.showCampSaveSlotPanel();
|
||||
});
|
||||
this.addCommandButton('다음 이야기', 1160, 38, 142, () => {
|
||||
const flow = this.currentSortieFlow();
|
||||
const storyButtonLabel = this.isFinalEpilogueFlow(flow) && this.campaign?.step === flow.campaignStep ? '엔딩 보기' : '다음 이야기';
|
||||
this.addCommandButton(storyButtonLabel, 1160, 38, 142, () => {
|
||||
soundDirector.playSelect();
|
||||
const flow = this.currentSortieFlow();
|
||||
if (this.isFinalEpilogueFlow(flow)) {
|
||||
this.startVictoryStory();
|
||||
return;
|
||||
@@ -12283,7 +12284,8 @@ export class CampScene extends Phaser.Scene {
|
||||
soundDirector.playSelect();
|
||||
this.hideSortiePrep();
|
||||
}, depth + 3);
|
||||
this.addSortieButton(isBattleSortie ? '출진' : '진행', x + width - 118, y + height - 42, 112, () => {
|
||||
const primaryActionLabel = isBattleSortie ? '출진' : this.isFinalEpilogueFlow(flow) ? '엔딩' : '진행';
|
||||
this.addSortieButton(primaryActionLabel, x + width - 118, y + height - 42, 112, () => {
|
||||
soundDirector.playSelect();
|
||||
this.startVictoryStory();
|
||||
}, depth + 3);
|
||||
@@ -13760,6 +13762,12 @@ export class CampScene extends Phaser.Scene {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isFinalEpilogueFlow(flow) && this.campaign?.step === flow.campaignStep) {
|
||||
this.hideSortiePrep();
|
||||
void startLazyScene(this, 'EndingScene');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!flow.nextBattleId || !flow.campaignStep || flow.pages.length === 0) {
|
||||
this.hideSortiePrep();
|
||||
if (!flow.nextBattleId && flow.campaignStep && flow.pages.length > 0) {
|
||||
|
||||
@@ -16,10 +16,8 @@ export class EndingScene extends Phaser.Scene {
|
||||
create() {
|
||||
this.ready = false;
|
||||
this.createFallbackTexture();
|
||||
this.ensureBackgroundLoaded(() => {
|
||||
this.ready = true;
|
||||
this.drawEnding();
|
||||
});
|
||||
this.renderEnding();
|
||||
this.ensureBackgroundLoaded(() => this.renderEnding());
|
||||
}
|
||||
|
||||
getDebugState() {
|
||||
@@ -49,14 +47,30 @@ export class EndingScene extends Phaser.Scene {
|
||||
return;
|
||||
}
|
||||
|
||||
this.load.once('complete', onReady);
|
||||
let finished = false;
|
||||
const finish = () => {
|
||||
if (finished) {
|
||||
return;
|
||||
}
|
||||
finished = true;
|
||||
onReady();
|
||||
};
|
||||
this.load.once('complete', finish);
|
||||
this.load.once('loaderror', () => {
|
||||
console.warn(`Failed to load ending background ${this.backgroundKey}`);
|
||||
finish();
|
||||
});
|
||||
this.load.image(this.backgroundKey, url);
|
||||
this.load.start();
|
||||
}
|
||||
|
||||
private renderEnding() {
|
||||
this.tweens.killAll();
|
||||
this.children.removeAll(true);
|
||||
this.drawEnding();
|
||||
this.ready = true;
|
||||
}
|
||||
|
||||
private createFallbackTexture() {
|
||||
if (this.textures.exists('ending-fallback')) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user