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:
parent
f1ef587a50
commit
30ee9b5734
1 changed files with 12 additions and 9 deletions
|
@ -444,15 +444,18 @@ var modelmgr = {
|
||||||
adjust_dialog.center_sliders();
|
adjust_dialog.center_sliders();
|
||||||
|
|
||||||
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 str = sprintf("%s: lat:%.4f lon:%.4f alt:%.0fm class(es): %s",
|
var region = "";
|
||||||
geod[1].region,
|
if (geod != nil and geod[1] != nil and geod[1].names != nil) landclass = string.join(" ", geod[1].names);
|
||||||
me.mouse_coord.lat(), me.mouse_coord.lon(),
|
if (geod != nil and geod[1] != nil and geod[1].region != nil) region = geod[1].region;
|
||||||
me.mouse_coord.alt(), landclass);
|
var str = sprintf("%s: lat:%.4f lon:%.4f alt:%.0fm class(es): %s",
|
||||||
gui.popupTip(str, 3);
|
region,
|
||||||
print(str);
|
me.mouse_coord.lat(), me.mouse_coord.lon(),
|
||||||
return;
|
me.mouse_coord.alt(), landclass);
|
||||||
|
gui.popupTip(str, 3);
|
||||||
|
print(str);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (KbdAlt.getValue()) { # move active object here (and other selected ones along with it)
|
if (KbdAlt.getValue()) { # move active object here (and other selected ones along with it)
|
||||||
|
|
Loading…
Add table
Reference in a new issue