ACE3/addons/maptools/functions/fnc_openMapGpsUpdate.sqf

40 lines
1.0 KiB
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
/*
* Author: esteldunedain, PabstMirror
* Update GPS display, called from main map's draw.
*
* Arguments:
* 0: Map control <CONTROL>
*
* Return Value:
* None
*
* Example:
* [findDisplay 12 displayCtrl 51] call ace_maptools_fnc_openMapGpsUpdate;
*
* Public: No
*/
2015-01-16 08:13:29 +00:00
params ["_mapCtrl"];
private _mapDisplay = ctrlParent _mapCtrl;
if (!GVAR(mapGpsShow) || {!(call FUNC(canUseMapGPS))}) exitWith {
(_mapDisplay displayCtrl 913589) ctrlShow false;
2015-01-16 08:13:29 +00:00
};
(_mapDisplay displayCtrl 913589) ctrlShow true;
if (CBA_missionTime < GVAR(mapGpsNextUpdate)) exitWith {};
GVAR(mapGpsNextUpdate) = CBA_missionTime + 0.5;
2015-01-16 08:13:29 +00:00
private _ctrl = _mapDisplay displayCtrl 913590;
2016-04-02 16:53:34 +00:00
_ctrl ctrlSetText str (round (getDir ACE_player)); // Set Heading
_ctrl = _mapDisplay displayCtrl 913591;
2016-04-02 16:53:34 +00:00
_ctrl ctrlSetText str (round ((getPosASL ACE_player) select 2) + EGVAR(common,mapAltitude)); // Set Altitude
_ctrl = _mapDisplay displayCtrl 913592;
2016-04-02 16:53:34 +00:00
_ctrl ctrlSetText mapGridPosition ACE_player; // Set grid cords