chiark / gitweb /
atoms.lisp: Call `player-turn-begin' from the main loop.
[atoms] / atoms.lisp
index 1ee1e05..915c53e 100644 (file)
@@ -312,7 +312,7 @@ (defmethod game-next-player (game)
        (when (member (player-state player) '(:starting :playing))
          (setf (game-player-index game) j
                (player-state player) :ready)
-         (player-turn-begin game player)
+         (glib:idle-add (lambda () (player-turn-begin game player) nil))
          (changed game :start-turn :player player)
          (return))))))
 
@@ -386,7 +386,8 @@ (defmethod restart-game ((game atom-game) &key grid players)
       (setf (player-score player) 0
            (player-state player) (if (zerop i) :ready :starting))))
   (setf (game-player-index game) 0)
-  (changed game :refresh))
+  (changed game :refresh)
+  (glib:idle-add (lambda () (player-turn-begin game (aref players 0)) nil)))
 
 ;;;--------------------------------------------------------------------------
 ;;; Snapshots and undo.
@@ -940,10 +941,9 @@ (defmethod initialize-instance :after ((window new-game-dialogue) &key)
          (gtk:signal-connect renderer :edited
                              (lambda (path new-text)
                                (setf (gtk:tree-model-value
-                                      players
-                                      path
-                                      'name)
+                                      players path 'name)
                                      new-text))))
+
        (gtk:signal-connect view :row-activated
                            (lambda (path column)
                              (when (eql (position column