From d2ef29f1a44625e4d5e7b2e1388d1b283d99f9b6 Mon Sep 17 00:00:00 2001 From: Thomas Remmery Date: Mon, 15 Jul 2024 13:21:14 +0200 Subject: [PATCH] Jump out of Run loop when calling InteractiveController.Hide(). This is to make sure that the current dialog isn't being shown after it was hidden. --- InteractiveAutomationToolkit/InteractiveController.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/InteractiveAutomationToolkit/InteractiveController.cs b/InteractiveAutomationToolkit/InteractiveController.cs index 4c33a8b..b404d79 100644 --- a/InteractiveAutomationToolkit/InteractiveController.cs +++ b/InteractiveAutomationToolkit/InteractiveController.cs @@ -96,7 +96,15 @@ public void Run(Dialog startDialog) else { CurrentDialog = nextDialog; - CurrentDialog.Show(); + if (CurrentDialog == null) + { + IsRunning = false; + IsManualMode = false; + } + else + { + CurrentDialog.Show(); + } } } catch (Exception) @@ -170,6 +178,7 @@ public void Update() public void Hide() { Engine.HideUI(); + nextDialog = null; } private void RunManualAction()