DAGR overlay auto hide

This commit is contained in:
ulteq 2015-06-12 18:23:01 +02:00
parent f84a936d95
commit 9130546c8c
4 changed files with 35 additions and 16 deletions

View File

@ -2,7 +2,10 @@
#include "initKeybinds.sqf"
GVAR(outputPFH) = -1;
GVAR(run) = false;
GVAR(hidden) = true;
GVAR(menuRun) = false;
GVAR(useDegrees) = true;
GVAR(updateInterval) = 0.5;

View File

@ -27,11 +27,14 @@
__background ctrlSetText QUOTE(PATHTOF(UI\dagr_gps.paa));
[{
if (GVAR(outputPFH) != -1) exitWith {};
GVAR(outputPFH) = [{
private ["_pos", "_mapSize", "_gridConfig", "_offsetX", "_offsetY", "_stepX", "_stepY", "_xgrid", "_ygrid", "_xcoord", "_ycoord", "_speed", "_dagrHeading", "_dagrGrid", "_dagrElevation", "_dagrSpeed", "_dagrTime", "_elevation"];
// Abort Condition
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
GVAR(outputPFH) = -1;
135471 cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler;
};

View File

@ -27,11 +27,14 @@
__background ctrlSetText QUOTE(PATHTOF(UI\dagr_wp.paa));
[{
if (GVAR(outputPFH) != -1) exitWith {};
GVAR(outputPFH) = [{
private ["_pos", "_mapSize", "_gridConfig", "_offsetX", "_offsetY", "_stepX", "_stepY", "_xGrid", "_yGrid", "_xCoord", "_yCoord", "_dagrHeading", "_dagrGrid", "_bearing", "_MYpos", "_WPpos", "_dagrDistance", "_distance"];
// Abort Condition
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
GVAR(outputPFH) = -1;
135471 cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler;
};

View File

@ -14,27 +14,37 @@
*/
#include "script_component.hpp"
if (cameraView == "GUNNER") exitWith {};
GVAR(run) = !GVAR(run);
if (GVAR(run)) then {
switch (toUpper GVAR(displaySelection)) do {
case "WP" : {
call FUNC(outputWP);
};
case "VECTOR" : {
call FUNC(outputVector);
};
case "DATA" : {
call FUNC(outputData);
};
};
GVAR(hidden) = true;
[{
EXPLODE_1_PVT(_this select 0,_vehicle);
if (!GVAR(run) || (!alive ACE_player) || (cameraView == "GUNNER") || (vehicle ACE_player != _vehicle)) exitWith {
if (!GVAR(run) || (!alive ACE_player) || (vehicle ACE_player != _vehicle)) exitWith {
GVAR(run) = false;
135471 cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
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);
};
};
};
};
}, 0.1, [vehicle ACE_player]] call CBA_fnc_addPerFrameHandler;
};