NTPS-target-task
vbox
p = props.globals.getNode("/sim/gui/dialogs/NTPS/task", 1);
mode = {
straight: p.getNode("straight", 1),
turns: p.getNode("turns", 1),
pitch: p.getNode("pitch", 1),
both: p.getNode("both", 1),
};
set_radio = func(m) {
foreach (k; keys(mode)) {
mode[k].setBoolValue(m == k);
}
}
initialized = 0;
foreach (k; keys(mode)) {
if (mode[k].getType() == "NONE") {
mode[k].setBoolValue(0);
}
initialized += mode[k].getBoolValue();
}
if (!initialized) {
set_radio("straight");
}
# just kept for educational purposes :-)
hbox
8
table
0
0
/sim/gui/dialogs/NTPS/task/straight
true
nasal
left
0
1
1
0
/sim/gui/dialogs/NTPS/task/turns
true
nasal
left
1
1
2
0
/sim/gui/dialogs/NTPS/task/pitch
true
nasal
left
2
1
3
0
/sim/gui/dialogs/NTPS/task/both
true
nasal
left
3
1