2015-04-03 10:33:12 +00:00
|
|
|
// by commy2
|
|
|
|
#include "script_component.hpp"
|
2015-04-03 20:30:29 +00:00
|
|
|
|
2015-04-04 10:06:20 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
2015-04-03 20:30:29 +00:00
|
|
|
|
2015-08-30 17:05:35 +00:00
|
|
|
GVAR(camera) = objNull;
|
2015-08-30 13:50:51 +00:00
|
|
|
|
2015-04-04 04:19:19 +00:00
|
|
|
// save control for fired EH
|
2016-05-24 13:13:11 +00:00
|
|
|
["ace_infoDisplayChanged", {
|
2016-06-12 04:08:55 +00:00
|
|
|
TRACE_1("ace_infoDisplayChanged",_this);
|
2015-04-04 04:19:19 +00:00
|
|
|
if (!isNull ((_this select 0) displayCtrl 1713001)) then {
|
2015-04-04 10:06:20 +00:00
|
|
|
uiNamespace setVariable [QGVAR(RscWeaponInfo2D), _this select 0];
|
2015-04-04 04:19:19 +00:00
|
|
|
};
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-04-18 22:05:54 +00:00
|
|
|
|
2018-10-12 12:59:40 +00:00
|
|
|
// camera has to be re-created every time another camera is created. Otherwise r2t is either black or transparent..
|
|
|
|
["featureCamera", {
|
|
|
|
params ["_player", "_featureCamera"];
|
|
|
|
TRACE_1("featureCamera",_featureCamera);
|
|
|
|
if (_featureCamera isEqualTo "") then {
|
2017-08-29 22:47:01 +00:00
|
|
|
// Destroy the camera, and it will be re-created in the onDrawScope2d helper
|
2016-06-12 04:08:55 +00:00
|
|
|
if (!isNull GVAR(camera)) then {
|
|
|
|
GVAR(camera) cameraEffect ["TERMINATE", "BACK"];
|
|
|
|
camDestroy GVAR(camera);
|
|
|
|
TRACE_1("destroying pip camera for restart",GVAR(camera));
|
|
|
|
};
|
2015-04-18 22:05:54 +00:00
|
|
|
};
|
2018-10-12 12:59:40 +00:00
|
|
|
}] call CBA_fnc_addPlayerEventHandler;
|
2016-02-06 20:50:35 +00:00
|
|
|
|
|
|
|
// Register fire event handler
|
2024-03-28 18:57:23 +00:00
|
|
|
["ace_firedPlayer", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler;
|