[Bug] remove playing tween with clear in form modal ui (#2122)

This commit is contained in:
ysh4296 2024-06-12 23:03:26 +09:00 committed by GitHub
parent 0c85823645
commit c71d794d97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -18,6 +18,7 @@ export abstract class FormModalUiHandler extends ModalUiHandler {
protected inputs: InputText[]; protected inputs: InputText[];
protected errorMessage: Phaser.GameObjects.Text; protected errorMessage: Phaser.GameObjects.Text;
protected submitAction: Function; protected submitAction: Function;
protected tween: Phaser.Tweens.Tween;
constructor(scene: BattleScene, mode?: Mode) { constructor(scene: BattleScene, mode?: Mode) {
super(scene, mode); super(scene, mode);
@ -99,7 +100,7 @@ export abstract class FormModalUiHandler extends ModalUiHandler {
this.modalContainer.y += 24; this.modalContainer.y += 24;
this.modalContainer.setAlpha(0); this.modalContainer.setAlpha(0);
this.scene.tweens.add({ this.tween = this.scene.tweens.add({
targets: this.modalContainer, targets: this.modalContainer,
duration: Utils.fixedInt(1000), duration: Utils.fixedInt(1000),
ease: "Sine.easeInOut", ease: "Sine.easeInOut",
@ -142,5 +143,9 @@ export abstract class FormModalUiHandler extends ModalUiHandler {
this.inputContainers.map(ic => ic.setVisible(false)); this.inputContainers.map(ic => ic.setVisible(false));
this.submitAction = null; this.submitAction = null;
if (this.tween) {
this.tween.remove();
}
} }
} }