2015-06-07 15:53:37 +00:00
|
|
|
|
/*
|
|
|
|
|
* Author: Rosuto
|
|
|
|
|
* DAGR data output loop
|
|
|
|
|
*
|
|
|
|
|
* Arguments:
|
2017-06-08 13:31:51 +00:00
|
|
|
|
* None
|
2015-06-07 15:53:37 +00:00
|
|
|
|
*
|
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
|
* None
|
2015-06-07 15:53:37 +00:00
|
|
|
|
*
|
|
|
|
|
* Example:
|
2017-06-08 13:31:51 +00:00
|
|
|
|
* call ace_dagr_fnc_outputData
|
2015-06-07 15:53:37 +00:00
|
|
|
|
*
|
|
|
|
|
* Public: No
|
|
|
|
|
*/
|
2015-06-08 10:57:16 +00:00
|
|
|
|
#include "script_component.hpp"
|
2015-06-07 15:53:37 +00:00
|
|
|
|
|
|
|
|
|
135471 cutRsc ["DAGR_DISPLAY", "plain down"];
|
|
|
|
|
|
2015-06-08 10:57:16 +00:00
|
|
|
|
#define __display (uiNameSpace getVariable "DAGR_DISPLAY")
|
2015-06-07 15:53:37 +00:00
|
|
|
|
|
2015-06-08 10:57:16 +00:00
|
|
|
|
#define __gridControl (__display displayCtrl 266851)
|
|
|
|
|
#define __speedControl (__display displayCtrl 266852)
|
|
|
|
|
#define __elevationControl (__display displayCtrl 266853)
|
|
|
|
|
#define __headingControl (__display displayCtrl 266854)
|
|
|
|
|
#define __timeControl (__display displayCtrl 266855)
|
|
|
|
|
#define __background (__display displayCtrl 266856)
|
2015-06-07 15:53:37 +00:00
|
|
|
|
|
2016-04-08 18:34:50 +00:00
|
|
|
|
__background ctrlSetText QPATHTOF(UI\dagr_gps.paa);
|
2015-06-07 15:53:37 +00:00
|
|
|
|
|
2015-06-12 16:23:01 +00:00
|
|
|
|
if (GVAR(outputPFH) != -1) exitWith {};
|
|
|
|
|
|
|
|
|
|
GVAR(outputPFH) = [{
|
2015-06-08 10:57:16 +00:00
|
|
|
|
// Abort Condition
|
2015-06-09 20:46:04 +00:00
|
|
|
|
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
2015-06-12 16:23:01 +00:00
|
|
|
|
GVAR(outputPFH) = -1;
|
2015-06-08 10:57:16 +00:00
|
|
|
|
135471 cutText ["", "PLAIN"];
|
|
|
|
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
|
|
|
|
};
|
2015-08-09 00:33:00 +00:00
|
|
|
|
|
2015-06-08 10:57:16 +00:00
|
|
|
|
// GRID
|
2017-10-10 14:39:59 +00:00
|
|
|
|
private _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
|
2015-08-09 00:33:00 +00:00
|
|
|
|
_gridArray params ["_gridArrayX","_gridArrayY"];
|
2017-10-10 14:39:59 +00:00
|
|
|
|
private _dagrGrid = format ["%1 %2", ((_gridArrayX) select [0,4]), ((_gridArrayY) select [0,4])];
|
2015-08-09 00:33:00 +00:00
|
|
|
|
|
2015-06-08 10:57:16 +00:00
|
|
|
|
// SPEED
|
2017-10-10 14:39:59 +00:00
|
|
|
|
private _speed = speed (vehicle ACE_player);
|
2015-06-08 10:57:16 +00:00
|
|
|
|
_speed = floor (_speed * 10) / 10;
|
2015-06-07 15:53:37 +00:00
|
|
|
|
_speed = abs(_speed);
|
|
|
|
|
_dagrspeed = str _speed + "kph";
|
|
|
|
|
|
2015-06-08 10:57:16 +00:00
|
|
|
|
// Elevation
|
2017-10-10 14:39:59 +00:00
|
|
|
|
private _elevation = getPosASL ACE_player;
|
2015-06-30 17:26:51 +00:00
|
|
|
|
_elevation = floor ((_elevation select 2) + EGVAR(common,mapAltitude));
|
2017-10-10 14:39:59 +00:00
|
|
|
|
private _dagrElevation = str _elevation + "m";
|
2015-06-07 15:53:37 +00:00
|
|
|
|
|
2015-06-08 10:57:16 +00:00
|
|
|
|
// Heading
|
2017-10-10 14:39:59 +00:00
|
|
|
|
private _dagrHeading = if (!GVAR(useDegrees)) then {
|
2015-06-08 10:57:16 +00:00
|
|
|
|
floor (DEG_TO_MIL(direction (vehicle ACE_player)))
|
|
|
|
|
} else {
|
|
|
|
|
floor (direction (vehicle ACE_player))
|
2015-06-07 15:53:37 +00:00
|
|
|
|
};
|
|
|
|
|
|
2015-06-08 10:57:16 +00:00
|
|
|
|
// Time
|
2017-10-10 14:39:59 +00:00
|
|
|
|
private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString;
|
2015-06-07 15:53:37 +00:00
|
|
|
|
|
2015-06-08 10:57:16 +00:00
|
|
|
|
// Output
|
|
|
|
|
__gridControl ctrlSetText format ["%1", _dagrGrid];
|
|
|
|
|
__speedControl ctrlSetText format ["%1", _dagrSpeed];
|
|
|
|
|
__elevationControl ctrlSetText format ["%1", _dagrElevation];
|
2015-08-09 00:33:00 +00:00
|
|
|
|
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 <20>", _dagrHeading] });
|
2015-06-08 10:57:16 +00:00
|
|
|
|
__timeControl ctrlSetText format ["%1", _dagrTime];
|
2015-08-09 00:33:00 +00:00
|
|
|
|
|
2015-06-09 20:46:04 +00:00
|
|
|
|
}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler;
|