1
0
Fork 0

only enable precipitation if it's enabled in the gui

(/sim/rendering/precipitation-gui-enabled) *and* if the aircraft wants it
(/sim/rendering/precipitation-aircraft-enabled). Some aircraft model rain
on the windshield and want to turn rain off for interior views.
This commit is contained in:
mfranz 2008-11-23 09:53:46 +00:00
parent 31162ce78b
commit 521954116c
2 changed files with 11 additions and 1 deletions

View file

@ -113,6 +113,15 @@ _setlistener("/sim/signals/nasal-dir-initialized", func {
fpsDisplay(1);
}
});
# only enable precipitation if gui *and* aircraft want it
var p = "/sim/rendering/precipitation-";
var precip_gui = getprop(p ~ "gui-enable");
var precip_ac = getprop(p ~ "aircraft-enable");
props.globals.getNode(p ~ "enable").setAttribute("userarchive", 0); # TODO remove later
var set_precip = func setprop(p ~ "enable", precip_gui and precip_ac);
setlistener(p ~ "gui-enable", func(n) set_precip(precip_gui = n.getValue()));
setlistener(p ~ "aircraft-enable", func(n) set_precip(precip_ac = n.getValue()));
});

View file

@ -68,7 +68,8 @@ Started September 2000 by David Megginson, david@megginson.com
<enhanced-lighting type="bool" userarchive="y">false</enhanced-lighting>
<distance-attenuation type="bool" userarchive="y">false</distance-attenuation>
<particles type="bool" userarchive="y">true</particles>
<precipitation-enable type="bool" userarchive="y">false</precipitation-enable>
<precipitation-gui-enable type="bool" userarchive="y">false</precipitation-gui-enable>
<precipitation-aircraft-enable type="bool">true</precipitation-aircraft-enable>
<precipitation>
<!-- streaks coloring and transparency -->
<min-light type="float">0.35</min-light>