2016-05-30 16:37:03 +00:00
|
|
|
//#define DEBUG_MODE_FULL
|
|
|
|
#include "script_component.hpp"
|
|
|
|
TRACE_1("enter", _this);
|
|
|
|
|
2016-07-06 01:58:32 +00:00
|
|
|
#define __LOCKONTIMERANDOM 1 // Deviation in lock on time
|
2016-05-30 16:37:03 +00:00
|
|
|
|
|
|
|
if((count _this) > 0) then {
|
|
|
|
uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0];
|
|
|
|
};
|
|
|
|
|
2016-07-06 01:58:32 +00:00
|
|
|
private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player};
|
|
|
|
TRACE_2("shooter",_currentShooter,typeOf _currentShooter);
|
|
|
|
_currentShooter setVariable ["ace_missileguidance_target", nil, false];
|
2016-05-30 16:37:03 +00:00
|
|
|
|
|
|
|
__JavelinIGUISeek ctrlSetTextColor __ColorGray;
|
|
|
|
__JavelinIGUINFOV ctrlSetTextColor __ColorGray;
|
|
|
|
|
|
|
|
__JavelinIGUITargeting ctrlShow false;
|
|
|
|
__JavelinIGUITargetingConstrains ctrlShow false;
|
|
|
|
__JavelinIGUITargetingGate ctrlShow false;
|
|
|
|
__JavelinIGUITargetingLines ctrlShow false;
|
|
|
|
|
|
|
|
if(GVAR(pfehID) != -1) then {
|
|
|
|
[] call FUNC(onOpticUnload); // Unload optic if it was already loaded
|
|
|
|
};
|
|
|
|
|
|
|
|
uiNameSpace setVariable [QGVAR(arguments),
|
|
|
|
[
|
2016-06-02 15:02:09 +00:00
|
|
|
diag_tickTime, // Last runtime
|
2016-05-30 16:37:03 +00:00
|
|
|
objNull, // currentTargetObject
|
|
|
|
0, // Run Time
|
|
|
|
0, // Lock Time
|
|
|
|
0, // Sound timer
|
|
|
|
(random __LOCKONTIMERANDOM), // random lock time addition
|
|
|
|
-1
|
|
|
|
]
|
|
|
|
];
|
|
|
|
|
|
|
|
GVAR(pfehID) = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler;
|