node: make convenient input flag setter

This commit is contained in:
itsmattkc
2023-02-20 19:13:50 -08:00
parent 7348d28243
commit f9cd28a694
10 changed files with 63 additions and 38 deletions
+6 -2
View File
@@ -903,12 +903,16 @@ InputFlags Node::GetInputFlags(const QString &input) const
}
}
void Node::SetInputFlags(const QString &input, const InputFlags &f)
void Node::SetInputFlag(const QString &input, InputFlag f, bool on)
{
Input* i = GetInternalInputData(input);
if (i) {
i->flags = f;
if (on) {
i->flags |= f;
} else {
i->flags &= ~f;
}
emit InputFlagsChanged(input, i->flags);
} else {
ReportInvalidInput("set flags of", input, -1);