2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-04-07 20:01:44 +00:00
|
|
|
* Author: esteldunedain
|
|
|
|
* Opens or closes the gps on the map screen, showing coordinates
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Open GPS? <BOOL>
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-15 21:50:48 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-16 08:13:29 +00:00
|
|
|
_shouldOpenGps = _this select 0;
|
2015-01-15 21:50:48 +00:00
|
|
|
_isOpen = !(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull]));
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-16 08:13:29 +00:00
|
|
|
if (_shouldOpenGps && {"ItemGPS" in assignedItems ACE_player} && {!_isOpen}) then {
|
2015-04-07 20:01:44 +00:00
|
|
|
("RscACE_MapGps" call BIS_fnc_rscLayer) cutRsc ["RscACE_MapGps","PLAIN"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-04-07 20:01:44 +00:00
|
|
|
[FUNC(openMapGpsUpdate), 0.5, []] call CBA_fnc_addPerFrameHandler; //update bearing/altitude every 0.5 sec (ticktime)
|
2015-01-11 16:42:31 +00:00
|
|
|
} else {
|
2015-04-07 20:01:44 +00:00
|
|
|
("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|