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" #include "initKeybinds.sqf"
GVAR(outputPFH) = -1;
GVAR(run) = false; GVAR(run) = false;
GVAR(hidden) = true;
GVAR(menuRun) = false; GVAR(menuRun) = false;
GVAR(useDegrees) = true; GVAR(useDegrees) = true;
GVAR(updateInterval) = 0.5; GVAR(updateInterval) = 0.5;

View File

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

View File

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

View File

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