2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2017-06-08 13:31:51 +00:00
|
|
|
/*
|
2019-09-05 20:58:05 +00:00
|
|
|
* Author: esteldunedain, PabstMirror
|
2024-02-03 18:48:21 +00:00
|
|
|
* Update GPS display, called from main map's draw.
|
2017-06-08 13:31:51 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2024-02-03 18:48:21 +00:00
|
|
|
* 0: Map control <CONTROL>
|
2017-06-08 13:31:51 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2024-02-03 18:48:21 +00:00
|
|
|
* [findDisplay 12 displayCtrl 51] call ace_maptools_fnc_openMapGpsUpdate;
|
2017-06-08 13:31:51 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-16 08:13:29 +00:00
|
|
|
|
2019-09-05 20:58:05 +00:00
|
|
|
params ["_mapCtrl"];
|
2024-02-03 18:48:21 +00:00
|
|
|
|
2019-09-05 20:58:05 +00:00
|
|
|
private _mapDisplay = ctrlParent _mapCtrl;
|
|
|
|
|
2024-02-03 18:48:21 +00:00
|
|
|
if (!GVAR(mapGpsShow) || {!(call FUNC(canUseMapGPS))}) exitWith {
|
2019-09-05 20:58:05 +00:00
|
|
|
(_mapDisplay displayCtrl 913589) ctrlShow false;
|
2015-01-16 08:13:29 +00:00
|
|
|
};
|
2024-02-03 18:48:21 +00:00
|
|
|
|
2019-09-05 20:58:05 +00:00
|
|
|
(_mapDisplay displayCtrl 913589) ctrlShow true;
|
|
|
|
|
|
|
|
if (CBA_missionTime < GVAR(mapGpsNextUpdate)) exitWith {};
|
2024-02-03 18:48:21 +00:00
|
|
|
|
2019-09-05 20:58:05 +00:00
|
|
|
GVAR(mapGpsNextUpdate) = CBA_missionTime + 0.5;
|
2015-01-16 08:13:29 +00:00
|
|
|
|
2019-09-05 20:58:05 +00:00
|
|
|
private _ctrl = _mapDisplay displayCtrl 913590;
|
2016-04-02 16:53:34 +00:00
|
|
|
_ctrl ctrlSetText str (round (getDir ACE_player)); // Set Heading
|
2024-02-03 18:48:21 +00:00
|
|
|
|
2019-09-05 20:58:05 +00:00
|
|
|
_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
|
2024-02-03 18:48:21 +00:00
|
|
|
|
2019-09-05 20:58:05 +00:00
|
|
|
_ctrl = _mapDisplay displayCtrl 913592;
|
2016-04-02 16:53:34 +00:00
|
|
|
_ctrl ctrlSetText mapGridPosition ACE_player; // Set grid cords
|