2018-09-22 06:06:20 +08:00
|
|
|
#
|
2018-10-07 20:57:07 +08:00
|
|
|
# VFR Navigator addon
|
2018-09-22 06:06:20 +08:00
|
|
|
#
|
|
|
|
# Slawek Mikula, August 2018
|
|
|
|
|
|
|
|
var main = func( addon ) {
|
|
|
|
var root = addon.basePath;
|
2020-07-27 03:52:45 +08:00
|
|
|
var my_addon_id = addon.id;
|
2019-12-27 06:57:00 +08:00
|
|
|
var my_settings_root_path = "/addons/by-id/" ~ my_addon_id ~ "/addon-devel/";
|
2018-09-22 06:06:20 +08:00
|
|
|
|
2019-12-27 06:57:00 +08:00
|
|
|
# persistent save of enable flag
|
|
|
|
props.globals.getNode(my_settings_root_path ~ "/showvfrstarter", 1).setAttribute("userarchive", "y");
|
2018-10-07 20:57:07 +08:00
|
|
|
|
|
|
|
var fdm_init_listener = _setlistener("/sim/signals/fdm-initialized", func {
|
|
|
|
removelistener(fdm_init_listener);
|
|
|
|
|
2019-12-27 06:57:00 +08:00
|
|
|
if (getprop(my_settings_root_path ~ "/showvfrstarter") == 1) {
|
2018-10-07 20:57:07 +08:00
|
|
|
gui.showDialog("vfrstarter");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var reinit_listener = _setlistener("/sim/signals/reinit", func {
|
|
|
|
removelistener(reinit_listener);
|
|
|
|
|
2019-12-27 06:57:00 +08:00
|
|
|
if (getprop(my_settings_root_path ~ "/showvfrstarter") == 1) {
|
2018-10-07 20:57:07 +08:00
|
|
|
gui.showDialog("vfrstarter");
|
|
|
|
}
|
|
|
|
});
|
2018-09-22 06:06:20 +08:00
|
|
|
}
|