From fd936ee06e381bcde663d62f23c1c17ad7a64dde Mon Sep 17 00:00:00 2001 From: desktop-maesty/steve Date: Sun, 6 Jan 2019 22:07:45 +1000 Subject: [PATCH] FlowchartWindow tracks selected command changes and force repaints --- Assets/Fungus/Scripts/Components/Flowchart.cs | 10 ++++++++++ Assets/Fungus/Scripts/Editor/FlowchartWindow.cs | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/Assets/Fungus/Scripts/Components/Flowchart.cs b/Assets/Fungus/Scripts/Components/Flowchart.cs index 80d42957..7a0f63ea 100644 --- a/Assets/Fungus/Scripts/Components/Flowchart.cs +++ b/Assets/Fungus/Scripts/Components/Flowchart.cs @@ -88,6 +88,10 @@ namespace Fungus protected StringSubstituter stringSubstituer; +#if UNITY_EDITOR + public bool SelectedCommandsStale { get; set; } +#endif + #if UNITY_5_4_OR_NEWER #else protected virtual void OnLevelWasLoaded(int level) @@ -1103,6 +1107,9 @@ namespace Fungus public virtual void ClearSelectedCommands() { selectedCommands.Clear(); +#if UNITY_EDITOR + SelectedCommandsStale = true; +#endif } /// @@ -1113,6 +1120,9 @@ namespace Fungus if (!selectedCommands.Contains(command)) { selectedCommands.Add(command); +#if UNITY_EDITOR + SelectedCommandsStale = true; +#endif } } diff --git a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs index 18ebde8a..dfa140e2 100644 --- a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs +++ b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs @@ -282,6 +282,12 @@ namespace Fungus.EditorUtils prevVarCount = varcount; Repaint(); } + + if(flowchart.SelectedCommandsStale) + { + flowchart.SelectedCommandsStale = false; + Repaint(); + } } else {