mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-12-03 12:16:22 +00:00
26 lines
775 B
TypeScript
26 lines
775 B
TypeScript
import BattleScene, { Button } from "../battle-scene";
|
|
import { Mode } from "./ui";
|
|
import UiHandler from "./ui-handler";
|
|
|
|
export default abstract class AwaitableUiHandler extends UiHandler {
|
|
protected awaitingActionInput: boolean;
|
|
protected onActionInput: Function;
|
|
public tutorialActive: boolean = false;
|
|
|
|
constructor(scene: BattleScene, mode: Mode) {
|
|
super(scene, mode);
|
|
}
|
|
|
|
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;
|
|
}
|
|
} |