[lightsoff] Wait for animation to finish before level change



commit d9d5a032355a079ed3ec6c51ba3726144b42738a
Author: Robert Roth <robert roth off gmail com>
Date:   Sun Aug 5 05:18:05 2018 +0300

    Wait for animation to finish before level change

 src/board-view.vala | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/board-view.vala b/src/board-view.vala
index 73d80e4..2cd0bf2 100644
--- a/src/board-view.vala
+++ b/src/board-view.vala
@@ -70,10 +70,15 @@ public interface BoardView: GLib.Object {
         increase_moves ();
         light_toggled ();
         if (is_completed ()) {
-            game_won ();
+            Gdk.threads_add_timeout(300, game_won_timeout);
         }
     }
 
+    private bool game_won_timeout () {
+        game_won ();
+        return GLib.Source.REMOVE;
+    }
+
     public bool is_completed ()
     {
         for (var x = 0; x < size; x++)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]