2015-01-18 07:20:55 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-29 07:38:46 +00:00
|
|
|
ADDON = false;
|
|
|
|
|
2016-11-23 19:35:25 +00:00
|
|
|
PREP_RECOMPILE_START;
|
2016-02-22 14:20:36 +00:00
|
|
|
#include "XEH_PREP.hpp"
|
2016-11-23 19:35:25 +00:00
|
|
|
PREP_RECOMPILE_END;
|
2015-01-18 16:17:06 +00:00
|
|
|
|
2018-01-06 06:52:57 +00:00
|
|
|
#include "initSettings.sqf"
|
|
|
|
|
2015-01-18 16:17:06 +00:00
|
|
|
// init marker types
|
|
|
|
if (isNil QGVAR(MarkersCache)) then {
|
|
|
|
GVAR(MarkersCache) = [];
|
|
|
|
|
2015-12-10 14:32:31 +00:00
|
|
|
private _config = configfile >> "CfgMarkers";
|
|
|
|
|
2015-01-18 16:17:06 +00:00
|
|
|
for "_a" from 0 to (count _config - 1) do {
|
2015-12-10 14:32:31 +00:00
|
|
|
private _marker = _config select _a;
|
|
|
|
|
2018-09-17 18:52:24 +00:00
|
|
|
if (getNumber (_marker >> "scope") isEqualTo 2) then {
|
|
|
|
private _class = configName _marker;
|
2015-12-10 14:32:31 +00:00
|
|
|
private _name = getText (_marker >> "name");
|
|
|
|
private _icon = getText (_marker >> "icon");
|
|
|
|
|
2018-09-17 18:52:24 +00:00
|
|
|
GVAR(MarkersCache) pushBack [_name, _a, _icon, _class];
|
2015-01-18 16:17:06 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// init marker colors
|
|
|
|
if (isNil QGVAR(MarkerColorsCache)) then {
|
|
|
|
GVAR(MarkerColorsCache) = [];
|
|
|
|
|
2015-12-10 14:32:31 +00:00
|
|
|
private _config = configfile >> "CfgMarkerColors";
|
|
|
|
|
2015-01-18 16:17:06 +00:00
|
|
|
for "_a" from 0 to (count _config - 1) do {
|
2015-12-10 14:32:31 +00:00
|
|
|
private _marker = _config select _a;
|
|
|
|
|
2018-09-17 18:52:24 +00:00
|
|
|
if (getNumber (_marker >> "scope") isEqualTo 2) then {
|
|
|
|
private _class = configName _marker;
|
2015-12-10 14:32:31 +00:00
|
|
|
private _name = getText (_marker >> "name");
|
|
|
|
private _rgba = getArray (_marker >> "color");
|
|
|
|
|
2015-01-18 16:17:06 +00:00
|
|
|
{
|
2015-12-10 14:32: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-12-10 14:32:31 +00:00
|
|
|
|
2015-08-22 12:08:35 +00:00
|
|
|
_rgba params ["_red", "_green", "_blue", "_alpha"];
|
2015-12-10 14:32:31 +00:00
|
|
|
private _icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _red, _green, _blue, _alpha];
|
2015-01-18 16:17:06 +00:00
|
|
|
|
2018-09-17 18:52:24 +00:00
|
|
|
GVAR(MarkerColorsCache) pushBack [_name, _a, _icon, _class];
|
2015-01-18 16:17:06 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2015-03-28 00:22:49 +00:00
|
|
|
//Server Sync JIP markers:
|
2016-05-22 15:29:05 +00:00
|
|
|
[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call CBA_fnc_addEventHandler;
|
2015-01-29 07:38:46 +00:00
|
|
|
|
|
|
|
ADDON = true;
|