|
|
@ -27,6 +27,8 @@ namespace Fungus |
|
|
|
public int index; |
|
|
|
public int index; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected static List<Action> actionList = new List<Action>(); |
|
|
|
|
|
|
|
|
|
|
|
public virtual void DrawBlockName(Flowchart flowchart) |
|
|
|
public virtual void DrawBlockName(Flowchart flowchart) |
|
|
|
{ |
|
|
|
{ |
|
|
|
serializedObject.Update(); |
|
|
|
serializedObject.Update(); |
|
|
@ -52,6 +54,22 @@ namespace Fungus |
|
|
|
{ |
|
|
|
{ |
|
|
|
serializedObject.Update(); |
|
|
|
serializedObject.Update(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Execute any queued cut, copy, paste, etc. operations from the prevous GUI update |
|
|
|
|
|
|
|
// We need to defer applying these operations until the following update because |
|
|
|
|
|
|
|
// the ReorderableList control emits GUI errors if you clear the list in the same frame |
|
|
|
|
|
|
|
// as drawing the control (e.g. select all and then delete) |
|
|
|
|
|
|
|
if (Event.current.type == EventType.Layout) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
foreach (Action action in actionList) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (action != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
action(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
actionList.Clear(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Block block = target as Block; |
|
|
|
Block block = target as Block; |
|
|
|
|
|
|
|
|
|
|
|
SerializedProperty commandListProperty = serializedObject.FindProperty("commandList"); |
|
|
|
SerializedProperty commandListProperty = serializedObject.FindProperty("commandList"); |
|
|
@ -113,7 +131,7 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "Copy") |
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "Copy") |
|
|
|
{ |
|
|
|
{ |
|
|
|
Copy(); |
|
|
|
actionList.Add(Copy); |
|
|
|
e.Use(); |
|
|
|
e.Use(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -128,7 +146,7 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "Cut") |
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "Cut") |
|
|
|
{ |
|
|
|
{ |
|
|
|
Cut(); |
|
|
|
actionList.Add(Cut); |
|
|
|
e.Use(); |
|
|
|
e.Use(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -144,7 +162,7 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "Paste") |
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "Paste") |
|
|
|
{ |
|
|
|
{ |
|
|
|
Paste(); |
|
|
|
actionList.Add(Paste); |
|
|
|
e.Use(); |
|
|
|
e.Use(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -159,8 +177,8 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "Duplicate") |
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "Duplicate") |
|
|
|
{ |
|
|
|
{ |
|
|
|
Copy(); |
|
|
|
actionList.Add(Copy); |
|
|
|
Paste(); |
|
|
|
actionList.Add(Paste); |
|
|
|
e.Use(); |
|
|
|
e.Use(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -175,7 +193,7 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "Delete") |
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "Delete") |
|
|
|
{ |
|
|
|
{ |
|
|
|
Delete(); |
|
|
|
actionList.Add(Delete); |
|
|
|
e.Use(); |
|
|
|
e.Use(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -187,7 +205,7 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "SelectAll") |
|
|
|
if (e.type == EventType.ExecuteCommand && e.commandName == "SelectAll") |
|
|
|
{ |
|
|
|
{ |
|
|
|
SelectAll(); |
|
|
|
actionList.Add(SelectAll); |
|
|
|
e.Use(); |
|
|
|
e.Use(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|