ACE3/addons/maptools/functions/fnc_mapStateUpdater.sqf

34 lines
979 B
Plaintext
Raw Normal View History

2015-01-16 08:13:29 +00:00
#include "script_component.hpp"
if (visibleMap) then {
2015-04-07 20:01:44 +00:00
// Show/Hide draw buttons
if ("ACE_MapTools" in items ACE_player) then {
{ ((finddisplay 12) displayctrl _x) ctrlShow true; } forEach GVAR(drawing_controls);
} else {
{ ((finddisplay 12) displayctrl _x) ctrlShow false; } forEach GVAR(drawing_controls);
if (GVAR(drawing_isDrawing)) then {
call FUNC(cancelDrawing);
};
2015-01-16 08:13:29 +00:00
};
};
//When Map is Closed:
if (GVAR(mapVisableLastFrame) && (!visibleMap)) then {
2015-04-07 20:01:44 +00:00
GVAR(mapVisableLastFrame) = false;
// Hide GPS
[false] call FUNC(openMapGps);
// Cancel drawing
call FUNC(cancelDrawing);
2015-01-16 08:13:29 +00:00
};
//When Map is Opened:
if ((!GVAR(mapVisableLastFrame)) && (visibleMap)) then {
2015-04-07 20:01:44 +00:00
//todo: "mapOpened" Event????
GVAR(mapVisableLastFrame) = true;
// Show and update map tools if required
[] call FUNC(updateMapToolMarkers);
// Show GPS if required
[GVAR(mapGpsShow)] call FUNC(openMapGps);
2015-01-16 08:13:29 +00:00
};