1
0
Fork 0

s,/sim/tutorial,/sim/tutorials,

This commit is contained in:
mfranz 2007-03-24 13:32:15 +00:00
parent c0290713b6
commit 7f375cf76c
3 changed files with 12 additions and 12 deletions

View file

@ -70,7 +70,7 @@ Started October 23 2001 by John Check, fgpanels@rockfish.net
<title>Cessna 172P</title> <title>Cessna 172P</title>
</help> </help>
<tutorial include="c172-tutorial.xml"/> <tutorials include="c172-tutorial.xml"/>
</sim> </sim>

View file

@ -71,7 +71,7 @@ INIT = func {
# enable/disable menu entries # enable/disable menu entries
menuEnable("fuel-and-payload", getprop("/sim/flight-model") == "yasim"); menuEnable("fuel-and-payload", getprop("/sim/flight-model") == "yasim");
menuEnable("autopilot", props.globals.getNode("/autopilot/KAP140/locks") == nil); menuEnable("autopilot", props.globals.getNode("/autopilot/KAP140/locks") == nil);
menuEnable("tutorial-start", size(props.globals.getNode("/sim").getChildren("tutorial"))); menuEnable("tutorial-start", size(props.globals.getNode("/sim/tutorials").getChildren("tutorial")));
menuEnable("joystick-info", size(props.globals.getNode("/input/joysticks").getChildren("js"))); menuEnable("joystick-info", size(props.globals.getNode("/input/joysticks").getChildren("js")));
var fps = props.globals.getNode("/sim/rendering/fps-display", 1); var fps = props.globals.getNode("/sim/rendering/fps-display", 1);
@ -281,7 +281,7 @@ showSelTutDialog = func {
dialog[name].addChild("hrule").set("pref-height", 1); dialog[name].addChild("hrule").set("pref-height", 1);
if (props.globals.getNode("/sim/tutorial") == nil) { if (props.globals.getNode("/sim/tutorials") == nil) {
msg = dialog[name].addChild("text"); msg = dialog[name].addChild("text");
msg.set("label", "No tutorials available for this aircraft"); msg.set("label", "No tutorials available for this aircraft");
cancel = dialog[name].addChild("button"); cancel = dialog[name].addChild("button");
@ -301,10 +301,10 @@ showSelTutDialog = func {
combo = contentArea.addChild("combo"); combo = contentArea.addChild("combo");
combo.set("pref-width", "200"); combo.set("pref-width", "200");
combo.set("property", "/sim/tutorial/current-tutorial"); combo.set("property", "/sim/tutorials/current-tutorial");
# Get a list of all tutorials # Get a list of all tutorials
ltutorials = props.globals.getNode("/sim/tutorial").getChildren("tutorial"); ltutorials = props.globals.getNode("/sim/tutorials").getChildren("tutorial");
for(i=0; i<size(ltutorials); i+=1) { for(i=0; i<size(ltutorials); i+=1) {
c = ltutorials[i]; c = ltutorials[i];
if (c.getChild("name") != nil) { if (c.getChild("name") != nil) {
@ -312,7 +312,7 @@ showSelTutDialog = func {
lentry = combo.addChild("value"); lentry = combo.addChild("value");
lentry.prop().setValue(lname); lentry.prop().setValue(lname);
if (i == 0) { if (i == 0) {
setprop("/sim/tutorial/current-tutorial", lname); setprop("/sim/tutorials/current-tutorial", lname);
} }
} }
} }
@ -345,19 +345,19 @@ showTutorialDialog = func {
name = "displayTutorial"; name = "displayTutorial";
# Get tutorial title and description # Get tutorial title and description
ltutorial = getprop("/sim/tutorial/current-tutorial"); ltutorial = getprop("/sim/tutorials/current-tutorial");
if (ltutorial == nil) { ltutorial = "<undefined>"; } if (ltutorial == nil) { ltutorial = "<undefined>"; }
lfound = 0; lfound = 0;
ldescription = "No description available for this tutorial."; ldescription = "No description available for this tutorial.";
foreach(c; props.globals.getNode("/sim/tutorial").getChildren("tutorial")) { foreach(c; props.globals.getNode("/sim/tutorials").getChildren("tutorial")) {
if (c.getChild("name").getValue() == ltutorial) { if (c.getChild("name").getValue() == ltutorial) {
lfound = 1; lfound = 1;
if (c.getChild("description") != nil) { if (c.getChild("description") != nil) {
ldescription = c.getChild("description") .getValue(); ldescription = c.getChild("description") .getValue();
setprop("/sim/tutorial/description", ldescription); setprop("/sim/tutorials/description", ldescription);
} }
} }
} }
@ -397,7 +397,7 @@ showTutorialDialog = func {
textarea.set("editable", "false"); textarea.set("editable", "false");
textarea.set("valign", "top"); textarea.set("valign", "top");
textarea.set("halign", "fill"); textarea.set("halign", "fill");
textarea.set("property", "/sim/tutorial/description"); textarea.set("property", "/sim/tutorials/description");
buttonBar = dialog[name].addChild("group"); buttonBar = dialog[name].addChild("group");
buttonBar.set("layout", "hbox"); buttonBar.set("layout", "hbox");

View file

@ -228,8 +228,8 @@ var L = _setlistener("/sim/signals/nasal-dir-initialized", func {
msg_repeat = func { msg_repeat = func {
if (getprop("/sim/tutorial/running")) { if (getprop("/sim/tutorials/running")) {
var last = getprop("/sim/tutorial/last-message"); var last = getprop("/sim/tutorials/last-message");
if (last == nil) { if (last == nil) {
return; return;
} }