From dc8c5758f1baae01a3c743371bc7c3af4a07fd29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sun, 18 Jan 2015 17:01:18 -0300 Subject: [PATCH] scopes: cba keybinds --- addons/safemode/XEH_postInit.sqf | 23 +++++++++++++++++++++-- addons/safemode/config.cpp | 13 ------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index 94e6b789bd..8a19780e9c 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -1,5 +1,24 @@ - -// by commy2 +// by CAA-Picard //["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" + + +// Add keybinds +["ACE3", + localize "STR_ACE_SafeMode_SafeMode", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); + true + }, + [41, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/safemode/config.cpp b/addons/safemode/config.cpp index d61a386e20..8371e7f35f 100644 --- a/addons/safemode/config.cpp +++ b/addons/safemode/config.cpp @@ -13,16 +13,3 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" - -class ACE_Default_Keys { - class safeWeapon { - displayName = "$STR_ACE_SafeMode_SafeMode"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([ARR_3(_player, currentWeapon _player, currentMuzzle _player)] call FUNC(lockSafety)); - exceptions[] = {"ACE_interaction_isNotEscorting"}; - key = 41; - shift = 0; - control = 1; - alt = 0; - }; -};