From c71d794d974da3994585e99ad6916b5e470aed11 Mon Sep 17 00:00:00 2001 From: ysh4296 Date: Wed, 12 Jun 2024 23:03:26 +0900 Subject: [PATCH] [Bug] remove playing tween with clear in form modal ui (#2122) --- src/ui/form-modal-ui-handler.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/form-modal-ui-handler.ts b/src/ui/form-modal-ui-handler.ts index 227315f0b69..e55b8514642 100644 --- a/src/ui/form-modal-ui-handler.ts +++ b/src/ui/form-modal-ui-handler.ts @@ -18,6 +18,7 @@ export abstract class FormModalUiHandler extends ModalUiHandler { protected inputs: InputText[]; protected errorMessage: Phaser.GameObjects.Text; protected submitAction: Function; + protected tween: Phaser.Tweens.Tween; constructor(scene: BattleScene, mode?: Mode) { super(scene, mode); @@ -99,7 +100,7 @@ export abstract class FormModalUiHandler extends ModalUiHandler { this.modalContainer.y += 24; this.modalContainer.setAlpha(0); - this.scene.tweens.add({ + this.tween = this.scene.tweens.add({ targets: this.modalContainer, duration: Utils.fixedInt(1000), ease: "Sine.easeInOut", @@ -142,5 +143,9 @@ export abstract class FormModalUiHandler extends ModalUiHandler { this.inputContainers.map(ic => ic.setVisible(false)); this.submitAction = null; + + if (this.tween) { + this.tween.remove(); + } } }