ACE3/addons/dagr/functions/fnc_toggleOverlay.sqf

57 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

#include "..\script_component.hpp"
2015-06-07 15:53:37 +00:00
/*
* Author: Rosuto, Ruthberg
* Toggles the DAGR overlay
*
* Arguments:
* None
2015-06-07 15:53:37 +00:00
*
* Return Value:
* None
2015-06-07 15:53:37 +00:00
*
* Example:
* call ace_dagr_fnc_toggleOverlay
2015-06-07 15:53:37 +00:00
*
* Public: No
*/
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;
};