Use new puzzle tiles.
authorSimon Cross <hodgestar@gmail.com>
Sat, 17 May 2014 13:47:03 +0000 (15:47 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 17 May 2014 13:57:57 +0000 (15:57 +0200)
naja/widgets/tile.py

index c9326670251d2988704aa2e35d0a7829048682f9..5417dcf3ba3e4e8960c829d76dc8e7c4353a09cf 100644 (file)
@@ -34,10 +34,19 @@ class TileWidget(Widget):
         # Draw background
         x, y = abs(self.board_pos[0] - 2), abs(self.board_pos[1] - 2)
 
+        if self.state.gameboard.puzzle:
+            tile_1_name = 'board/tile_1.png'
+            tile_2_name = 'board/tile_2_puzzle.png'
+            tile_available_name = 'board/tile_available_puzzle.png'
+        else:
+            tile_1_name = 'board/tile_1.png'
+            tile_2_name = 'board/tile_2.png'
+            tile_available_name = 'board/tile_available.png'
+
         if (x + y) % 2 == 0:
-            bg_name = 'board/tile_2.png'
+            bg_name = tile_2_name
         else:
-            bg_name = 'board/tile_1.png'
+            bg_name = tile_1_name
         bg = resources.get_image(bg_name, transforms=(EIGHT_BIT,))
         overlays = []
 
@@ -45,7 +54,7 @@ class TileWidget(Widget):
 
         if self.state.gameboard.player_mode == EXAMINE and legal_move:
             overlays.append(resources.get_image(
-                'board/tile_available.png', transforms=(EIGHT_BIT,)))
+                tile_available_name, transforms=(EIGHT_BIT,)))
         if self.highlighted:
             overlays.append(resources.get_image(
                 'board/tile_selected.png',