Patch a certain bug

pull/172/head
Flashfyre 2024-04-17 14:49:18 -04:00
parent be7a0d9ca6
commit 7155174d3c
1 changed files with 7 additions and 0 deletions

View File

@ -170,6 +170,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
private starterSelectCallback: StarterSelectCallback; private starterSelectCallback: StarterSelectCallback;
private gameMode: GameModes; private gameMode: GameModes;
protected blockInput: boolean = false;
constructor(scene: BattleScene) { constructor(scene: BattleScene) {
super(scene, Mode.STARTER_SELECT); super(scene, Mode.STARTER_SELECT);
} }
@ -614,6 +616,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
} }
processInput(button: Button): boolean { processInput(button: Button): boolean {
if (this.blockInput)
return false;
const ui = this.getUi(); const ui = this.getUi();
let success = false; let success = false;
@ -633,6 +638,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
success = true; success = true;
this.updateInstructions(); this.updateInstructions();
} else { } else {
this.blockInput = true;
this.scene.clearPhaseQueue(); this.scene.clearPhaseQueue();
this.scene.pushPhase(new TitlePhase(this.scene)); this.scene.pushPhase(new TitlePhase(this.scene));
this.scene.getCurrentPhase().end(); this.scene.getCurrentPhase().end();
@ -1631,6 +1637,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
super.clear(); super.clear();
this.cursor = -1; this.cursor = -1;
this.starterSelectContainer.setVisible(false); this.starterSelectContainer.setVisible(false);
this.blockInput = false;
while (this.starterCursors.length) while (this.starterCursors.length)
this.popStarter(); this.popStarter();