From 7bc356008c4cdd7d6b41efe15e818c1c46d81cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sun, 18 Jan 2015 12:42:33 -0300 Subject: [PATCH] fcs: cba keybinds --- addons/fcs/XEH_clientInit.sqf | 73 +++++++++++++++++++++++++++++++++++ addons/fcs/config.cpp | 29 -------------- 2 files changed, 73 insertions(+), 29 deletions(-) diff --git a/addons/fcs/XEH_clientInit.sqf b/addons/fcs/XEH_clientInit.sqf index 527e5a9d36..61b30f65ae 100644 --- a/addons/fcs/XEH_clientInit.sqf +++ b/addons/fcs/XEH_clientInit.sqf @@ -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; diff --git a/addons/fcs/config.cpp b/addons/fcs/config.cpp index 005ef3fd8a..e1e8ac8901 100644 --- a/addons/fcs/config.cpp +++ b/addons/fcs/config.cpp @@ -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;