ACE3/addons/markers/XEH_preInit.sqf
commy2 3c41d37417 overhaul movable markers (#5922)
* overhaul movable markers

* moving markers setting

* disable debug

* fix conflict with map gestures
2018-01-05 18:55:00 +01:00

82 lines
2.2 KiB
Plaintext

#include "script_component.hpp"
ADDON = false;
PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
// 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") == 2) then {
private _name = getText (_marker >> "name");
private _icon = getText (_marker >> "icon");
GVAR(MarkersCache) pushBack [_name, _a, _icon];
};
};
};
// 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") == 2) then {
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];
};
};
};
//Server Sync JIP markers:
[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call CBA_fnc_addEventHandler;
// settings
[
QGVAR(moveRestriction), "LIST",
[LSTRING(MoveRestriction), LSTRING(MoveRestriction_Description)],
format ["ACE %1", localize ELSTRING(map,Module_DisplayName)],
[
[
MOVE_RESTRICTION_NOBODY,
MOVE_RESTRICTION_ALL,
MOVE_RESTRICTION_ADMINS,
MOVE_RESTRICTION_GROUP_LEADERS,
MOVE_RESTRICTION_GROUP_LEADERS_ADMINS
],
[
LSTRING(MoveRestriction_Nobody),
LSTRING(MoveRestriction_All),
LSTRING(MoveRestriction_Admins),
LSTRING(MoveRestriction_GroupLeaders),
LSTRING(MoveRestriction_GroupLeadersAndAdmins)
],
1
]
] call cba_settings_fnc_init;
ADDON = true;