1
0
Fork 0

add controls.gearToggle() convenience function; adapt all joystick files

to new controls function
This commit is contained in:
mfranz 2005-06-16 07:59:33 +00:00
parent 7cc31829a3
commit f4a90a615e
8 changed files with 19 additions and 23 deletions

View file

@ -208,18 +208,16 @@
<button n="4">
<repeatable>false</repeatable>
<binding>
<command>property-assign</command>
<property>/controls/gear/gear-down</property>
<value>false</value>
<command>nasal</command>
<script>controls.gearDown(0)</script>
</binding>
</button>
<button n="5">
<repeatable>false</repeatable>
<binding>
<command>property-assign</command>
<property>/controls/gear/gear-down</property>
<value>true</value>
<command>nasal</command>
<script>controls.gearDown(1)</script>
</binding>
</button>

View file

@ -21,7 +21,7 @@
* Button 5: flap down Button A 0010
* Button 6: left brake only Button C 0040
* Button 7: right brake only Button D 0080
* Button 8(Unix)/9(Win): gear up Shift Button 0100(unix), 0200(Win)
* Button 8(Unix)/9(Win): gear toggle Shift Button 0100(unix), 0200(Win)
************************************************************************
$Id$
-->
@ -257,7 +257,7 @@ $Id$
</button>
<button>
<desc>Gear Up.</desc>
<desc>Gear Toggle.</desc>
<number>
<unix>8</unix>
<mac>8</mac>
@ -265,11 +265,9 @@ $Id$
</number>
<repeatable>false</repeatable>
<binding>
<command>property-assign</command>
<property>/controls/gear/gear-down</property>
<value type="double">0.0</value>
<command>nasal</command>
<script>controls.gearToggle()</script>
</binding>
</button>
</PropertyList>

View file

@ -288,7 +288,7 @@ axis 5: (hat up-down) look u/d Trim Elevator Adj Propeller #
if (mod == nil or mod == 0) {
controls.stepFlaps(-1);
} elsif (mod == 1) {
setprop("/controls/gear/gear-down", 0);
controls.gearDown(0);
} elsif (mod == 2) {
view.increase();
} elsif (mod == 3) {
@ -309,7 +309,7 @@ axis 5: (hat up-down) look u/d Trim Elevator Adj Propeller #
if (mod == nil or mod == 0) {
controls.stepFlaps(1);
} elsif (mod == 1) {
setprop("/controls/gear/gear-down", 1);
controls.gearDown(1);
} elsif (mod == 2) {
view.decrease();
} elsif (mod == 3) {

View file

@ -237,7 +237,7 @@ ________________________________________________________________________________
if (mod == 0) {
controls.stepFlaps(-1);
} elsif (mod == 1) {
setprop("/controls/gear/gear-down", 0);
controls.gearDown(0);
} elsif (mod == 2) {
view.stepView(-1);
} elsif (mod == 3) {
@ -282,7 +282,7 @@ ________________________________________________________________________________
if (mod == 0) {
controls.stepFlaps(1);
} elsif (mod == 1) {
setprop("/controls/gear/gear-down", 1);
controls.gearDown(1);
} elsif (mod == 2) {
view.stepView(1);
} elsif (mod == 3) {

View file

@ -227,8 +227,8 @@ $Id$
<button n="1">
<desc>Landing Gear Up/Down Toggle</desc>
<binding>
<command>property-toggle</command>
<property>/controls/gear/gear-down</property>
<command>nasal</command>
<script>controls.gearToggle()</script>
</binding>
</button>

View file

@ -271,7 +271,7 @@ ________________________________________________________________________________
if (mod == nil or mod == 0) {
controls.stepFlaps(-1);
} elsif (mod == 1) {
setprop("/controls/gear/gear-down", 0);
controls.gearDown(0);
} elsif (mod == 2) {
view.stepView(-1);
} elsif (mod == 3) {
@ -320,7 +320,7 @@ ________________________________________________________________________________
if (mod == nil or mod == 0) {
controls.stepFlaps(1);
} elsif (mod == 1) {
setprop("/controls/gear/gear-down", 1);
controls.gearDown(1);
} elsif (mod == 2) {
view.stepView(1);
} elsif (mod == 3) {

View file

@ -128,9 +128,8 @@
<button n="2">
<repeatable>false</repeatable>
<binding>
<command>property-assign</command>
<property>/controls/gear/gear-down</property>
<value>true</value>
<command>nasal</command>
<script>controls.gearToggle()</script>
</binding>
</button>

View file

@ -315,3 +315,4 @@ aileronTrimAxis = func { aileronTrim(cmdarg().getNode("value").getValue()); }
rudderTrimAxis = func { rudderTrim(cmdarg().getNode("value").getValue()); }
gearDown = func { setprop("/controls/gear/gear-down", arg[0]); }
gearToggle = func { gearDown(!getprop("/controls/gear/gear-down")); }