overheating: cba keybinds

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

View File

@ -4,6 +4,12 @@ class Extended_PreInit_EventHandlers {
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
};
};
class Extended_FiredBIS_EventHandlers {
class CAManBase {
class GVAR(Overheat) {

View File

@ -0,0 +1,25 @@
// by CAA-Picard
#include "script_component.hpp"
if !(hasInterface) exitWith {};
// Add keybinds
["ACE3",
localize "STR_ACE_Overheating_UnjamWeapon",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
{currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])}
) exitWith {false};
// Statement
[ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam);
true
},
[19, [true, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;

View File

@ -14,18 +14,6 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
class ACE_Default_Keys {
class clearJam {
displayName = "$STR_ACE_Overheating_UnjamWeapon";
condition = QUOTE( [_player] call EFUNC(common,canUseWeapon) && {currentWeapon _player in (_player getVariable [ARR_2(QUOTE(QGVAR(jammedWeapons)), [])])} );
statement = QUOTE( [ARR_3(_player, currentMuzzle _player, false)] call FUNC(clearJam); );
key = 19;
shift = 1;
control = 0;
alt = 0;
};
};
#include "CfgSounds.hpp"
#include "CfgVehicles.hpp"