fcs: cba keybinds

This commit is contained in:
Nicolás Badano 2015-01-18 12:42:33 -03:00
parent 84fd6de793
commit 7bc356008c
2 changed files with 73 additions and 29 deletions

View File

@ -3,3 +3,76 @@
GVAR(enabled) = True;
GVAR(time) = 0;
GVAR(position) = [0,0,0];
// Add keybinds
["ACE3",
localize "STR_ACE_FCS_LaseTarget",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(!GVAR(enabled) && {call FUNC(canUseRangefinder) || FUNC(canUseFCS)}) exitWith {false};
// Statement
[vehicle ACE_player] call FUNC(keyDown);
true
},
[15, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_FCS_LaseTarget",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false};
// Statement
[vehicle ACE_player] call FUNC(keyUp);
true
},
[15, [false, false, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_FCS_AdjustRangeUp",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
// Statement
[vehicle ACE_player, 50] call FUNC(adjustRange);
true
},
[201, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_FCS_AdjustRangeDown",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
// Statement
[vehicle ACE_player, -50] call FUNC(adjustRange);
true
},
[209, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;

View File

@ -14,35 +14,6 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
class ACE_Default_Keys {
class laseTarget {
displayName = $STR_ACE_FCS_LaseTarget;
condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS));
statement = QUOTE([_vehicle] call FUNC(keyDown));
conditionUp = QUOTE(GVAR(enabled) && FUNC(canUseFCS));
statementUp = QUOTE([_vehicle] call FUNC(keyUp));
key = 15;
shift = 0;
control = 0;
alt = 0;
};
class adjustRangeUp {
displayName = $STR_ACE_FCS_AdjustRangeUp;
condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS));
statement = QUOTE([_vehicle, 50] call FUNC(adjustRange));
key = 201;
shift = 0;
control = 0;
alt = 0;
allowHolding = 1;
};
class adjustRangeDown: adjustRangeUp {
displayName = $STR_ACE_FCS_AdjustRangeDown;
statement = QUOTE([_vehicle, -50] call FUNC(adjustRange));
key = 209;
};
};
class CfgVehicles {
class All {
class Turrets;