Improve sortie prep selection UI
This commit is contained in:
@@ -19,6 +19,16 @@ export class TitleScene extends Phaser.Scene {
|
||||
this.settingsPanel = undefined;
|
||||
this.navigating = false;
|
||||
|
||||
if (this.shouldOpenDebugSortiePrep()) {
|
||||
this.time.delayedCall(0, () => {
|
||||
void this.navigateTo('CampScene', {
|
||||
openSortiePrep: true,
|
||||
skipIntroStory: true
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const { width, height } = this.scale;
|
||||
this.drawBackground(width, height);
|
||||
this.drawAtmosphere(width, height);
|
||||
@@ -37,6 +47,14 @@ export class TitleScene extends Phaser.Scene {
|
||||
this.input.keyboard?.once('keydown-ENTER', () => this.startGame());
|
||||
}
|
||||
|
||||
private shouldOpenDebugSortiePrep() {
|
||||
if (typeof window === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
return params.has('debugSortiePrep') && (params.has('debug') || import.meta.env.DEV);
|
||||
}
|
||||
|
||||
private drawBackground(width: number, height: number) {
|
||||
const background = this.add.image(width / 2, height / 2, 'title-taoyuan');
|
||||
const texture = this.textures.get('title-taoyuan').getSourceImage();
|
||||
|
||||
Reference in New Issue
Block a user