Browse Source

FlowchartWindow stale repaints

- during undo and redo operations
- when command data is stale due to modification by user
master
desktop-maesty/steve 6 years ago
parent
commit
efd39d2fa3
  1. 6
      Assets/Fungus/Scripts/Editor/CommandEditor.cs
  2. 17
      Assets/Fungus/Scripts/Editor/FlowchartWindow.cs

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

@ -13,6 +13,7 @@ namespace Fungus.EditorUtils
{
#region statics
public static Command selectedCommand;
public static bool SelectedCommandDataStale { get; set; }
public static CommandInfoAttribute GetCommandInfo(System.Type commandType)
{
@ -109,7 +110,12 @@ namespace Fungus.EditorUtils
EditorGUILayout.Separator();
EditorGUI.BeginChangeCheck();
DrawCommandGUI();
if(EditorGUI.EndChangeCheck())
{
SelectedCommandDataStale = true;
}
EditorGUILayout.Separator();

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

@ -262,15 +262,22 @@ namespace Fungus.EditorUtils
EditorApplication.update += OnEditorUpdate;
Undo.undoRedoPerformed += ForceRepaint;
}
protected virtual void OnDisable()
{
EditorApplication.update -= OnEditorUpdate;
Undo.undoRedoPerformed -= ForceRepaint;
}
void OnEditorUpdate()
protected void ForceRepaint()
{
Repaint();
}
protected void OnEditorUpdate()
{
HandleFlowchartSelectionChange();
@ -288,6 +295,12 @@ namespace Fungus.EditorUtils
flowchart.SelectedCommandsStale = false;
Repaint();
}
if(CommandEditor.SelectedCommandDataStale)
{
CommandEditor.SelectedCommandDataStale = false;
Repaint();
}
}
else
{
@ -1199,7 +1212,7 @@ namespace Fungus.EditorUtils
//cache these once as they can end up being called thousands of times per frame otherwise
var curRealTime = Time.realtimeSinceStartup;
var fadeTimer = curRealTime + FungusConstants.ExecutingIconFadeTime;
for (int i = 0; i < blocks.Length; ++i)
{
var b = blocks[i];

Loading…
Cancel
Save