Mercurial > rinkhals
changeset 547:1456bf2ff02e
Allow cancelling of save game dialog with ESC.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 11:12:45 +0000 |
parents | e57a0cf38cc7 |
children | 27c09c58d89d |
files | gamelib/savegame.py |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/savegame.py Sat Nov 28 11:09:01 2009 +0000 +++ b/gamelib/savegame.py Sat Nov 28 11:12:45 2009 +0000 @@ -9,6 +9,7 @@ from pgu import gui import pygame +from pygame.locals import KEYDOWN, K_ESCAPE import config import version @@ -207,6 +208,11 @@ self.send(gui.CHANGE) self.close() + def event(self, e): + if e.type == KEYDOWN and e.key == K_ESCAPE: + self._click_cancel() + return True + return gui.Dialog.event(self, e) class SaveDialog(BaseSaveRestoreDialog): """Save game dialog."""