Add name to buttons to simplify logic
[tabakrolletjie.git] / tabakrolletjie / scenes / day.py
index 184c301c8de9eec6cf5e2631ce221dfe40188c13..7702fc78c07da51057845a487cbbaeffc8a4d4ab 100644 (file)
@@ -22,7 +22,8 @@ class DayScene(BaseScene):
         self._lights = LightManager(self._space, gamestate)
         # Toolbar
         self._tools = [
-            ImageButton('32', 'seed.png', pos=(50, SCREEN_SIZE[1] - 40)),
+            ImageButton('32', 'seed.png', name='seed',
+                        pos=(50, SCREEN_SIZE[1] - 40)),
         ]
 
     @debug_timer("day.render")
@@ -44,7 +45,7 @@ class DayScene(BaseScene):
                 # Check tools
                 for tool in self._tools:
                     if tool.pressed(ev):
-                        print 'tool'
+                        print 'tool', tool.name
                         return
                 # Not tool, so check lights
                 self._lights.toggle_nearest(ev.pos, surfpos=True)