From: Eduardo Date: Mon, 2 Oct 2023 21:42:41 +0000 (+0200) Subject: check if animation playing (fix weird bug on touch screen) X-Git-Url: http://git.edufdez.es/?a=commitdiff_plain;h=10c83fa13285e7f9df6248b7ede69508061e2ea0;p=The%20Cutests%20To-Do%20List.git check if animation playing (fix weird bug on touch screen) --- 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