Sim: add support for spoiler joystick binding
This commit is contained in:
parent
17a12bad59
commit
53527ba0e3
1 changed files with 20 additions and 8 deletions
|
@ -409,18 +409,30 @@ controls.stepSpoilers = func(step) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var deploySpeedbrake = func {
|
var deploySpeedbrake = func {
|
||||||
if (getprop("/controls/flight/speedbrake") < 0.5) {
|
if (getprop("/gear/gear[1]/wow") == 1 or getprop("/gear/gear[2]/wow") == 1) {
|
||||||
setprop("/controls/flight/speedbrake", 0.5);
|
if (getprop("/controls/flight/speedbrake") < 1.0) {
|
||||||
} else if (getprop("/controls/flight/speedbrake") < 1.0) {
|
setprop("/controls/flight/speedbrake", 1.0);
|
||||||
setprop("/controls/flight/speedbrake", 1.0);
|
}
|
||||||
|
} else {
|
||||||
|
if (getprop("/controls/flight/speedbrake") < 0.5) {
|
||||||
|
setprop("/controls/flight/speedbrake", 0.5);
|
||||||
|
} else if (getprop("/controls/flight/speedbrake") < 1.0) {
|
||||||
|
setprop("/controls/flight/speedbrake", 1.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var retractSpeedbrake = func {
|
var retractSpeedbrake = func {
|
||||||
if (getprop("/controls/flight/speedbrake") > 0.5) {
|
if (getprop("/gear/gear[1]/wow") == 1 or getprop("/gear/gear[2]/wow") == 1) {
|
||||||
setprop("/controls/flight/speedbrake", 0.5);
|
if (getprop("/controls/flight/speedbrake") > 0.0) {
|
||||||
} else if (getprop("/controls/flight/speedbrake") > 0.0) {
|
setprop("/controls/flight/speedbrake", 0.0);
|
||||||
setprop("/controls/flight/speedbrake", 0.0);
|
}
|
||||||
|
} else {
|
||||||
|
if (getprop("/controls/flight/speedbrake") > 0.5) {
|
||||||
|
setprop("/controls/flight/speedbrake", 0.5);
|
||||||
|
} else if (getprop("/controls/flight/speedbrake") > 0.0) {
|
||||||
|
setprop("/controls/flight/speedbrake", 0.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue