2024-05-03 10:04:32 -07:00
|
|
|
import BattleScene, { Button } from "../battle-scene";
|
2023-03-28 11:54:52 -07:00
|
|
|
import { Mode } from "./ui";
|
2023-12-20 16:19:23 -08:00
|
|
|
import UiHandler from "./ui-handler";
|
2023-03-28 11:54:52 -07:00
|
|
|
|
|
|
|
export default abstract class AwaitableUiHandler extends UiHandler {
|
|
|
|
protected awaitingActionInput: boolean;
|
|
|
|
protected onActionInput: Function;
|
2024-02-14 07:44:55 -08:00
|
|
|
public tutorialActive: boolean = false;
|
2023-03-28 11:54:52 -07:00
|
|
|
|
|
|
|
constructor(scene: BattleScene, mode: Mode) {
|
|
|
|
super(scene, mode);
|
|
|
|
}
|
2024-02-14 07:44:55 -08:00
|
|
|
|
|
|
|
processTutorialInput(button: Button): boolean {
|
|
|
|
if ((button === Button.ACTION || button === Button.CANCEL) && this.onActionInput) {
|
|
|
|
this.getUi().playSelect();
|
|
|
|
const originalOnActionInput = this.onActionInput;
|
|
|
|
this.onActionInput = null;
|
|
|
|
originalOnActionInput();
|
|
|
|
this.awaitingActionInput = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2023-03-28 11:54:52 -07:00
|
|
|
}
|