ACE3/addons/dagr/functions/fnc_toggleOverlay.sqf

56 lines
1.4 KiB
Plaintext
Raw Normal View History

2015-06-07 15:53:37 +00:00
/*
* Author: Rosuto, Ruthberg
* Toggles the DAGR overlay
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
*
* Public: No
*/
#include "script_component.hpp"
GVAR(run) = !GVAR(run);
2015-06-07 15:53:37 +00:00
if (GVAR(run)) then {
if (GVAR(menuRun) && dialog) then {
GVAR(menuRun) = false;
closeDialog 0;
};
2015-06-12 16:23:01 +00:00
GVAR(hidden) = true;
2015-06-07 15:53:37 +00:00
[{
2015-08-09 00:33:00 +00:00
params ["_args", "_idPFH"];
_args params ["_vehicle"];
2015-06-12 16:23:01 +00:00
if (!GVAR(run) || (!alive ACE_player) || (vehicle ACE_player != _vehicle)) exitWith {
GVAR(run) = false;
2015-06-07 15:53:37 +00:00
135471 cutText ["", "PLAIN"];
2015-08-09 00:33:00 +00:00
[_idPFH] call CBA_fnc_removePerFrameHandler;
2015-06-07 15:53:37 +00:00
};
2015-06-12 16:23:01 +00:00
if (cameraView == "GUNNER") then {
if (!GVAR(hidden)) then {
GVAR(hidden) = true;
135471 cutText ["", "PLAIN"];
};
} else {
if (GVAR(hidden)) then {
GVAR(hidden) = false;
switch (toUpper GVAR(displaySelection)) do {
case "WP" : {
call FUNC(outputWP);
};
case "VECTOR" : {
call FUNC(outputVector);
};
case "DATA" : {
call FUNC(outputData);
};
};
};
};
2015-06-07 15:53:37 +00:00
}, 0.1, [vehicle ACE_player]] call CBA_fnc_addPerFrameHandler;
};