2024-05-05 16:30:00 +02:00
|
|
|
import BattleScene from "../battle-scene";
|
2023-03-28 14:54:52 -04:00
|
|
|
import { Mode } from "./ui";
|
2023-12-20 19:19:23 -05:00
|
|
|
import UiHandler from "./ui-handler";
|
2024-06-13 18:44:23 -04:00
|
|
|
import {Button} from "#enums/buttons";
|
2023-03-28 14:54:52 -04:00
|
|
|
|
|
|
|
export default abstract class AwaitableUiHandler extends UiHandler {
|
|
|
|
protected awaitingActionInput: boolean;
|
2024-08-07 09:23:12 -07:00
|
|
|
protected onActionInput: Function | null;
|
2024-02-14 10:44:55 -05:00
|
|
|
public tutorialActive: boolean = false;
|
2023-03-28 14:54:52 -04:00
|
|
|
|
2024-08-07 11:31:57 -07:00
|
|
|
constructor(scene: BattleScene, mode: Mode | null = null) {
|
2023-03-28 14:54:52 -04:00
|
|
|
super(scene, mode);
|
|
|
|
}
|
2024-02-14 10:44:55 -05: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;
|
|
|
|
}
|
2024-05-24 01:45:04 +02:00
|
|
|
|
2024-02-14 10:44:55 -05:00
|
|
|
return false;
|
|
|
|
}
|
2024-05-23 17:03:10 +02:00
|
|
|
}
|