# HG changeset patch # User Neil Muller # Date 1259332833 0 # Node ID 103b0fc3672256bd6a988d7213de76cefbadfa1f # Parent 6f41a565e91041187c52b57d0adf9990d546c053 Apply action to all selected chickens in building dialog diff -r 6f41a565e910 -r 103b0fc36722 gamelib/gameboard.py --- a/gamelib/gameboard.py Fri Nov 27 14:31:44 2009 +0000 +++ b/gamelib/gameboard.py Fri Nov 27 14:40:33 2009 +0000 @@ -438,7 +438,7 @@ if tile_pos: building = self.get_building(tile_pos) if building and building.HENHOUSE: - self.open_building_dialog(building, False, do_sell) + self.open_building_dialog(building, False, do_sell) else: for chicken in self.selected_chickens: do_sell(chicken) @@ -615,8 +615,15 @@ # select new animal (on button) update_button(place.occupant) else: - # Attempt to sell the occupant - sell_callback(place.occupant, update_button) + # FIXME: This should really match the behaviour for + # outside buildings, but that requires using the toolbar + # while the dialog is open. + to_process = [place.occupant] + if place.occupant in self.selected_chickens: + # We do the same action for all the selected chickens + to_process = self.selected_chickens + for chick in to_process[:]: + sell_callback(chick, update_button) else: # there is no occupant, attempt to fill the space if self.selected_chickens and fill_empty: