# HG changeset patch # User Simon Cross # Date 1302301211 -7200 # Node ID 342e30c92a8506881a9251063c09ce3356e9442e # Parent a68b05d715bcfb0e629671d32a8f08232f7fd4ee Check whether the new state has text after a state change. If not, close the dialogue. diff -r a68b05d715bc -r 342e30c92a85 skaapsteker/widgets/bubble.py --- 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: