Mercurial > rinkhals
comparison gamelib/gameboard.py @ 570:be47830a56b1
Remove defunct open_equipment_dialog.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 20:00:42 +0000 |
parents | 3ec614e6fd4a |
children | 2921169e545b |
comparison
equal
deleted
inserted
replaced
569:3ec614e6fd4a | 570:be47830a56b1 |
---|---|
861 self.open_building_dialog(building, False, do_sell) | 861 self.open_building_dialog(building, False, do_sell) |
862 else: | 862 else: |
863 for chicken in self.selected_chickens[:]: | 863 for chicken in self.selected_chickens[:]: |
864 do_sell(chicken) | 864 do_sell(chicken) |
865 | 865 |
866 def open_equipment_dialog(self, chicken, x, y, update_button=None): | |
867 tbl = gui.Table() | |
868 | |
869 def sell_item(item, button): | |
870 """Select item of equipment.""" | |
871 self.add_cash(item.sell_price()) | |
872 chicken.unequip(item) | |
873 if update_button: | |
874 update_button(chicken) | |
875 self.disp.close(dialog) | |
876 | |
877 kwargs = { 'style': { 'padding_left': 10, 'padding_bottom': 10 }} | |
878 | |
879 tbl.tr() | |
880 tbl.td(gui.Button("Sell ... "), align=-1, **kwargs) | |
881 | |
882 for item in chicken.equipment: | |
883 tbl.tr() | |
884 button = gui.Button(item.name().title()) | |
885 button.connect(gui.CLICK, sell_item, item, button) | |
886 tbl.td(button, align=1, **kwargs) | |
887 | |
888 dialog = self.open_dialog(tbl, x=x, y=y) | |
889 | |
890 def _do_quit(self): | 866 def _do_quit(self): |
891 | 867 |
892 def check_saved(_widget): | 868 def check_saved(_widget): |
893 if _widget.value: | 869 if _widget.value: |
894 # OK to quit, rely on pgu ordering that this happens in | 870 # OK to quit, rely on pgu ordering that this happens in |