new undo system

Also enables undoing when working with node input arrays
This commit is contained in:
itsmattkc
2021-01-29 16:10:34 +11:00
parent 4e5db91c17
commit ad4b83a098
69 changed files with 1218 additions and 837 deletions
+2 -2
View File
@@ -26,14 +26,14 @@
namespace olive {
void XMLConnectNodes(const XMLNodeData &xml_node_data, QUndoCommand *command)
void XMLConnectNodes(const XMLNodeData &xml_node_data, MultiUndoCommand *command)
{
foreach (const XMLNodeData::SerializedConnection& con, xml_node_data.desired_connections) {
Node* out = xml_node_data.node_ptrs.value(con.output);
if (out) {
if (command) {
new NodeEdgeAddCommand(out, con.input, con.element, command);
command->add_child(new NodeEdgeAddCommand(out, con.input, con.element));
} else {
Node::ConnectEdge(out, con.input, con.element);
}