ACE3/addons/markers/functions/fnc_mapDrawEH.sqf

57 lines
1.4 KiB
Plaintext
Raw Normal View History

2015-03-28 03:55:19 +00:00
/*
* Author: PabstMirror
2015-03-28 04:24:11 +00:00
* Draws the current temp marker. Allows rotation.
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
*/
#include "script_component.hpp"
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
2015-12-10 14:32:31 +00:00
private _sizeX = 1;
private _sizeY = 1;
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
{
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
];