From 2fdb17a2143d51ec821ab78e2299af0cd68a8047 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan <stuart_d_buchanan@yahoo.co.uk> Date: Sun, 29 Nov 2020 19:39:20 +0000 Subject: [PATCH] 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. --- gui/dialogs/checklist.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/dialogs/checklist.xml b/gui/dialogs/checklist.xml index 0520710b8..0795aa359 100644 --- a/gui/dialogs/checklist.xml +++ b/gui/dialogs/checklist.xml @@ -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); }