mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
resting: cba keybinds
This commit is contained in:
parent
dc8c5758f1
commit
9ed9dc916b
@ -4,3 +4,9 @@ class Extended_PreInit_EventHandlers {
|
|||||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Extended_PostInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
|
||||||
|
};
|
||||||
|
};
|
||||||
|
26
addons/resting/XEH_postInit.sqf
Normal file
26
addons/resting/XEH_postInit.sqf
Normal 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;
|
@ -14,18 +14,6 @@ class CfgPatches {
|
|||||||
|
|
||||||
#include "CfgEventHandlers.hpp"
|
#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 "CfgWeapons.hpp"
|
||||||
|
|
||||||
#include "CfgMoves.hpp"
|
#include "CfgMoves.hpp"
|
||||||
|
Loading…
Reference in New Issue
Block a user