mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
reload: cba keybinds
This commit is contained in:
parent
9ed9dc916b
commit
5a77e2c220
@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers {
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Take_EventHandlers {
|
||||
class CAManBase {
|
||||
class ACE_AmmoIndicatorReload {
|
||||
|
24
addons/reload/XEH_postInit.sqf
Normal file
24
addons/reload/XEH_postInit.sqf
Normal file
@ -0,0 +1,24 @@
|
||||
// by CAA-Picard
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(hasInterface) exitWith {};
|
||||
|
||||
// Add keybinds
|
||||
["ACE3",
|
||||
localize "STR_ACE_Reload_checkAmmo",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
_exceptions = [];
|
||||
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !([ACE_player] call EFUNC(common,canUseWeapon) ||
|
||||
{(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[ACE_player, vehicle ACE_player, false] call FUNC(checkAmmo);
|
||||
true
|
||||
},
|
||||
[19, [false, true, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
@ -13,18 +13,7 @@ class CfgPatches {
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
#include "CfgActions.hpp"
|
||||
|
||||
class ACE_Default_Keys {
|
||||
class checkAmmo {
|
||||
displayName = "$STR_ACE_Reload_checkAmmo";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon) || {_vehicle isKindOf 'StaticWeapon'});
|
||||
statement = QUOTE([ARR_3(_player, _vehicle, false)] call FUNC(checkAmmo););
|
||||
key = 19;
|
||||
shift = 0;
|
||||
control = 1;
|
||||
alt = 0;
|
||||
};
|
||||
};
|
||||
|
||||
#include "RscInGameUI.hpp"
|
||||
|
Loading…
Reference in New Issue
Block a user