reload: cba keybinds

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

View File

@ -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 {

View 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;

View File

@ -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"