comparison gamelib/gameboard.py @ 553:7963fc09fac2

Make checkdialog take strings to show as input. Add possiblity of 3rd button on dialog
author Neil Muller <drnlmuller@gmail.com>
date Sat, 28 Nov 2009 17:45:28 +0000
parents 11c4cebfe4c5
children 46f6f1a98f3f
comparison
equal deleted inserted replaced
552:11c4cebfe4c5 553:7963fc09fac2
830 if e.type == KEYDOWN and e.key == K_ESCAPE: 830 if e.type == KEYDOWN and e.key == K_ESCAPE:
831 def sure(val): 831 def sure(val):
832 if val: 832 if val:
833 import engine 833 import engine
834 pygame.event.post(engine.GO_GAME_OVER) 834 pygame.event.post(engine.GO_GAME_OVER)
835 dialog = misc.CheckDialog(sure) 835 dialog = misc.CheckDialog(sure,
836 "Do you REALLY want to exit this game?",
837 "Yes, Quit", "No, Don't Quit", None)
836 self.disp.open(dialog) 838 self.disp.open(dialog)
837 return True 839 return True
838 elif e.type == KEYDOWN and e.key == K_n and self.day: 840 elif e.type == KEYDOWN and e.key == K_n and self.day:
839 import engine 841 import engine
840 pygame.event.post(engine.START_NIGHT) 842 pygame.event.post(engine.START_NIGHT)