ACE3/addons/maptools/functions/fnc_openMapGps.sqf

29 lines
761 B
Plaintext
Raw Normal View History

/*
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>
*
2016-06-18 09:50:41 +00:00
* Return Value:
* None
*
* Example:
* [true] call ACE_maptools_fnc_openMapGps
2015-04-07 20:01:44 +00:00
*
* Public: No
*/
2015-01-15 21:50:48 +00:00
#include "script_component.hpp"
2015-08-18 02:51:40 +00:00
params ["_shouldOpenGps"];
2015-04-17 23:13:09 +00:00
private _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-04-07 20:01:44 +00:00
("RscACE_MapGps" call BIS_fnc_rscLayer) cutRsc ["RscACE_MapGps","PLAIN"];
2015-04-07 20:01:44 +00:00
[FUNC(openMapGpsUpdate), 0.5, []] call CBA_fnc_addPerFrameHandler; //update bearing/altitude every 0.5 sec (ticktime)
} else {
2015-04-07 20:01:44 +00:00
("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
};