1
0
Fork 0

Ctrl+Alt+Click handle lack of material info

Previously if a user Ctrl+Alt+Click on a piece of scenery
without material information, FG would throw a Nasal error.
This change handles the situation a bit more gracefully by
at least outputting the lat/lon/alt.
This commit is contained in:
Stuart Buchanan 2023-10-22 21:13:21 +01:00
parent f1ef587a50
commit 30ee9b5734

View file

@ -445,9 +445,12 @@ var modelmgr = {
if (KbdAlt.getValue() and KbdCtrl.getValue()) { # Provide information on the selected point if (KbdAlt.getValue() and KbdCtrl.getValue()) { # Provide information on the selected point
var geod = geodinfo(me.mouse_coord.lat(), me.mouse_coord.lon()); var geod = geodinfo(me.mouse_coord.lat(), me.mouse_coord.lon());
var landclass = string.join(" ", geod[1].names); var landclass = "";
var region = "";
if (geod != nil and geod[1] != nil and geod[1].names != nil) landclass = string.join(" ", geod[1].names);
if (geod != nil and geod[1] != nil and geod[1].region != nil) region = geod[1].region;
var str = sprintf("%s: lat:%.4f lon:%.4f alt:%.0fm class(es): %s", var str = sprintf("%s: lat:%.4f lon:%.4f alt:%.0fm class(es): %s",
geod[1].region, region,
me.mouse_coord.lat(), me.mouse_coord.lon(), me.mouse_coord.lat(), me.mouse_coord.lon(),
me.mouse_coord.alt(), landclass); me.mouse_coord.alt(), landclass);
gui.popupTip(str, 3); gui.popupTip(str, 3);