Browse Source

FlowchartWindow tracks selected command changes and force repaints

master
desktop-maesty/steve 6 years ago
parent
commit
fd936ee06e
  1. 10
      Assets/Fungus/Scripts/Components/Flowchart.cs
  2. 6
      Assets/Fungus/Scripts/Editor/FlowchartWindow.cs

10
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
}
/// <summary>
@ -1113,6 +1120,9 @@ namespace Fungus
if (!selectedCommands.Contains(command))
{
selectedCommands.Add(command);
#if UNITY_EDITOR
SelectedCommandsStale = true;
#endif
}
}

6
Assets/Fungus/Scripts/Editor/FlowchartWindow.cs

@ -282,6 +282,12 @@ namespace Fungus.EditorUtils
prevVarCount = varcount;
Repaint();
}
if(flowchart.SelectedCommandsStale)
{
flowchart.SelectedCommandsStale = false;
Repaint();
}
}
else
{

Loading…
Cancel
Save