1
0
Fork 0

- replace resetFOV() with view.resetFOV()

- make F1/F2 repeatable again, just don't repeat brake commands
This commit is contained in:
mfranz 2006-03-02 17:05:45 +00:00
parent e8f6224875
commit 5672fdd382

View file

@ -106,14 +106,10 @@ ________________________________________________________________________________
mode = data.getNode("mode"); mode = data.getNode("mode");
modifier = data.getNode("modifier"); modifier = data.getNode("modifier");
f1 = f2 = 0; f1 = f2 = 0;
left_brake = right_brake = 0;
get_mode = func { modifier.getValue() + mode.getValue() * 4 } get_mode = func { modifier.getValue() + mode.getValue() * 4 }
resetFOV = func {
setprop("/sim/current-view/field-of-view",
getprop("/sim/current-view/config/default-field-of-view-deg"));
}
harrier = func { harrier = func {
if (getprop("/sim/aero") == "harrier") { if (getprop("/sim/aero") == "harrier") {
thv = getprop("/controls/engines/engine[0]/mixture"); thv = getprop("/controls/engines/engine[0]/mixture");
@ -315,18 +311,20 @@ ________________________________________________________________________________
<button n="4"><!-- F1 --> <button n="4"><!-- F1 -->
<desc>Brakes left</desc> <desc>Brakes left</desc>
<repeatable type="bool">false</repeatable> <repeatable type="bool">true</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
f1 = 1; f1 = 1;
m = get_mode(); m = get_mode();
if (m == 0) { if (m == 0) {
controls.applyBrakes(1, -1); if (!left_brake) {
controls.applyBrakes(left_brake = 1, -1);
}
} elsif (m == 1) { } elsif (m == 1) {
# #
} elsif (m == 2) { } elsif (m == 2) {
f2 ? resetFOV() : view.increase(); f2 ? view.resetFOV() : view.increase();
} elsif (m == 3) { } elsif (m == 3) {
# #
} }
@ -339,11 +337,11 @@ ________________________________________________________________________________
f1 = 0; f1 = 0;
m = get_mode(); m = get_mode();
if (m == 0) { if (m == 0) {
controls.applyBrakes(0, -1); controls.applyBrakes(left_brake = 0, -1);
} elsif (m == 1) { } elsif (m == 1) {
# #
} elsif (m == 2) { } elsif (m == 2) {
# vlp = nil;
} elsif (m == 3) { } elsif (m == 3) {
# #
} }
@ -354,18 +352,20 @@ ________________________________________________________________________________
<button n="5"><!-- F2 --> <button n="5"><!-- F2 -->
<desc>Brakes right</desc> <desc>Brakes right</desc>
<repeatable type="bool">false</repeatable> <repeatable type="bool">true</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
f2 = 1; f2 = 1;
m = get_mode(); m = get_mode();
if (m == 0) { if (m == 0) {
controls.applyBrakes(1, 1); if (!right_brake) {
controls.applyBrakes(right_brake = 1, 1);
}
} elsif (m == 1) { } elsif (m == 1) {
# #
} elsif (m == 2) { } elsif (m == 2) {
f1 ? resetFOV() : view.decrease(); f1 ? view.resetFOV() : view.decrease();
} elsif (m == 3) { } elsif (m == 3) {
# #
} }
@ -378,11 +378,11 @@ ________________________________________________________________________________
f2 = 0; f2 = 0;
m = get_mode(); m = get_mode();
if (m == 0) { if (m == 0) {
controls.applyBrakes(0, 1); controls.applyBrakes(right_brake = 0, 1);
} elsif (m == 1) { } elsif (m == 1) {
# #
} elsif (m == 2) { } elsif (m == 2) {
# vlp = nil;
} elsif (m == 3) { } elsif (m == 3) {
# #
} }