From 10c83fa13285e7f9df6248b7ede69508061e2ea0 Mon Sep 17 00:00:00 2001 From: Eduardo Date: Mon, 2 Oct 2023 23:42:41 +0200 Subject: [PATCH] check if animation playing (fix weird bug on touch screen) --- themes/default/buttons/menu_button/MenuButton.gd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/default/buttons/menu_button/MenuButton.gd b/themes/default/buttons/menu_button/MenuButton.gd index caceddd..c957b4a 100644 --- a/themes/default/buttons/menu_button/MenuButton.gd +++ b/themes/default/buttons/menu_button/MenuButton.gd @@ -28,9 +28,11 @@ func toggle_menu(): menu_opened = !menu_opened if menu_opened: - animation_player.play("transform to close") + if !animation_player.is_playing(): + animation_player.play("transform to close") else: - animation_player.play_backwards("transform to close") + if !animation_player.is_playing(): + animation_player.play_backwards("transform to close") for b in buttons: b.visible = menu_opened -- 2.30.2