ACE3/addons/optics/XEH_postInit.sqf
Neviothr abc91f1564 Cleanup (#5463)
Cleanup some configs and array spacing
2017-08-29 17:47:01 -05:00

32 lines
1.2 KiB
Plaintext

// by commy2
#include "script_component.hpp"
if (!hasInterface) exitWith {};
GVAR(camera) = objNull;
// save control for fired EH
["ace_infoDisplayChanged", {
TRACE_1("ace_infoDisplayChanged",_this);
if (!isNull ((_this select 0) displayCtrl 1713001)) then {
uiNamespace setVariable [QGVAR(RscWeaponInfo2D), _this select 0];
};
}] call CBA_fnc_addEventHandler;
// camera has to be re-created every time another camera is created. Otherwise r2t is either black or transparent. @todo Add popular custom cameras to the event in ACE_common.
["ace_activeCameraChanged", {
params ["", "_isfeatureCameraActive"];
TRACE_1("ace_activeCameraChanged",_isfeatureCameraActive);
if (!_isfeatureCameraActive) then {
// Destroy the camera, and it will be re-created in the onDrawScope2d helper
if (!isNull GVAR(camera)) then {
GVAR(camera) cameraEffect ["TERMINATE", "BACK"];
camDestroy GVAR(camera);
TRACE_1("destroying pip camera for restart",GVAR(camera));
};
};
}] call CBA_fnc_addEventHandler;
// Register fire event handler
["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler;