2015-01-18 07:20:55 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-29 07:38:46 +00:00
|
|
|
ADDON = false;
|
|
|
|
|
2015-01-18 07:20:55 +00:00
|
|
|
PREP(initInsertMarker);
|
2015-03-28 03:55:19 +00:00
|
|
|
PREP(mapDrawEH);
|
2015-01-18 07:20:55 +00:00
|
|
|
PREP(onLBSelChangedColor);
|
|
|
|
PREP(onLBSelChangedShape);
|
|
|
|
PREP(onSliderPosChangedAngle);
|
|
|
|
PREP(placeMarker);
|
|
|
|
PREP(sendMarkersJIP);
|
|
|
|
PREP(setMarkerJIP);
|
|
|
|
PREP(setMarkerNetwork);
|
2015-01-18 16:17:06 +00:00
|
|
|
|
2015-04-17 20:45:00 +00:00
|
|
|
private ["_config", "_marker", "_a", "_scope", "_icon", "_rgba", "_name"];
|
|
|
|
|
2015-01-18 16:17:06 +00:00
|
|
|
// init marker types
|
|
|
|
if (isNil QGVAR(MarkersCache)) then {
|
|
|
|
_config = configfile >> "CfgMarkers";
|
|
|
|
GVAR(MarkersCache) = [];
|
|
|
|
|
|
|
|
for "_a" from 0 to (count _config - 1) do {
|
|
|
|
_marker = _config select _a;
|
|
|
|
_scope = getNumber (_marker >> "scope");
|
|
|
|
if (_scope == 2) then {
|
2015-03-28 00:22:49 +00:00
|
|
|
_name = getText (_marker >> "name");
|
|
|
|
_icon = getText (_marker >> "icon");
|
2015-01-18 16:17:06 +00:00
|
|
|
GVAR(MarkersCache) pushBack [_name, _a, _icon];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// init marker colors
|
|
|
|
if (isNil QGVAR(MarkerColorsCache)) then {
|
|
|
|
_config = configfile >> "CfgMarkerColors";
|
|
|
|
GVAR(MarkerColorsCache) = [];
|
|
|
|
|
|
|
|
for "_a" from 0 to (count _config - 1) do {
|
|
|
|
_marker = _config select _a;
|
|
|
|
_scope = getNumber (_marker >> "scope");
|
|
|
|
if (_scope == 2) then {
|
2015-03-28 00:22:49 +00:00
|
|
|
_name = getText (_marker >> "name");
|
2015-01-18 16:17:06 +00:00
|
|
|
_rgba = getArray (_marker >> "color");
|
|
|
|
{
|
2015-11-20 17:40:31 +00:00
|
|
|
if (!( _x isEqualType 0)) then {
|
2015-01-18 16:17:06 +00:00
|
|
|
_rgba set [_forEachIndex, call compile _x];
|
|
|
|
};
|
|
|
|
} forEach _rgba;
|
2015-08-22 12:08:35 +00:00
|
|
|
_rgba params ["_red", "_green", "_blue", "_alpha"];
|
2015-08-23 19:25:41 +00:00
|
|
|
_icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _red, _green, _blue, _alpha];
|
2015-01-18 16:17:06 +00:00
|
|
|
|
|
|
|
GVAR(MarkerColorsCache) pushBack [_name, _a, _icon];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2015-03-28 00:22:49 +00:00
|
|
|
//Server Sync JIP markers:
|
2015-01-18 16:17:06 +00:00
|
|
|
[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call EFUNC(common,addEventHandler);
|
2015-01-29 07:38:46 +00:00
|
|
|
|
|
|
|
ADDON = true;
|