1
0
Fork 0

Adapted local weather package and menu to new submodule structure.

This commit is contained in:
ThorstenB 2011-06-13 22:27:44 +02:00
parent aea57a9882
commit 1bf8b99bc9
5 changed files with 43 additions and 4 deletions

View file

@ -67,8 +67,19 @@
# The compatibility layer is currently work in progress and will be extended as new Nasal
# APIs are being added to FlightGear.
var weather_dynamics = nil;
var weather_tile_management = nil;
var compat_layer = nil;
var weather_tiles = nil;
_setlistener("/nasal/local_weather/loaded", func {
compat_layer = local_weather;
weather_dynamics = local_weather;
weather_tile_management = local_weather;
weather_tiles = local_weather;
_setlistener("/sim/signals/nasal-dir-initialized", func {
var result = "yes";

View file

@ -4613,10 +4613,18 @@ setprop(lw~"tiles/tile-counter",0);
setprop(lwi~"ipoint-number",0);
var updateMenu = func {
var isEnabled = getprop("/nasal/local_weather/enabled");
gui.menuEnable("local_weather", isEnabled);
gui.menuEnable("local_weather_tiles", isEnabled);
}
_setlistener("/nasal/local_weather/enabled", updateMenu);
# wait for Nasal to be available and do what is in startup()
_setlistener("/sim/signals/nasal-dir-initialized", func {
_setlistener("/nasal/local_weather/loaded", func {
updateMenu();
startup();
});

View file

@ -6,10 +6,22 @@
<name>local_weather_config</name>
<width>400</width>
<height>400</height>
<height>440</height>
<modal>false</modal>
<checkbox>
<x>5</x>
<y>400</y>
<width>15</width>
<height>15</height>
<label>Enable local weather module</label>
<property>/nasal/local_weather/enabled</property>
<binding>
<command>dialog-apply</command>
</binding>
</checkbox>
<text>
<x>5</x>
<y>370</y>

View file

@ -329,7 +329,8 @@
<item>
<label>Local Weather</label>
<name>local_weather</name>
<name>local_weather_tiles</name>
<enabled>false</enabled>
<binding>
<command>dialog-show</command>
<dialog-name>local_weather_tiles</dialog-name>
@ -690,6 +691,7 @@
<item>
<label>Local Weather (Test)</label>
<name>local_weather</name>
<enabled>false</enabled>
<binding>
<command>dialog-show</command>
<dialog-name>local_weather</dialog-name>

View file

@ -1242,6 +1242,12 @@ Started September 2000 by David Megginson, david@megginson.com
</atc-chatter>
</nasal>
<nasal>
<local_weather>
<enabled type="bool" userarchive="y">false</enabled>
</local_weather>
</nasal>
</PropertyList>
<!-- end of preferences.xml -->