Merge branch 'work' of D:\Git_New\fgdata
This commit is contained in:
commit
3ca2539064
13 changed files with 526 additions and 306 deletions
|
@ -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>
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -242,6 +242,30 @@ Started October 23 2001 by John Check, fgpanels@rockfish.net
|
||||||
|
|
||||||
<input>
|
<input>
|
||||||
<keyboard>
|
<keyboard>
|
||||||
|
<key n="76">
|
||||||
|
<name>L</name>
|
||||||
|
<desc>Decrease Panel lighting</desc>
|
||||||
|
<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="108">
|
||||||
|
<name>l</name>
|
||||||
|
<desc>Increase Panel lighting</desc>
|
||||||
|
<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">
|
<key n="115">
|
||||||
<name>s</name>
|
<name>s</name>
|
||||||
<desc>Toggle Starter Switch</desc>
|
<desc>Toggle Starter Switch</desc>
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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>
|
||||||
|
|
58
Input/Joysticks/Saitek/Pro-Flight-Combat-Rudder-Pedals.xml
Normal file
58
Input/Joysticks/Saitek/Pro-Flight-Combat-Rudder-Pedals.xml
Normal 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>
|
|
@ -33,22 +33,34 @@
|
||||||
<script>controls.throttleAxis()</script>
|
<script>controls.throttleAxis()</script>
|
||||||
</binding>
|
</binding>
|
||||||
</axis>
|
</axis>
|
||||||
<axis n="3">
|
<axis>
|
||||||
|
<number>
|
||||||
|
<unix>3</unix>
|
||||||
|
<windows>4</windows>
|
||||||
|
</number>
|
||||||
<desc>Prop Pitch</desc>
|
<desc>Prop Pitch</desc>
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>controls.propellerAxis()</script>
|
<script>controls.propellerAxis()</script>
|
||||||
</binding>
|
</binding>
|
||||||
</axis>
|
</axis>
|
||||||
<axis n="4">
|
<axis>
|
||||||
|
<number>
|
||||||
|
<unix>4</unix>
|
||||||
|
<windows>3</windows>
|
||||||
|
</number>
|
||||||
<desc>Mixture</desc>
|
<desc>Mixture</desc>
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>controls.mixtureAxis()</script>
|
<script>controls.mixtureAxis()</script>
|
||||||
</binding>
|
</binding>
|
||||||
</axis>
|
</axis>
|
||||||
|
<!-- Coolie Hat -->
|
||||||
<axis n="5">
|
<axis>
|
||||||
|
<number>
|
||||||
|
<unix>5</unix>
|
||||||
|
<windows>6</windows>
|
||||||
|
</number>
|
||||||
<desc>View Direction</desc>
|
<desc>View Direction</desc>
|
||||||
<low>
|
<low>
|
||||||
<repeatable>true</repeatable>
|
<repeatable>true</repeatable>
|
||||||
|
@ -67,8 +79,10 @@
|
||||||
</binding>
|
</binding>
|
||||||
</high>
|
</high>
|
||||||
</axis>
|
</axis>
|
||||||
|
<axis>
|
||||||
<axis n="6">
|
<number>
|
||||||
|
<unix>6</unix>
|
||||||
|
</number>
|
||||||
<desc>View Elevation</desc>
|
<desc>View Elevation</desc>
|
||||||
<low>
|
<low>
|
||||||
<repeatable>true</repeatable>
|
<repeatable>true</repeatable>
|
||||||
|
@ -87,6 +101,28 @@
|
||||||
</binding>
|
</binding>
|
||||||
</high>
|
</high>
|
||||||
</axis>
|
</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 -->
|
<!-- Buttons on the Yoke -->
|
||||||
<button n="0">
|
<button n="0">
|
||||||
<desc>Cycle View</desc>
|
<desc>Cycle View</desc>
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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,11 +42,14 @@ 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
|
||||||
|
@ -52,6 +57,7 @@ void main(void)
|
||||||
|
|
||||||
// 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;
|
||||||
|
|
||||||
|
@ -59,7 +65,7 @@ void main(void)
|
||||||
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.
|
||||||
|
|
|
@ -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();
|
||||||
|
if (self.show_files)
|
||||||
file_input();
|
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 == "")
|
||||||
|
{
|
||||||
|
if (self.show_files)
|
||||||
|
t = "Select Directory";
|
||||||
|
else
|
||||||
t = "Select File";
|
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");
|
||||||
|
|
|
@ -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()) {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue