[Bug] remove playing tween with clear in form modal ui (#2122)
This commit is contained in:
parent
0c85823645
commit
c71d794d97
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue