1
0
Fork 0

Checklist: <and> multiple entries in <condition>

Previously a <condition> block was assumed to contain
a single child, and other children were ignored, largely due to the PUI code.

Most developers would expect multiple children to be evaluated
as if surrounded by an <and> block, which is how the tutorial code
behaves.

This change wraps the children in an <and> making it consistent.
This commit is contained in:
Stuart Buchanan 2020-11-29 19:39:20 +00:00
parent 78f72a5ec3
commit 2fdb17a214

View file

@ -210,7 +210,7 @@
var condition = item.getNode("condition");
if (condition != nil) {
var vis = t.getNode("visible", 1);
var vis = t.getNode("visible", 1).getNode("and", 1);
props.copy(condition, vis);
var c = t.getNode("color", 1);
c.getNode("red", 1).setValue(0.2);
@ -242,7 +242,7 @@
c.getNode("green", 1).setValue(0.7);
c.getNode("blue", 1).setValue(0.2);
vis = t.getNode("visible", 1).getNode("not", 1);
vis = t.getNode("visible", 1).getNode("not", 1).getNode("and", 1);
props.copy(condition, vis);
}