From 4e94cdc9067849af7b76ce379a59930b0931fd56 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Wed, 7 Aug 2019 17:43:42 +0100 Subject: [PATCH] Nasal/multiplayer.nas: in Pilot List, added column showing id of nearest airport. Requires changes to flightgear to populate /ai/models/multiplayer[]/sim/tower/airport-id. --- Nasal/multiplayer.nas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Nasal/multiplayer.nas b/Nasal/multiplayer.nas index 4a1ae87b2..ccd1314e8 100644 --- a/Nasal/multiplayer.nas +++ b/Nasal/multiplayer.nas @@ -188,7 +188,7 @@ var dialog = { slant: getprop("/sim/gui/selected-style/fonts/mp-list/slant") or 0, }; - me.header = ["view", " callsign", " model", func dialog.dist_hdr, func dialog.alt_hdr ~ " ", " brg", "chat", "ignore" ~ " ", " code", "ver", " set"]; + me.header = ["view", " callsign", " model", func dialog.dist_hdr, func dialog.alt_hdr ~ " ", " brg", "chat", "ignore" ~ " ", " code", "ver", "airport", " set"]; me.columns = [ { type: "checkbox", legend: "", property: "view", halign: "right", "pref-height": 14, "pref-width": 14, callback: "multiplayer.view_select", argprop: "callsign", }, { type: "text", property: "callsign", format: " %s", label: "-----------", halign: "fill" , font: me.font }, @@ -201,6 +201,7 @@ var dialog = { argprop: "callsign", label: "---------", halign: "right", font: me.font }, { type: "text", property: "id-code", format: " %s", label: "-----", halign: "fill" , font: me.font }, { type: "text", property: "sim/multiplay/protocol-version", format: " %s", label: "--", halign: "fill" , font: me.font }, + { type: "text", property: "airport-id", format: "%s", label: "----", halign: "fill" , font: me.font }, { type: "text", property: "set-loaded", format: "%s", label: "----", halign: "fill" , font: me.font }, ]; me.cs_warnings = {}; @@ -378,6 +379,11 @@ var dialog = { if (set != nil) set_numchildren = size(set.getChildren()); var set_loaded = (set_numchildren >= 2); + var airport_id = n.getNode("sim/tower/airport-id"); + if (airport_id != nil) { + airport_id = airport_id.getValue(); + } + n.setValues({ "model-short": n.getNode("model-installed").getValue() ? mp.model : "[" ~ mp.model ~ "]", "set-loaded": set_loaded ? " *" : " ", @@ -386,7 +392,8 @@ var dialog = { "distance-to-nm": distance * M2NM, "position/altitude-m": n.getNode("position/altitude-ft").getValue() * FT2M, "controls/invisible": contains(ignore, mp.callsign), - "id-code": idcode + "id-code": idcode, + "airport-id": airport_id, }); } }