Files
braf/braf_optics_air/braf_fnc/fn_initRSC.sqf
T

39 lines
915 B
Plaintext

/*
Author: Brazilian Armed Forces
File: fn_initRSC.sqf
Purpose:
- Create and manage the EachFrame loop that updates the generic air FLIR optics
*/
disableSerialization;
params ["_display"];
if (isNil "BRAF_fnc_flirControls") then {
systemChat "[BRAF FLIR] WARNING: BRAF_fnc_flirControls is not loaded.";
};
uiNamespace setVariable ["BRAF_FLIR_UI_Display", _display];
[] call BRAF_fnc_shutdownRSC;
private _pfh = addMissionEventHandler ["EachFrame", {
if (cameraView != "GUNNER") exitWith {};
private _display = uiNamespace getVariable ["BRAF_FLIR_UI_Display", displayNull];
if (isNull _display) exitWith {
[] call BRAF_fnc_shutdownRSC;
};
private _veh = vehicle player;
if (isNull _veh) exitWith {
[] call BRAF_fnc_shutdownRSC;
};
[_display] call BRAF_fnc_flirControls;
}];
uiNamespace setVariable ["BRAF_FLIR_PFH_eachFrame", _pfh];