Mercurial > rinkhals
comparison gamelib/gameboard.py @ 571:2921169e545b
Don't rely on connect listener call order (PGU stores listeners in a dict).
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 20:21:27 +0000 |
parents | be47830a56b1 |
children | ffdaac5d6cf8 |
comparison
equal
deleted
inserted
replaced
570:be47830a56b1 | 571:2921169e545b |
---|---|
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 _do_quit(self): | 866 def _do_quit(self): |
867 | 867 |
868 def check_saved(_widget): | 868 def saved(val): |
869 if _widget.value: | 869 if val: |
870 # OK to quit, rely on pgu ordering that this happens in | |
871 # the right order | |
872 pygame.event.post(constants.GO_GAME_OVER) | 870 pygame.event.post(constants.GO_GAME_OVER) |
873 | 871 |
874 def sure(val): | 872 def sure(val): |
875 if val == 2: | 873 if val == 2: |
876 savedialog = savegame.SaveDialog(self) | 874 savedialog = savegame.SaveDialog(self, saved) |
877 savedialog.connect(gui.CHANGE, check_saved) | |
878 savedialog.open() | 875 savedialog.open() |
879 elif val: | 876 elif val: |
880 pygame.event.post(constants.GO_GAME_OVER) | 877 pygame.event.post(constants.GO_GAME_OVER) |
881 | 878 |
882 dialog = misc.CheckDialog(sure, | 879 dialog = misc.CheckDialog(sure, |