# HG changeset patch # User Adrianna PiƄska # Date 1259178640 0 # Node ID 312120a991815d6f79ca096371e5704df120c7fc # Parent 1689b43ed8be812a33bcbcb111d2c913efe31b7a right-click now toggles select and move tool diff -r 1689b43ed8be -r 312120a99181 gamelib/gameboard.py --- a/gamelib/gameboard.py Wed Nov 25 18:59:51 2009 +0000 +++ b/gamelib/gameboard.py Wed Nov 25 19:50:40 2009 +0000 @@ -180,10 +180,6 @@ if self.apply_tool_to_selected(tool): return False # Using the tool on selected chickens is immediate self.selected_tool = tool - if tool in [None, constants.TOOL_SELL_BUILDING, - constants.TOOL_REPAIR_BUILDING]: - # FIXME - this special casing is sucky - self.unselect_all() sprite_curs = None if buildings.is_building(tool): sprite_curs = sprite_cursor.SpriteCursor(tool.IMAGE, self.tv, tool.BUY_PRICE) @@ -268,10 +264,13 @@ if not self.day: return if e.button == 3: # Right button - self.set_selected_tool(None, None) - self.toolbar.clear_tool() - elif e.button == 2: # Middle button - self.unselect_all() + #self.set_selected_tool(None, None) + #self.toolbar.clear_tool() + if self.selected_tool == constants.TOOL_PLACE_ANIMALS: + self.set_selected_tool(constants.TOOL_SELECT_CHICKENS, cursors.cursors["select"]) + elif self.selected_tool == constants.TOOL_SELECT_CHICKENS: + self.set_selected_tool(constants.TOOL_PLACE_ANIMALS, cursors.cursors["chicken"]) + return elif e.button != 1: # Left button return mods = pygame.key.get_mods()