mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
415d2f685c
FUNC -> LINKFUNC
32 lines
1.1 KiB
Plaintext
32 lines
1.1 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..
|
|
["featureCamera", {
|
|
params ["_player", "_featureCamera"];
|
|
TRACE_1("featureCamera",_featureCamera);
|
|
if (_featureCamera isEqualTo "") 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_addPlayerEventHandler;
|
|
|
|
// Register fire event handler
|
|
["ace_firedPlayer", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler;
|