tutorialvbox4
var list = cmdarg().getNode("group[1]/group/list");
var node = props.globals.getNode("/sim/tutorials", 1);
var tut = node.getChildren("tutorial");
var current = node.getNode("current-tutorial", 1);
# fill listbox
list.removeChildren("value");
forindex (var i; tut) {
var name = tut[i].getNode("name");
if (name == nil) {
die("tutorial #" ~ i ~ " has no <name>");
}
name = name.getValue();
list.getChild("value", i, 1).setValue(name);
}
var select = func {
var name = current.getValue();
foreach (var t; tut) {
if (t.getNode("name").getValue() == name) {
setprop("/sim/tutorials/current-description",
screen.trim(t.getNode("description").getValue()));
break;
}
}
fgcommand("dialog-update", props.Node.new({"object-name": "textbox",
"dialog-name": "tutorial"}));
}
if (current.getType() == "NONE" or current.getValue() == "") {
current.setValue(tut[0].getNode("name").getValue());
select();
}
hbox07left/sim/tutorials/current-tutorial1truehboxtextboxfill60048020truefalse1/sim/tutorials/current-descriptionvboxlistfill170400/sim/tutorials/current-tutorialdialog-applylistnasaltrue