1
0
Fork 0

Merge branch 'work' of D:\Git_New\fgdata

This commit is contained in:
Vivian Meazza 2011-08-23 22:52:24 +01:00
commit 3ca2539064
13 changed files with 526 additions and 306 deletions

View file

@ -32,12 +32,14 @@
<animation> <animation>
<type>material</type> <type>material</type>
<object-name>egt</object-name> <object-name>Needle</object-name>
<object-name>Bug</object-name>
<object-name>Face</object-name>
<emission> <emission>
<red-prop>sim/model/instrument-lighting/emission/red</red-prop> <red>1.0</red>
<green-prop>sim/model/instrument-lighting/emission/green</green-prop> <green>0.2</green>
<blue-prop>sim/model/instrument-lighting/emission/blue</blue-prop> <blue>0.0</blue>
<factor-prop>controls/lighting/instruments-norm</factor-prop> <factor-prop>sim/model/material/instruments/factor</factor-prop>
</emission> </emission>
</animation> </animation>

View file

@ -4,6 +4,10 @@
<name>Ctrl-c</name> <name>Ctrl-c</name>
<desc>Panel hotspots and labels</desc> <desc>Panel hotspots and labels</desc>
</key> </key>
<key>
<name>l/L</name>
<desc>Increase/decrease panel lighting</desc>
</key>
<line/> <line/>
<line>_________Engine Start Checklist_________</line> <line>_________Engine Start Checklist_________</line>
<line>Mixture: Rich</line> <line>Mixture: Rich</line>

View file

@ -241,23 +241,47 @@ Started October 23 2001 by John Check, fgpanels@rockfish.net
</payload> </payload>
<input> <input>
<keyboard> <keyboard>
<key n="115"> <key n="76">
<name>s</name> <name>L</name>
<desc>Toggle Starter Switch</desc> <desc>Decrease Panel lighting</desc>
<binding> <binding>
<command>property-assign</command> <command>property-adjust</command>
<property>/controls/switches/starter</property> <property>controls/lighting/instruments-norm</property>
<value >1</value> <step>-0.1</step>
</binding> <min>0</min>
<mod-up> <max>1.0</max>
<binding> <wrap>0</wrap>
<command>property-assign</command> </binding>
<property>/controls/switches/starter</property> </key>
<value>0</value> <key n="108">
</binding> <name>l</name>
</mod-up> <desc>Increase Panel lighting</desc>
</key> <binding>
<command>property-adjust</command>
<property>controls/lighting/instruments-norm</property>
<step>0.1</step>
<min>0</min>
<max>1.0</max>
<wrap>0</wrap>
</binding>
</key>
<key n="115">
<name>s</name>
<desc>Toggle Starter Switch</desc>
<binding>
<command>property-assign</command>
<property>/controls/switches/starter</property>
<value >1</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>/controls/switches/starter</property>
<value>0</value>
</binding>
</mod-up>
</key>
</keyboard> </keyboard>
</input> </input>

View file

@ -160,9 +160,9 @@ properties, though they will ignore any that are not relevant:
default - true if this is the default object for when the user default - true if this is the default object for when the user
presses the [RETURN] key. presses the [RETURN] key.
hide - if set to true, hides the whole widget that it is used visible - if set to false, hides the whole widget that it is used
in, along with its children. There's no empty space reserved in, along with its children. There's no empty space reserved
for such widgets. The "hide" property can also be used to hide for such widgets. The "visible" property can also be used to hide
other XML groups from the layouter. other XML groups from the layouter.
Objects may appear nested within the top-level dialog or a "group" Objects may appear nested within the top-level dialog or a "group"

View file

@ -4,6 +4,9 @@
<parameters> <parameters>
<texture n ="0"> <texture n ="0">
</texture> </texture>
<range>
<use>/sim/rendering/clouds3d-vis-range</use>
</range>
</parameters> </parameters>
<technique n="10"> <technique n="10">
<predicate> <predicate>
@ -63,6 +66,11 @@
<type>sampler-2d</type> <type>sampler-2d</type>
<value type="int">0</value> <value type="int">0</value>
</uniform> </uniform>
<uniform>
<name>range</name>
<type>float</type>
<value><use>range</use></value>
</uniform>
<vertex-program-two-side>true</vertex-program-two-side> <vertex-program-two-side>true</vertex-program-two-side>
</pass> </pass>
</technique> </technique>

View file

@ -0,0 +1,58 @@
<?xml version="1.0"?>
<!--
************************************************************************
* Setup for Saitek Pro Combat Rudder Pedals.
*
* These are USB rudder pedals with toe brakes. Bindings are as
* follow:
*
* Axis 0 (left pedal): left brake
* Axis 1 (right pedal): right brake
* Axis 2 (sliding both pedals): rudder (and nosewheel)
************************************************************************
$Id$
-->
<PropertyList>
<name>Saitek Pro Flight Combat Rudder Pedals</name>
<name>Saitek Saitek Pro Flight Combat Rudder Pedals</name>
<axis n="0">
<desc>Brake left</desc>
<binding>
<command>property-scale</command>
<property>/controls/gear/brake-left</property>
<offset>1.0</offset>
<factor>0.5</factor>
</binding>
</axis>
<axis n="1">
<desc>Brake right</desc>
<binding>
<command>property-scale</command>
<property>/controls/gear/brake-right</property>
<offset>1.0</offset>
<factor>0.5</factor>
</binding>
</axis>
<axis n="2">
<number>
<windows>3</windows>
<mac>2</mac>
<unix>2</unix>
</number>
<desc>Rudder</desc>
<binding>
<command>property-scale</command>
<property>/controls/flight/rudder</property>
<factor>1.0</factor>
<offset>0.0</offset>
<power type="double">2.0</power>
</binding>
</axis>
</PropertyList>

View file

@ -1,265 +1,301 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- Saitek Pro Flight Yoke <!-- Saitek Pro Flight Yoke
Copyright (C) 2008 Oliver Schroeder (fgfs(at)o-schroeder.de) Copyright (C) 2008 Oliver Schroeder (fgfs(at)o-schroeder.de)
This file is released under the GPL license. This file is released under the GPL license.
--> -->
<PropertyList> <PropertyList>
<name>Saitek Saitek Pro Flight Yoke</name> <name>Saitek Saitek Pro Flight Yoke</name>
<name>Saitek Pro Flight Yoke</name> <name>Saitek Pro Flight Yoke</name>
<axis n="0"> <axis n="0">
<desc>Aileron</desc> <desc>Aileron</desc>
<binding> <binding>
<command>property-scale</command> <command>property-scale</command>
<property>/controls/flight/aileron</property> <property>/controls/flight/aileron</property>
<squared type="bool">true</squared> <squared type="bool">true</squared>
</binding> </binding>
</axis> </axis>
<axis n="1"> <axis n="1">
<desc>Elevator</desc> <desc>Elevator</desc>
<binding> <binding>
<command>property-scale</command> <command>property-scale</command>
<property>/controls/flight/elevator</property> <property>/controls/flight/elevator</property>
<factor type="double">-1.0</factor> <factor type="double">-1.0</factor>
<squared type="bool">true</squared> <squared type="bool">true</squared>
</binding> </binding>
</axis> </axis>
<!-- Throttle Quadrant --> <!-- Throttle Quadrant -->
<axis n="2"> <axis n="2">
<desc>Throttle</desc> <desc>Throttle</desc>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>controls.throttleAxis()</script> <script>controls.throttleAxis()</script>
</binding> </binding>
</axis> </axis>
<axis n="3"> <axis>
<desc>Prop Pitch</desc> <number>
<binding> <unix>3</unix>
<command>nasal</command> <windows>4</windows>
<script>controls.propellerAxis()</script> </number>
</binding> <desc>Prop Pitch</desc>
</axis> <binding>
<axis n="4"> <command>nasal</command>
<desc>Mixture </desc> <script>controls.propellerAxis()</script>
<binding> </binding>
<command>nasal</command> </axis>
<script>controls.mixtureAxis()</script> <axis>
</binding> <number>
</axis> <unix>4</unix>
<windows>3</windows>
</number>
<desc>Mixture</desc>
<binding>
<command>nasal</command>
<script>controls.mixtureAxis()</script>
</binding>
</axis>
<!-- Coolie Hat -->
<axis>
<number>
<unix>5</unix>
<windows>6</windows>
</number>
<desc>View Direction</desc>
<low>
<repeatable>true</repeatable>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/goal-heading-offset-deg</property>
<step type="double">1.0</step>
</binding>
</low>
<high>
<repeatable>true</repeatable>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/goal-heading-offset-deg</property>
<step type="double">-1.0</step>
</binding>
</high>
</axis>
<axis>
<number>
<unix>6</unix>
</number>
<desc>View Elevation</desc>
<low>
<repeatable>true</repeatable>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/goal-pitch-offset-deg</property>
<step type="double">1.0</step>
</binding>
</low>
<high>
<repeatable>true</repeatable>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/goal-pitch-offset-deg</property>
<step type="double">-1.0</step>
</binding>
</high>
</axis>
<axis>
<number>
<windows>7</windows>
</number>
<desc>View Elevation</desc>
<low>
<repeatable>true</repeatable>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/goal-pitch-offset-deg</property>
<step type="double">-1.0</step>
</binding>
</low>
<high>
<repeatable>true</repeatable>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/goal-pitch-offset-deg</property>
<step type="double">1.0</step>
</binding>
</high>
</axis>
<!-- Buttons on the Yoke -->
<button n="0">
<desc>Cycle View</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>view.stepView(1)</script>
</binding>
</button>
<button n="1"> <!-- Labled as D -->
<desc>Toggle parking break</desc>
<binding>
<command>property-toggle</command>
<property>/controls/gear/brake-parking</property>
</binding>
</button>
<button n="2"> <!-- Labled as A1 -->
<desc>Elevator trim down</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.elevatorTrim(0.75)</script>
</binding>
</button>
<button n="3"> <!-- Labled as A2 -->
<desc>Elevator trim up</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.elevatorTrim(-0.75)</script>
</binding>
</button>
<button n="4"> <!-- Labled as B1 -->
<desc>Zoom In</desc>
<repeatable>true</repeatable>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/field-of-view</property>
<step type="double">-0.5</step>
</binding>
</button>
<button n="5"> <!-- LAbled as B2 -->
<desc>Zoom Out</desc>
<repeatable>true</repeatable>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/field-of-view</property>
<step type="double">+0.5</step>
</binding>
</button>
<button n="6"> <!-- Labled as C1 -->
<desc>Aileron trim left</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.aileronTrim(-0.75)</script>
</binding>
</button>
<button n="7"> <!-- Labled as C2 -->
<desc>Aileron trim right</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.aileronTrim(0.75)</script>
</binding>
</button>
<axis n="5"> <!-- Buttons on the throttle Quadrant -->
<desc>View Direction</desc> <button n="14"> <!-- Labled as T1 -->
<low> <desc>Flaps up</desc>
<repeatable>true</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/sim/current-view/goal-heading-offset-deg</property> <script>controls.flapsDown(-1)</script>
<step type="double">1.0</step> </binding>
</binding> <mod-up>
</low> <binding>
<high> <command>nasal</command>
<repeatable>true</repeatable> <script>controls.flapsDown(0)</script>
<binding> </binding>
<command>property-adjust</command> </mod-up>
<property>/sim/current-view/goal-heading-offset-deg</property> </button>
<step type="double">-1.0</step> <button n="15"> <!-- Labled as T2 -->
</binding> <desc>Flaps down</desc>
</high> <repeatable>false</repeatable>
</axis> <binding>
<command>nasal</command>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="16"> <!-- Labled as T3 -->
<desc>Gear up</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.gearDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.gearDown(0)</script>
</binding>
</mod-up>
</button>
<button n="17"> <!-- Labled as T4 -->
<desc>Gear down</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.gearDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.gearDown(0)</script>
</binding>
</mod-up>
</button>
<button n="18"> <!-- Labled as T5 -->
<desc>Retract Spoilers</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepSpoilers(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.stepSpoilers(0)</script>
</binding>
</mod-up>
</button>
<axis n="6"> <button n="19"> <!-- Labled as T6 -->
<desc>View Elevation</desc> <desc>Deploy Spoilers</desc>
<low> <repeatable>false</repeatable>
<repeatable>true</repeatable> <binding>
<binding> <command>nasal</command>
<command>property-adjust</command> <script>controls.stepSpoilers(1)</script>
<property>/sim/current-view/goal-pitch-offset-deg</property> </binding>
<step type="double">1.0</step> <mod-up>
</binding> <binding>
</low> <command>nasal</command>
<high> <script>controls.stepSpoilers(0)</script>
<repeatable>true</repeatable> </binding>
<binding> </mod-up>
<command>property-adjust</command> </button>
<property>/sim/current-view/goal-pitch-offset-deg</property> <button n="20">
<step type="double">-1.0</step> <desc>thrust reverse</desc>
</binding> <repeatable type="bool">false</repeatable>
</high> <binding>
</axis> <command>nasal</command>
<!-- Buttons on the Yoke --> <script>
<button n="0"> props.setAll("/controls/engines/engine", "reverser", 1);
<desc>Cycle View</desc> props.setAll("/controls/engines/engine", "throttle", 1);
<repeatable>false</repeatable> gui.popupTip("Thrust reverse on!");
<binding> </script>
<command>nasal</command> </binding>
<script>view.stepView(1)</script> <mod-up>
</binding> <binding>
</button> <command>nasal</command>
<button n="1"> <!-- Labled as D --> <script>
<desc>Toggle parking break</desc> props.setAll("/controls/engines/engine", "reverser", 0);
<binding> props.setAll("/controls/engines/engine", "throttle", 0);
<command>property-toggle</command> gui.popupTip("Thrust reverse off!");
<property>/controls/gear/brake-parking</property> </script>
</binding> </binding>
</button> </mod-up>
<button n="2"> <!-- Labled as A1 --> </button>
<desc>Elevator trim down</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.elevatorTrim(0.75)</script>
</binding>
</button>
<button n="3"> <!-- Labled as A2 -->
<desc>Elevator trim up</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.elevatorTrim(-0.75)</script>
</binding>
</button>
<button n="4"> <!-- Labled as B1 -->
<desc>Zoom In</desc>
<repeatable>true</repeatable>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/field-of-view</property>
<step type="double">-0.5</step>
</binding>
</button>
<button n="5"> <!-- LAbled as B2 -->
<desc>Zoom Out</desc>
<repeatable>true</repeatable>
<binding>
<command>property-adjust</command>
<property>/sim/current-view/field-of-view</property>
<step type="double">+0.5</step>
</binding>
</button>
<button n="6"> <!-- Labled as C1 -->
<desc>Aileron trim left</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.aileronTrim(-0.75)</script>
</binding>
</button>
<button n="7"> <!-- Labled as C2 -->
<desc>Aileron trim right</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>controls.aileronTrim(0.75)</script>
</binding>
</button>
<!-- Buttons on the throttle Quadrant -->
<button n="14"> <!-- Labled as T1 -->
<desc>Flaps up</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="15"> <!-- Labled as T2 -->
<desc>Flaps down</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="16"> <!-- Labled as T3 -->
<desc>Gear up</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.gearDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.gearDown(0)</script>
</binding>
</mod-up>
</button>
<button n="17"> <!-- Labled as T4 -->
<desc>Gear down</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.gearDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.gearDown(0)</script>
</binding>
</mod-up>
</button>
<button n="18"> <!-- Labled as T5 -->
<desc>Retract Spoilers</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepSpoilers(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.stepSpoilers(0)</script>
</binding>
</mod-up>
</button>
<button n="19"> <!-- Labled as T6 -->
<desc>Deploy Spoilers</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepSpoilers(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.stepSpoilers(0)</script>
</binding>
</mod-up>
</button>
<button n="20">
<desc>thrust reverse</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>
props.setAll("/controls/engines/engine", "reverser", 1);
props.setAll("/controls/engines/engine", "throttle", 1);
gui.popupTip("Thrust reverse on!");
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
props.setAll("/controls/engines/engine", "reverser", 0);
props.setAll("/controls/engines/engine", "throttle", 0);
gui.popupTip("Thrust reverse off!");
</script>
</binding>
</mod-up>
</button>
</PropertyList> </PropertyList>

View file

@ -505,7 +505,7 @@ var OverlaySelector = {
# selector.open(); # selector.open();
# #
var FileSelector = { var FileSelector = {
new: func(callback, title, button, pattern = nil, dir = "", file = "", dotfiles = 0) { new: func(callback, title, button, pattern = nil, dir = "", file = "", dotfiles = 0, show_files=1) {
var name = "file-select-"; var name = "file-select-";
var data = props.globals.getNode("/sim/gui/dialogs/", 1); var data = props.globals.getNode("/sim/gui/dialogs/", 1);
for (var i = 1; 1; i += 1) for (var i = 1; 1; i += 1)
@ -520,6 +520,7 @@ var FileSelector = {
m.set_button(button); m.set_button(button);
m.set_directory(dir); m.set_directory(dir);
m.set_file(file); m.set_file(file);
m.set_show_files(show_files);
m.set_dotfiles(dotfiles); m.set_dotfiles(dotfiles);
m.set_pattern(pattern); m.set_pattern(pattern);
m.cblistener = setlistener(data.getNode("path", 1), callback); m.cblistener = setlistener(data.getNode("path", 1), callback);
@ -530,6 +531,7 @@ var FileSelector = {
set_button: func(button) { me.data.getNode("button", 1).setValue(button) }, set_button: func(button) { me.data.getNode("button", 1).setValue(button) },
set_directory: func(dir) { me.data.getNode("directory", 1).setValue(dir) }, set_directory: func(dir) { me.data.getNode("directory", 1).setValue(dir) },
set_file: func(file) { me.data.getNode("selection", 1).setValue(file) }, set_file: func(file) { me.data.getNode("selection", 1).setValue(file) },
set_show_files: func(show) { me.data.getNode("show-files", 1).setValue(show) },
set_dotfiles: func(dot) { me.data.getNode("dotfiles", 1).setBoolValue(dot) }, set_dotfiles: func(dot) { me.data.getNode("dotfiles", 1).setBoolValue(dot) },
set_pattern: func(pattern) { set_pattern: func(pattern) {
me.data.removeChildren("pattern"); me.data.removeChildren("pattern");
@ -545,6 +547,14 @@ var FileSelector = {
}, },
}; };
##
# DirSelector - convenience "class" (indeed using a reconfigured FileSelector)
#
var DirSelector = {
new: func(callback, title, button, dir = "") {
return FileSelector.new(callback, title, button, nil, dir, "", 0, show_files=0);
}
};
## ##
# Save/load flight menu functions. # Save/load flight menu functions.
@ -573,6 +583,17 @@ var load_flight = func {
load_flight_sel.open(); load_flight_sel.open();
} }
##
# Screen-shot directory menu function
#
var set_screenshotdir_sel = nil;
var set_screenshotdir = func {
if (set_screenshotdir_sel == nil)
set_screenshotdir_sel = gui.DirSelector.new(
func(result) { setprop("/sim/paths/screenshot-dir", result.getValue()); },
"Select Screenshot Directory", "Ok", getprop("/sim/paths/screenshot-dir"));
set_screenshotdir_sel.open();
}
## ##
# Open property browser with given target path. # Open property browser with given target path.

View file

@ -3,6 +3,8 @@
varying float fogFactor; varying float fogFactor;
uniform float range; // From /sim/rendering/clouds3d-vis-range
attribute vec3 usrAttr1; attribute vec3 usrAttr1;
attribute vec3 usrAttr2; attribute vec3 usrAttr2;
@ -40,26 +42,30 @@ void main(void)
// Determine a lighting normal based on the vertex position from the // Determine a lighting normal based on the vertex position from the
// center of the cloud, so that sprite on the opposite side of the cloud to the sun are darker. // center of the cloud, so that sprite on the opposite side of the cloud to the sun are darker.
float n = dot(normalize(-gl_LightSource[0].position.xyz), float n = dot(normalize(-gl_LightSource[0].position.xyz),
normalize(vec3(gl_ModelViewMatrix * vec4(- gl_Position.xyz,0.0)))); normalize(vec3(gl_ModelViewMatrix * vec4(- gl_Position.x, - gl_Position.y, - gl_Position.z,0.0))));
// Determine the position - used for fog and shading calculations // Determine the position - used for fog and shading calculations
vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Position); vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Position);
float fogCoord = abs(ecPosition.z); float fogCoord = abs(ecPosition.z);
// Determine fractional height of vertex from 0 at the bottom, and 1 at mid-height.
// Used to determine shading.
float fract = smoothstep(0.0, cloud_height, gl_Position.z + cloud_height); float fract = smoothstep(0.0, cloud_height, gl_Position.z + cloud_height);
// Final position of the sprite // Final position of the sprite
gl_Position = gl_ModelViewProjectionMatrix * gl_Position; gl_Position = gl_ModelViewProjectionMatrix * gl_Position;
// Determine the shading of the sprite based on its vertical position and position relative to the sun. // Determine the shading of the sprite based on its vertical position and position relative to the sun.
n = min(smoothstep(-0.5, 0.0, n), fract); n = min(smoothstep(-0.5, 0.0, n), fract);
// Determine the shading based on a mixture from the backlight to the front
// Determine the shading based on a mixture from the backlight to the front
vec4 backlight = gl_LightSource[0].diffuse * shade; vec4 backlight = gl_LightSource[0].diffuse * shade;
gl_FrontColor = mix(backlight, gl_LightSource[0].diffuse, n); gl_FrontColor = mix(backlight, gl_LightSource[0].diffuse, n);
gl_FrontColor += gl_FrontLightModelProduct.sceneColor; gl_FrontColor += gl_FrontLightModelProduct.sceneColor;
// As we get within 100m of the sprite, it is faded out. Equally at large distances it also fades out. // As we get within 100m of the sprite, it is faded out. Equally at large distances it also fades out.
gl_FrontColor.a = min(smoothstep(10.0, 100.0, fogCoord), 1.0 - smoothstep(15000.0, 20000.0, fogCoord)); gl_FrontColor.a = min(smoothstep(10.0, 100.0, fogCoord), 1.0 - smoothstep(range*0.8, range, fogCoord));
gl_BackColor = gl_FrontColor; gl_BackColor = gl_FrontColor;
// Fog doesn't affect clouds as much as other objects. // Fog doesn't affect clouds as much as other objects.

View file

@ -94,6 +94,13 @@
<command>nasal</command> <command>nasal</command>
<script>file_input()</script> <script>file_input()</script>
</binding> </binding>
<visible>
<equals> <!-- yes, odd condition. easier ways somehow fail,
since we're changing the values with Nasal below... -->
<value>1</value>
<value>1</value>
</equals>
</visible>
</input> </input>
<button> <button>
@ -134,6 +141,9 @@
var path = dlg.getNode("path", 1); var path = dlg.getNode("path", 1);
var dotfiles = dlg.getNode("dotfiles", 1); var dotfiles = dlg.getNode("dotfiles", 1);
dotfiles.setBoolValue(dotfiles.getValue()); dotfiles.setBoolValue(dotfiles.getValue());
# disable files to show a directory dialog only
self.show_files = dlg.getNode("show-files",1).getValue();
self.getNode("group[1]/input/visible/equals/value").setValue(self.show_files);
var kbdctrl = props.globals.getNode("/devices/status/keyboard/ctrl", 1); var kbdctrl = props.globals.getNode("/devices/status/keyboard/ctrl", 1);
var kbdshift = props.globals.getNode("/devices/status/keyboard/shift", 1); var kbdshift = props.globals.getNode("/devices/status/keyboard/shift", 1);
@ -177,7 +187,7 @@
if (stat[11] == "dir") if (stat[11] == "dir")
append(dirs, e ~ "/"); append(dirs, e ~ "/");
elsif (!size(pattern) or matches(e)) elsif (self.show_files and (!size(pattern) or matches(e)))
append(files, e); append(files, e);
} }
@ -239,7 +249,10 @@
var ok = func { var ok = func {
dir_input(); dir_input();
file_input(); if (self.show_files)
file_input();
else
current.file = "";
var p = string.normpath(current.dir ~ "/" ~ current.file); var p = string.normpath(current.dir ~ "/" ~ current.file);
var stat = io.stat(p); var stat = io.stat(p);
path.setValue(stat != nil and stat[11] == "dir" ? p ~ "/" : p); path.setValue(stat != nil and stat[11] == "dir" ? p ~ "/" : p);
@ -254,7 +267,12 @@
var t = title.getValue(); var t = title.getValue();
if (t == nil or t == "") if (t == nil or t == "")
t = "Select File"; {
if (self.show_files)
t = "Select Directory";
else
t = "Select File";
}
self.getNode("group[0]/text/label").setValue(t); self.getNode("group[0]/text/label").setValue(t);
current.dir = (var d = dir.getValue()) != nil and d != "" ? d : getprop("/sim/fg-current"); current.dir = (var d = dir.getValue()) != nil and d != "" ? d : getprop("/sim/fg-current");

View file

@ -6,8 +6,8 @@
<nasal> <nasal>
<open> <open>
p = props.globals.getNode("/sim/gui/dialogs/location-in-air/", 1); var p = props.globals.getNode("/sim/gui/dialogs/location-in-air/", 1);
mode = { var mode = {
airport: p.getNode("airport", 1), airport: p.getNode("airport", 1),
lonlat: p.getNode("lonlat", 1), lonlat: p.getNode("lonlat", 1),
vor: p.getNode("vor", 1), vor: p.getNode("vor", 1),
@ -15,14 +15,14 @@
fix: p.getNode("fix", 1), fix: p.getNode("fix", 1),
}; };
set_radio = func(m) { var set_radio = func(m) {
foreach (k; keys(mode)) { foreach (var k; keys(mode)) {
mode[k].setBoolValue(m == k); mode[k].setBoolValue(m == k);
} }
} }
initialized = 0; var initialized = 0;
foreach (k; keys(mode)) { foreach (var k; keys(mode)) {
if (mode[k].getType() == "NONE") { if (mode[k].getType() == "NONE") {
mode[k].setBoolValue(0); mode[k].setBoolValue(0);
} }
@ -31,6 +31,19 @@
if (!initialized) { if (!initialized) {
set_radio("airport"); set_radio("airport");
} }
var pickNearest = func(type,propname,freqpropname) {
var found = navinfo(type,getprop(propname));
if( found == nil or size(found) == 0 ) {
print(type, " ", getprop(propname), " NOT found");
setprop(propname, "");
setprop(freqpropname, "");
return;
}
setprop(propname, found[0].id);
setprop(freqpropname, found[0].frequency / 100.0);
}
</open> </open>
<close># just kept for educational purposes :-)</close> <close># just kept for educational purposes :-)</close>
@ -300,10 +313,14 @@
if (!mode.vor.getBoolValue()) { if (!mode.vor.getBoolValue()) {
setprop("/sim/presets/vor-id", ""); setprop("/sim/presets/vor-id", "");
} else {
pickNearest("vor","/sim/presets/vor-id","/sim/presets/vor-freq");
} }
if (!mode.ndb.getBoolValue()) { if (!mode.ndb.getBoolValue()) {
setprop("/sim/presets/ndb-id", ""); setprop("/sim/presets/ndb-id", "");
} else {
pickNearest("ndb","/sim/presets/ndb-id","/sim/presets/ndb-freq");
} }
if (!mode.fix.getBoolValue()) { if (!mode.fix.getBoolValue()) {

View file

@ -67,16 +67,23 @@
<row>3</row> <row>3</row>
<col>2</col><colspan>2</colspan> <col>2</col><colspan>2</colspan>
<pref-width>400</pref-width> <pref-width>400</pref-width>
<live>true</live>
<property>/sim/terrasync/scenery-dir</property> <property>/sim/terrasync/scenery-dir</property>
<enable> <enable><false/></enable>
<property>/sim/terrasync/enabled</property>
</enable>
<binding>
<command>dialog-apply</command>
<object-name>scenery-dir</object-name>
</binding>
</input> </input>
<button>
<legend>Change</legend>
<equal>true</equal>
<border>2</border>
<row>3</row>
<col>4</col>
<binding>
<command>nasal</command>
<script>controller.open()</script>
</binding>
</button>
<text> <text>
<row>4</row> <row>4</row>
<col>2</col><colspan>3</colspan> <col>2</col><colspan>3</colspan>
@ -428,4 +435,16 @@
<empty><stretch>true</stretch></empty> <empty><stretch>true</stretch></empty>
</group> </group>
<nasal>
<open><![CDATA[
var controller = gui.DirSelector.new(
func(result) { setprop("/sim/terrasync/scenery-dir", result.getValue()); },
"Select Target Directory for Downloads", "Ok", getprop("/sim/terrasync/scenery-dir"));
]]></open>
<close><![CDATA[
controller.close();
]]></close>
</nasal>
</PropertyList> </PropertyList>

View file

@ -62,6 +62,13 @@
</script> </script>
</binding> </binding>
</item> </item>
<item>
<label>Screenshot Directory</label>
<binding>
<command>nasal</command>
<script>gui.set_screenshotdir()</script>
</binding>
</item>
<!-- <!--
<item> <item>
<label>Last snapshot</label> <label>Last snapshot</label>