]> gitweb.factorcode.org Git - factor.git/commitdiff
minesweeper: fix bug when running before ever clicking on anything.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 16 Feb 2018 23:09:00 +0000 (15:09 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 16 Feb 2018 23:09:00 +0000 (15:09 -0800)
extra/minesweeper/minesweeper.factor

index a105991f8b20e6ecb8affbf5c07b32af6ba00a3f..e66ccaf80a474bc4b310fe6cfa2ba07b53d2294c 100644 (file)
@@ -182,8 +182,7 @@ M: grid-gadget pref-dim*
     gadget pref-dim first :> width
     width 2/ 26 - 3 2array [
         gadget cells>> [ won? ] [ lost? ] bi
-        hand-buttons get-global empty? not
-        gadget hand-click-rel second 58 >= and
+        gadget hand-click-rel [ second 58 >= ] [ f ] if*
         smiley-image-path gadget draw-cached-texture
     ] with-translation ;
 
@@ -284,7 +283,7 @@ TUPLE: minesweeper-gadget < track ;
     [ <toolbar> format-toolbar f track-add ]
     [ 1 track-add ] bi ;
 
-M: minesweeper-gadget focusable-child* children>> ?second t or ;
+M: minesweeper-gadget focusable-child* children>> second ;
 
 MAIN-WINDOW: run-minesweeper {
         { title "Minesweeper" }