ACE3/addons/maptools/functions/fnc_mapStateUpdater.sqf
Nicolás Badano 518010be36 Reordered the map, mapfx and pbos:
- mapfx moved inside map
- everything related to map tools and drawing moved to it's own pbo called ace_maptools

Also fixed a couple of bugs in BFT
- Only a single marker was being drawn
- The BFT_HideAi parameter had the opposite effect
2015-03-14 16:58:05 -03:00

41 lines
1.2 KiB
Plaintext

#include "script_component.hpp"
if (visibleMap) then {
// 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);
};
};
};
//When Map is Closed:
if (GVAR(mapVisableLastFrame) && (!visibleMap)) then {
GVAR(mapVisableLastFrame) = false;
// Hide GPS
[false] call FUNC(openMapGps);
// Hide Map tools
deleteMarkerLocal MARKERNAME_MAPTOOL_FIXED;
deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGNORMAL;
deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGSMALL;
GVAR(mapTool_markerRotatingFixed) = nil;
GVAR(mapTool_markerRotatingNormal) = nil;
GVAR(mapTool_markerRotatingSmall) = nil;
// Cancel drawing
call FUNC(cancelDrawing);
};
//When Map is Opened:
if ((!GVAR(mapVisableLastFrame)) && (visibleMap)) then {
//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);
};