Created
April 5, 2020 15:06
-
-
Save BaerMitUmlaut/1f122a4d959576c2fefc36d360448e31 to your computer and use it in GitHub Desktop.
Overlays a picture over the whole map with the map still being usable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mission_fnc_mapOverlayCache = [] call CBA_fnc_createNamespace; | |
mission_fnc_mapOverlay = { | |
params ["_map"]; | |
_map drawIcon [ | |
getMissionPath "map.paa", | |
[1, 1, 1, 1], | |
[worldSize / 2, worldSize / 2, 0], | |
640 / ctrlMapScale _map, | |
640 / ctrlMapScale _map, | |
0 | |
]; | |
{ | |
if !(markerType _x in ["Empty", "ellipse", "rectangle"]) then { | |
private _color = if (markerColor _x in ["", "Default"]) then { | |
getArray (configFile >> "CfgMarkers" >> markerType _x >> "color"); | |
} else { | |
getArray (configFile >> "CfgMarkerColors" >> markerColor _x >> "color"); | |
}; | |
_color = mission_fnc_mapOverlayCache getVariable [str _color, _color]; | |
if !(_color isEqualTypeAll 0) then { | |
private _cacheKey = str _color; | |
_color = _color apply { call compile _x }; | |
mission_fnc_mapOverlayCache setVariable [_cacheKey, _color]; | |
}; | |
_map drawIcon [ | |
getText (configFile >> "CfgMarkers" >> markerType _x >> "icon"), | |
_color, | |
markerPos _x, | |
(markerSize _x)#0 * 30, | |
(markerSize _x)#1 * 30, | |
markerDir _x, | |
markerText _x, | |
1 | |
]; | |
}; | |
} forEach allMapMarkers; | |
}; | |
[{ | |
!isNull findDisplay 12 | |
}, { | |
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", { call mission_fnc_mapOverlay }] | |
}] call CBA_fnc_waitUntilAndExecute; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment