1
0
Fork 0

Fix location dialog to understand initial carrier position from launcher/args

This commit is contained in:
Richard Harrison 2020-06-05 12:39:06 +02:00
parent 8b03cb4e60
commit f0aa44c834

View file

@ -7,6 +7,15 @@
<nasal>
<open>
var p = props.globals.getNode("/sim/gui/dialogs/location-in-air/", 1);
if (getprop("/sim/presets/carrier") != nil and getprop("/sim/presets/carrier") != ""){
setprop("/sim/gui/dialogs/location-in-air/carrier-active",1);
setprop("/sim/gui/dialogs/location-in-air/airport",0);
} else {
setprop("/sim/gui/dialogs/location-in-air/carrier-active",0);
setprop("/sim/gui/dialogs/location-in-air/airport",1);
}
var dlg_root = cmdarg();
var mode = {
airport: p.getNode("airport", 1),
@ -54,7 +63,9 @@
combo.removeChildren("value");
foreach (var carrier; carriers.getChildren("carrier")) {
combo.addChild("value").setValue(carrier.getNode("name", 1).getValue());
nameNode = carrier.getNode("name");
if(nameNode != nil and nameNode.getValue() != nil)
combo.addChild("value").setValue(nameNode.getValue());
}
};