2016-05-30 16:37:03 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
ADDON = false;
|
|
|
|
|
2016-11-23 19:35:25 +00:00
|
|
|
PREP_RECOMPILE_START;
|
2016-05-30 16:37:03 +00:00
|
|
|
#include "XEH_PREP.hpp"
|
2016-11-23 19:35:25 +00:00
|
|
|
PREP_RECOMPILE_END;
|
2016-05-30 16:37:03 +00:00
|
|
|
|
|
|
|
GVAR(isLockKeyDown) = false;
|
|
|
|
GVAR(pfehID) = -1;
|
|
|
|
|
2016-08-11 18:30:28 +00:00
|
|
|
DFUNC(disableFire) = {
|
|
|
|
params ["_firedEH"];
|
|
|
|
|
2016-11-15 18:15:25 +00:00
|
|
|
if (_firedEH < 0 && {difficulty > 0}) then {
|
2016-08-11 18:30:28 +00:00
|
|
|
_firedEH = [ACE_player, "DefaultAction", {true}, {
|
2016-11-15 18:15:25 +00:00
|
|
|
private _canFire = (_this select 1) getVariable ["ace_missileguidance_target", nil];
|
|
|
|
if (!isNil "_canFire") exitWith { false };
|
2016-08-11 18:30:28 +00:00
|
|
|
true
|
|
|
|
}] call EFUNC(common,addActionEventHandler);
|
2016-11-15 18:15:25 +00:00
|
|
|
TRACE_1("Locking Fire Button",_firedEH);
|
2016-08-11 18:30:28 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
_firedEH
|
|
|
|
};
|
|
|
|
DFUNC(enableFire) = {
|
|
|
|
params ["_firedEH"];
|
|
|
|
|
2016-11-15 18:15:25 +00:00
|
|
|
if (_firedEH >= 0 && {difficulty > 0}) then {
|
|
|
|
TRACE_1("Unlocking Fire Button",_firedEH);
|
2016-08-11 18:30:28 +00:00
|
|
|
[ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler);
|
|
|
|
};
|
|
|
|
-1
|
|
|
|
};
|
|
|
|
|
2016-05-30 16:37:03 +00:00
|
|
|
ADDON = true;
|