2007-03-24 20:56:40 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<PropertyList>
|
|
|
|
<name>tutorial</name>
|
|
|
|
<layout>vbox</layout>
|
|
|
|
<default-padding>4</default-padding>
|
|
|
|
|
|
|
|
<text>
|
|
|
|
<label>Select Tutorial</label>
|
|
|
|
</text>
|
|
|
|
|
2007-03-26 15:25:27 +00:00
|
|
|
<hrule/>
|
2007-03-24 20:56:40 +00:00
|
|
|
|
|
|
|
<nasal>
|
|
|
|
<open>
|
2007-03-24 21:33:23 +00:00
|
|
|
var list = cmdarg().getNode("group[1]/group/list");
|
2007-03-24 20:56:40 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2007-03-26 15:25:27 +00:00
|
|
|
var select = func {
|
2007-03-24 20:56:40 +00:00
|
|
|
var name = current.getValue();
|
|
|
|
foreach (var t; tut) {
|
|
|
|
if (t.getNode("name").getValue() == name) {
|
|
|
|
setprop("/sim/tutorials/current-description",
|
2007-06-23 10:08:42 +00:00
|
|
|
string.trim(t.getNode("description").getValue()));
|
2007-03-24 20:56:40 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
</open>
|
|
|
|
</nasal>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
2007-03-24 21:33:23 +00:00
|
|
|
<default-padding>0</default-padding>
|
|
|
|
<empty><pref-width>7</pref-width></empty>
|
2007-03-24 20:56:40 +00:00
|
|
|
|
2007-03-24 21:33:23 +00:00
|
|
|
<text>
|
|
|
|
<halign>left</halign>
|
|
|
|
<label></label>
|
|
|
|
<property>/sim/tutorials/current-tutorial</property>
|
|
|
|
<live>1</live>
|
|
|
|
</text>
|
2007-03-24 20:56:40 +00:00
|
|
|
|
2007-03-24 21:33:23 +00:00
|
|
|
<empty><stretch>true</stretch></empty>
|
|
|
|
</group>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
|
|
|
|
<textbox>
|
|
|
|
<name>textbox</name>
|
|
|
|
<halign>fill</halign>
|
|
|
|
<pref-width>600</pref-width>
|
|
|
|
<pref-height>480</pref-height>
|
|
|
|
<slider>20</slider>
|
|
|
|
<wrap>true</wrap>
|
|
|
|
<editable>false</editable>
|
|
|
|
<live>1</live>
|
|
|
|
<property>/sim/tutorials/current-description</property>
|
|
|
|
</textbox>
|
2007-03-24 20:56:40 +00:00
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>vbox</layout>
|
|
|
|
|
|
|
|
<list>
|
|
|
|
<name>list</name>
|
|
|
|
<halign>fill</halign>
|
|
|
|
<pref-width>170</pref-width>
|
2007-03-24 21:33:23 +00:00
|
|
|
<pref-height>400</pref-height>
|
2007-03-24 20:56:40 +00:00
|
|
|
<property>/sim/tutorials/current-tutorial</property>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
<object-name>list</object-name>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>select()</script>
|
|
|
|
</binding>
|
|
|
|
</list>
|
|
|
|
|
|
|
|
<empty><stretch>true</stretch></empty>
|
|
|
|
|
|
|
|
<button>
|
|
|
|
<legend>Cancel</legend>
|
|
|
|
<equal>true</equal>
|
|
|
|
<key>Esc</key>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-close</command>
|
|
|
|
</binding>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<button>
|
|
|
|
<legend>Start Tutorial</legend>
|
|
|
|
<equal>true</equal>
|
|
|
|
<default>true</default>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>tutorial.startTutorial()</script>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-close</command>
|
|
|
|
</binding>
|
|
|
|
</button>
|
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
</PropertyList>
|