From 20f42ebb5bd96637dea7687b8c57a5be36fcfba7 Mon Sep 17 00:00:00 2001 From: "heyliux@163.com" Date: Sat, 24 Mar 2018 21:38:48 +0800 Subject: [PATCH] when use Layout.Inst().PushDialogue(ProgressDialogue()), lots of progress dialogue add up together. so we can't back to menu because just back to the last oneprogress dialogue, and this lead to a bad loop. --- XSConsoleLayout.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/XSConsoleLayout.py b/XSConsoleLayout.py index 28a2d2c..9d9b7ee 100644 --- a/XSConsoleLayout.py +++ b/XSConsoleLayout.py @@ -83,6 +83,11 @@ def Window(self, inNum): def TopDialogue(self): return self.dialogues[-1] + def PushDialogueEnhance(self, inDialogue): + while len(self.dialogues) > 1: + self.PopDialogue() + self.dialogues.append(inDialogue) + def PushDialogue(self, inDialogue): self.dialogues.append(inDialogue)