1
0
Fork 0

Merge branch 'master' of gitorious.org:fg/fgdata

This commit is contained in:
BARANGER Emmanuel 2013-03-03 02:02:27 +01:00
commit a06f5be440
5 changed files with 73 additions and 8 deletions

View file

@ -12,6 +12,24 @@ Started October 23 2001 by John Check, fgpanels@rockfish.net
<sim>
<description>Cessna 172P Skyhawk (1981 model)</description>
<long-description>The Cessna 172 Skyhawk is a four-seat, single-engine, high-wing fixed-wing aircraft.
First flown in 1955 and still in production, more Cessna 172s have been built than any other aircraft.
</long-description>
<fr>
<long-description>Le Cessna 172 Skyhawk est un avion quadriplace, monomoteur à aile haute.
Il effectua son premier vol en 1955 et est toujours en production, plus de Cessna 172 ont été construits que tout autres avions.
</long-description>
</fr>
<tags>
<tag>ga</tag>
<tag>cessna</tag>
<tag>piston</tag>
<tag>single-engine</tag>
<tag>fixed-gear</tag>
</tags>
<author>David Megginson</author>
<status>early production</status>
<rating>

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

View file

@ -5,6 +5,18 @@
<description>UFO from the 'White Project' of the UNESCO</description>
<author>ET</author>
<long-description>With the UFO you can place 3D objects in the FlightGear scenery,
and inspect the scenery without worrying about crashing.</long-description>
<fr>
<long-description>Avec l'UFO (OVNI) vous pouvez placer des objets 3D dans les scènes de FlightGear scenery</long-description>
</fr>
<tags>
<tag>fictional</tag>
<tag>spaceship</tag>
</tags>
<flight-model>ufo</flight-model>
<sound>

View file

@ -18,14 +18,46 @@ var decreaseVisibility = func {
}
var adjustVisibility = func( factor ) {
var val = visibilityProp.getValue() * factor;
if( val < 1.0 ) val = getprop("/environment/visibility-m");
if( val > 30 ) {
visibilityProp.setDoubleValue(val);
visibilityOverrideProp.setBoolValue(1);
gui.popupTip(sprintf("Visibility: %.0f m", val));
}
}
var val = 0;
var aux_val = 0;
var local = getprop("sim/gui/dialogs/metar/mode/local-weather");
var global = getprop("sim/gui/dialogs/metar/mode/global-weather");
var max_aux_vis = 12.429216196;
var min_aux_vis = 9.90348;
if(global)
{
val = visibilityProp.getValue() * factor;
if( val < 1.0 ) val = getprop("/environment/visibility-m");
if( val > 30 ) {
visibilityProp.setDoubleValue(val);
visibilityOverrideProp.setBoolValue(1);
}
gui.popupTip(sprintf("Visibility: %.0f m", val));
}
else
{
if (factor == 1.1)
factor = 1.001;
else
factor = 0.999;
aux_val = auxvisibilityProp.getValue() * factor;
if( aux_val <= min_aux_vis)
auxvisibilityProp.setDoubleValue(min_aux_vis);
elsif(aux_val >= max_aux_vis)
auxvisibilityProp.setDoubleValue(max_aux_vis);
else
auxvisibilityProp.setDoubleValue(aux_val);
gui.popupTip(sprintf("Max Visibility: %.0f m", getprop("/local-weather/config/max-vis-range-m")));
}
}
##
# Handler. Reset visibility to default.
@ -38,8 +70,11 @@ var resetVisibility = func {
var visibilityProp = nil;
var visibilityOverrideProp = nil;
var auxvisibilityProp = nil;
_setlistener("/sim/signals/nasal-dir-initialized", func {
print ("environment init");
visibilityProp = props.globals.initNode("/environment/config/presets/visibility-m", 0, "DOUBLE" );
visibilityOverrideProp = props.globals.initNode("/environment/config/presets/visibility-m-override", 0, "BOOL" );
auxvisibilityProp = props.globals.initNode("/local-weather/config/aux-max-vis-range-m", 0, "DOUBLE" );
});