ACE3/addons/markers/XEH_preInit.sqf
BrettMayson 464ab0cefb
Tools - Add HEMTT SQF support and fix commas are not semicolons (#9663)
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: jonpas <jonpas33@gmail.com>
2023-12-07 03:20:47 +00:00

62 lines
1.7 KiB
Plaintext

#include "script_component.hpp"
ADDON = false;
PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.inc.sqf"
// init marker types
if (isNil QGVAR(MarkersCache)) then {
GVAR(MarkersCache) = [];
private _config = configfile >> "CfgMarkers";
for "_a" from 0 to (count _config - 1) do {
private _marker = _config select _a;
if (getNumber (_marker >> "scope") isEqualTo 2) then {
private _class = configName _marker;
private _name = getText (_marker >> "name");
private _icon = getText (_marker >> "icon");
GVAR(MarkersCache) pushBack [_name, _a, _icon, _class];
};
};
};
// init marker colors
if (isNil QGVAR(MarkerColorsCache)) then {
GVAR(MarkerColorsCache) = [];
private _config = configfile >> "CfgMarkerColors";
for "_a" from 0 to (count _config - 1) do {
private _marker = _config select _a;
if (getNumber (_marker >> "scope") isEqualTo 2) then {
private _class = configName _marker;
private _name = getText (_marker >> "name");
private _rgba = getArray (_marker >> "color");
{
if !( _x isEqualType 0) then {
_rgba set [_forEachIndex, call compile _x];
};
} forEach _rgba;
_rgba params ["_red", "_green", "_blue", "_alpha"];
private _icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _red, _green, _blue, _alpha];
GVAR(MarkerColorsCache) pushBack [_name, _a, _icon, _class];
};
};
};
//Server Sync JIP markers:
[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call CBA_fnc_addEventHandler;
ADDON = true;