|
|
@ -990,25 +990,29 @@ namespace Fungus |
|
|
|
if (command == selectedCommand) |
|
|
|
if (command == selectedCommand) |
|
|
|
{ |
|
|
|
{ |
|
|
|
command.OnCommandRemoved(block); |
|
|
|
command.OnCommandRemoved(block); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Order of destruction is important here for undo to work |
|
|
|
|
|
|
|
Undo.DestroyObjectImmediate(command); |
|
|
|
|
|
|
|
|
|
|
|
Undo.RecordObject(flowchart.selectedBlock, "Delete"); |
|
|
|
Undo.RecordObject(flowchart.selectedBlock, "Delete"); |
|
|
|
flowchart.selectedBlock.commandList.RemoveAt(i); |
|
|
|
flowchart.selectedBlock.commandList.RemoveAt(i); |
|
|
|
Undo.DestroyObjectImmediate(command); |
|
|
|
|
|
|
|
lastSelectedIndex = i; |
|
|
|
lastSelectedIndex = i; |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Undo.RecordObject(flowchart, "Delete"); |
|
|
|
Undo.RecordObject(flowchart, "Delete"); |
|
|
|
flowchart.ClearSelectedCommands(); |
|
|
|
flowchart.ClearSelectedCommands(); |
|
|
|
|
|
|
|
|
|
|
|
if (lastSelectedIndex < flowchart.selectedBlock.commandList.Count) |
|
|
|
if (lastSelectedIndex < flowchart.selectedBlock.commandList.Count) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Command nextCommand = flowchart.selectedBlock.commandList[lastSelectedIndex]; |
|
|
|
Command nextCommand = flowchart.selectedBlock.commandList[lastSelectedIndex]; |
|
|
|
block.GetFlowchart().AddSelectedCommand(nextCommand); |
|
|
|
block.GetFlowchart().AddSelectedCommand(nextCommand); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Repaint(); |
|
|
|
Repaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|