ACE3/addons/javelin/XEH_preInit.sqf
PabstMirror b4315b6a65 Javelin overhaul (#4580)
* Javelin overhaul

* header spelling fix
2016-11-15 12:15:25 -06:00

35 lines
849 B
Plaintext

#include "script_component.hpp"
ADDON = false;
#include "XEH_PREP.hpp"
GVAR(isLockKeyDown) = false;
GVAR(pfehID) = -1;
DFUNC(disableFire) = {
params ["_firedEH"];
if (_firedEH < 0 && {difficulty > 0}) then {
_firedEH = [ACE_player, "DefaultAction", {true}, {
private _canFire = (_this select 1) getVariable ["ace_missileguidance_target", nil];
if (!isNil "_canFire") exitWith { false };
true
}] call EFUNC(common,addActionEventHandler);
TRACE_1("Locking Fire Button",_firedEH);
};
_firedEH
};
DFUNC(enableFire) = {
params ["_firedEH"];
if (_firedEH >= 0 && {difficulty > 0}) then {
TRACE_1("Unlocking Fire Button",_firedEH);
[ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler);
};
-1
};
ADDON = true;