Fix Vector/FCS debounce

This commit is contained in:
PabstMirror 2015-03-05 02:46:24 -06:00
parent e18cbbfaad
commit 5d21cd6cc7
2 changed files with 21 additions and 3 deletions

View File

@ -8,12 +8,18 @@
// Conditions: specific
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
GVAR(isDownStateKey1) = true;
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown);
// Return false so it doesn't block the rest weapon action
false
},
{
// prevent holding down
GVAR(isDownStateKey1) = false;
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};

View File

@ -2,19 +2,24 @@
["ACE3", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey",
{
systemChat format ["Down %1", diag_tickTime];
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false};
// prevent holding down
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
GVAR(isDownStateKey1) = true;
// Statement
["azimuth"] call FUNC(onKeyDown);
true
},
{
systemChat format ["Up %1", diag_tickTime];
// prevent holding down
GVAR(isDownStateKey1) = false;
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
@ -34,11 +39,18 @@
// Conditions: specific
if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false};
// prevent holding down
if (GETGVAR(isDownStateKey2,false)) exitWith {false};
GVAR(isDownStateKey2) = true;
// Statement
["distance"] call FUNC(onKeyDown);
true
},
{
// prevent holding down
GVAR(isDownStateKey2) = false;
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
@ -47,4 +59,4 @@
["distance"] call FUNC(onKeyUp);
true
},
[19, [false, false, false]], false] call CBA_fnc_registerKeybind; //R Key
[19, [false, false, false]], false] call CBA_fnc_addKeybind; //R Key