ACE3/addons/maptools/functions/fnc_openMapGps.sqf

26 lines
677 B
Plaintext
Raw Normal View History

/*
2015-03-24 04:18:00 +00:00
* Author: esteldunedain
2015-01-16 08:13:29 +00:00
*
* Opens or closes the gps on the map screen, showing coordinates
*
* Argument:
* 0: Open GPS? (Boolean)
*
* Return value:
* Nothing
*/
2015-01-15 21:50:48 +00:00
#include "script_component.hpp"
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-16 08:13:29 +00:00
if (_shouldOpenGps && {"ItemGPS" in assignedItems ACE_player} && {!_isOpen}) then {
2015-01-15 21:50:48 +00:00
("RscACE_MapGps" call BIS_fnc_rscLayer) cutRsc ["RscACE_MapGps","PLAIN"];
2015-01-16 08:13:29 +00:00
[FUNC(openMapGpsUpdate), 0.5, []] call CBA_fnc_addPerFrameHandler; //update bearing/altitude every 0.5 sec (ticktime)
} else {
2015-01-15 21:50:48 +00:00
("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
};