check if animation playing (fix weird bug on touch screen)
authorEduardo <[email protected]>
Mon, 2 Oct 2023 21:42:41 +0000 (23:42 +0200)
committerEduardo <[email protected]>
Mon, 2 Oct 2023 21:42:41 +0000 (23:42 +0200)
themes/default/buttons/menu_button/MenuButton.gd

index caceddd9bf04a5eab6db9559e534f4dda9cf0659..c957b4a233a6caa0430ac76f44edaaf28a6bebd3 100644 (file)
@@ -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