Mercurial > rinkhals
comparison gamelib/gameboard.py @ 482:cab751de93cc
selected button switches when you toggle select/move
author | Adrianna Pińska <adrianna.pinska@gmail.com> |
---|---|
date | Wed, 25 Nov 2009 20:44:28 +0000 |
parents | fac63919a972 |
children | 25e8c57189c3 |
comparison
equal
deleted
inserted
replaced
481:fac63919a972 | 482:cab751de93cc |
---|---|
262 | 262 |
263 def use_tool(self, e): | 263 def use_tool(self, e): |
264 if not self.day: | 264 if not self.day: |
265 return | 265 return |
266 if e.button == 3: # Right button | 266 if e.button == 3: # Right button |
267 #self.set_selected_tool(None, None) | |
268 #self.toolbar.clear_tool() | |
269 if self.selected_tool == constants.TOOL_PLACE_ANIMALS: | 267 if self.selected_tool == constants.TOOL_PLACE_ANIMALS: |
270 self.set_selected_tool(constants.TOOL_SELECT_CHICKENS, cursors.cursors["select"]) | 268 self.set_selected_tool(constants.TOOL_SELECT_CHICKENS, cursors.cursors["select"]) |
269 self.toolbar._select_tool.group.value = self.toolbar._select_tool.value | |
270 self.toolbar._move_tool.pcls = "" | |
271 self.toolbar._select_tool.pcls = "down" | |
271 elif self.selected_tool == constants.TOOL_SELECT_CHICKENS: | 272 elif self.selected_tool == constants.TOOL_SELECT_CHICKENS: |
272 self.set_selected_tool(constants.TOOL_PLACE_ANIMALS, cursors.cursors["chicken"]) | 273 self.set_selected_tool(constants.TOOL_PLACE_ANIMALS, cursors.cursors["chicken"]) |
274 self.toolbar._move_tool.group.value = self.toolbar._move_tool.value | |
275 self.toolbar._select_tool.pcls = "" | |
276 self.toolbar._move_tool.pcls = "down" | |
273 return | 277 return |
274 elif e.button != 1: # Left button | 278 elif e.button != 1: # Left button |
275 return | 279 return |
276 mods = pygame.key.get_mods() | 280 mods = pygame.key.get_mods() |
277 if self.selected_tool == constants.TOOL_SELL_CHICKEN: | 281 if self.selected_tool == constants.TOOL_SELL_CHICKEN: |