resting: cba keybinds

This commit is contained in:
Nicolás Badano 2015-01-18 17:05:17 -03:00
parent dc8c5758f1
commit 9ed9dc916b
3 changed files with 32 additions and 12 deletions

View File

@ -4,3 +4,9 @@ class Extended_PreInit_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
};
};

View File

@ -0,0 +1,26 @@
// by CAA-Picard
#include "script_component.hpp"
if !(hasInterface) exitWith {};
// Add keybinds
["ACE3",
localize "STR_ACE_Resting_RestWeapon",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
{inputAction 'reloadMagazine' == 0} &&
{!weaponLowered ACE_player} &&
{speed ACE_player < 1}) exitWith {false};
// Statement
[ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon);
true
},
[15, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;

View File

@ -14,18 +14,6 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
class ACE_Default_Keys {
class restWeapon {
displayName = "$STR_ACE_Resting_RestWeapon";
condition = QUOTE([_player] call EFUNC(common,canUseWeapon) && {inputAction 'reloadMagazine' == 0} && {!weaponLowered _player} && {speed _player < 1});
statement = QUOTE([ARR_3(_player, _vehicle, currentWeapon _player)] call FUNC(restWeapon));
key = 15;
shift = 0;
control = 0;
alt = 0;
};
};
#include "CfgWeapons.hpp"
#include "CfgMoves.hpp"