node: removed dumb undoable param

This commit is contained in:
itsmattkc
2023-02-19 11:36:46 -08:00
parent 9745b536f6
commit b8ee27e1cb
7 changed files with 71 additions and 84 deletions
@@ -444,7 +444,7 @@ void NodeParamViewItemBody::ArrayAppendClicked()
for (auto it=array_ui_.cbegin(); it!=array_ui_.cend(); it++) {
if (it.value().append_btn == sender()) {
NodeInput real_input = NodeGroup::ResolveInput(NodeInput(it.key().node, it.key().input));
real_input.node()->InputArrayAppend(real_input.input(), true);
Core::instance()->undo_stack()->push(new Node::ArrayInsertCommand(real_input.node(), real_input.input(), real_input.GetArraySize()+1));
break;
}
}
@@ -456,7 +456,7 @@ void NodeParamViewItemBody::ArrayInsertClicked()
if (it.value().array_insert_btn == sender()) {
// Found our input and element
NodeInput ic = NodeGroup::ResolveInput(it.key());
ic.node()->InputArrayInsert(ic.input(), ic.element(), true);
Core::instance()->undo_stack()->push(new Node::ArrayInsertCommand(ic.node(), ic.input(), ic.element()));
break;
}
}
@@ -468,7 +468,7 @@ void NodeParamViewItemBody::ArrayRemoveClicked()
if (it.value().array_remove_btn == sender()) {
// Found our input and element
NodeInput ic = NodeGroup::ResolveInput(it.key());
ic.node()->InputArrayRemove(ic.input(), ic.element(), true);
Core::instance()->undo_stack()->push(new Node::ArrayRemoveCommand(ic.node(), ic.input(), ic.element()));
break;
}
}
@@ -193,12 +193,12 @@ Project *NodeParamArrayAppendCommand::GetRelevantProject() const
void NodeParamArrayAppendCommand::redo()
{
node_->InputArrayAppend(input_, false);
node_->InputArrayAppend(input_);
}
void NodeParamArrayAppendCommand::undo()
{
node_->InputArrayRemoveLast(input_, false);
node_->InputArrayRemoveLast(input_);
}
void NodeSetValueHintCommand::redo()