Mercurial > skaapsteker
diff skaapsteker/widgets/bubble.py @ 309:342e30c92a85
Check whether the new state has text after a state change. If not, close the dialogue.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 09 Apr 2011 00:20:11 +0200 |
parents | 04be4219742b |
children | af021507a7e3 |
line wrap: on
line diff
--- a/skaapsteker/widgets/bubble.py Sat Apr 09 00:05:35 2011 +0200 +++ b/skaapsteker/widgets/bubble.py Sat Apr 09 00:20:11 2011 +0200 @@ -38,12 +38,15 @@ def _selected(self, i, data): if data == "L": CloseDialog.post(self.npc) - elif data == "N": - self.dsm.auto_next() - self._state_update() else: - self.dsm.choice(i) - self._state_update() + if data == "N": + self.dsm.auto_next() + else: + self.dsm.choice(i) + if self.dsm.has_text(): + self._state_update() + else: + CloseDialog.post(self.npc) def draw(self, level_surface): if self._text: