2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-03-28 03:55:19 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
2021-04-21 20:36:08 +00:00
|
|
|
* Draws the current temp marker. Allows rotation and scale.
|
2015-03-28 03:55:19 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: TheMap <Control>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-22 12:08:35 +00:00
|
|
|
* None
|
2015-03-28 03:55:19 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [theMapControl] call ace_markers_fnc_mapDrawEH;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-22 12:08:35 +00:00
|
|
|
params ["_theMap"];
|
2015-08-23 19:25:41 +00:00
|
|
|
// TRACE_1("params",_theMap);
|
2015-03-28 03:55:19 +00:00
|
|
|
|
|
|
|
//Only show if marker place is open:
|
2015-12-10 14:32:31 +00:00
|
|
|
if (isNull findDisplay 54) exitWith {};
|
2015-03-28 03:55:19 +00:00
|
|
|
//Error checking:
|
2015-12-10 14:32:31 +00:00
|
|
|
if (GVAR(currentMarkerConfigName) == "" || {GVAR(currentMarkerColorConfigName) == ""} || {GVAR(currentMarkerPosition) isEqualTo []}) exitWith {
|
|
|
|
ERROR("Bad Data");
|
|
|
|
};
|
2015-03-28 03:55:19 +00:00
|
|
|
|
2021-04-21 20:36:08 +00:00
|
|
|
private _sizeX = GVAR(currentMarkerScale);
|
|
|
|
private _sizeY = GVAR(currentMarkerScale);
|
2015-03-28 03:55:19 +00:00
|
|
|
|
2015-12-10 14:32:31 +00:00
|
|
|
private _textureConfig = configFile >> "CfgMarkers" >> GVAR(currentMarkerConfigName);
|
|
|
|
private _texture = getText (_textureConfig >> "icon");
|
|
|
|
private _markerSize = getNumber (_textureConfig >> "size");
|
|
|
|
private _markerShadow = getNumber (_textureConfig >> "shadow");
|
|
|
|
private _colorConfig = (configFile >> "CfgMarkerColors" >> GVAR(currentMarkerColorConfigName));
|
|
|
|
private _drawColor = getArray (_colorConfig >> "color");
|
2015-03-28 03:55:19 +00:00
|
|
|
|
|
|
|
//Convert possible code into numbers
|
|
|
|
{
|
2015-11-20 17:40:31 +00:00
|
|
|
if (_x isEqualType "") then {
|
2015-12-10 14:32:31 +00:00
|
|
|
_drawColor set [_forEachIndex, call compile _x];
|
2015-03-28 03:55:19 +00:00
|
|
|
};
|
|
|
|
} forEach _drawColor;
|
|
|
|
|
2015-12-10 14:32:31 +00:00
|
|
|
_drawColor set [3, (_drawColor select 3) * 0.875]; //Arma adds a slight transparency
|
|
|
|
|
|
|
|
_theMap drawIcon [
|
|
|
|
_texture,
|
|
|
|
_drawColor,
|
|
|
|
GVAR(currentMarkerPosition),
|
|
|
|
_sizeX * _markerSize,
|
|
|
|
_sizeY * _markerSize,
|
|
|
|
GVAR(currentMarkerAngle),
|
|
|
|
"",
|
|
|
|
_markerShadow
|
|
|
|
];
|