1
0
Fork 0

Move AW auto-start detection outside AW namespace to avoid duplicate AW start issue when de-selected in launcher and selected in-sim

This commit is contained in:
Thorsten Renk 2018-10-06 09:41:22 +03:00
parent 43ac415a8a
commit 73073c4512
2 changed files with 17 additions and 10 deletions

View file

@ -4757,13 +4757,3 @@ var updateMenu = func {
_setlistener("/nasal/local_weather/enabled", updateMenu);
var autoInit = func {
var isEnabled = getprop("/nasal/local_weather/enabled");
if (isEnabled == 1)
{
print ("Request detected to initialize Advanced Weather on startup...");
settimer( func {local_weather.set_tile();}, 0.2);
}
}
autoInit();

View file

@ -0,0 +1,17 @@
# this routine checks whether the launcher has requested to auto-start AW
# we can't do this inside the AW namespace because that is only loaded
# on demand, and we want this at Nasal (re-)init, not at AW namespace loading
# Thorsten Renk 2018
var autoInit = func {
var isEnabled = getprop("/nasal/local_weather/enabled");
if (isEnabled == 1)
{
print ("Request detected to initialize Advanced Weather on startup...");
settimer( func {local_weather.set_tile();}, 0.2);
}
}
autoInit();