From f0aa44c8345f882d7ec14af4a704e1baa37bdb3a Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Fri, 5 Jun 2020 12:39:06 +0200 Subject: [PATCH] Fix location dialog to understand initial carrier position from launcher/args --- gui/dialogs/location-in-air.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gui/dialogs/location-in-air.xml b/gui/dialogs/location-in-air.xml index 3122efc90..5a1c681b7 100644 --- a/gui/dialogs/location-in-air.xml +++ b/gui/dialogs/location-in-air.xml @@ -7,6 +7,15 @@ 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()); } };