2015-01-11 16:42:31 +00:00
|
|
|
// by commy2
|
2015-01-18 16:17:06 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
// recieve remote marker data
|
2016-05-22 15:29:05 +00:00
|
|
|
[QGVAR(setMarkerNetwork), {_this call DFUNC(setMarkerNetwork)}] call CBA_fnc_addEventHandler;
|
2015-01-18 16:17:06 +00:00
|
|
|
|
|
|
|
// recieve marker data for JIP
|
2016-05-22 15:29:05 +00:00
|
|
|
[QGVAR(setMarkerJIP), {_this call DFUNC(setMarkerJIP)}] call CBA_fnc_addEventHandler;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
// request marker data for JIP
|
2015-01-18 16:17:06 +00:00
|
|
|
if (isMultiplayer && {!isServer} && {hasInterface}) then {
|
2016-02-27 12:06:19 +00:00
|
|
|
GVAR(localLogic) = (createGroup sideLogic) createUnit ["Logic", [0,0,0], [], 0, "NONE"];
|
2016-05-22 15:29:05 +00:00
|
|
|
[QGVAR(sendMarkersJIP), [GVAR(localLogic)]] call CBA_fnc_serverEvent;
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
2015-03-28 03:55:19 +00:00
|
|
|
|
|
|
|
GVAR(mapDisplaysWithDrawEHs) = [];
|
|
|
|
GVAR(currentMarkerPosition) = [];
|
|
|
|
GVAR(currentMarkerAngle) = 0;
|
|
|
|
GVAR(currentMarkerColorConfigName) = "";
|
2015-12-10 14:32:31 +00:00
|
|
|
GVAR(currentMarkerConfigName) = "";
|
2017-09-07 17:26:32 +00:00
|
|
|
|
|
|
|
// set marker pos local on every computer (prevent markers visible for everyone)
|
|
|
|
[QGVAR(applyMarkerPosLocal), {
|
|
|
|
params["_marker", "_pos"];
|
|
|
|
_marker setMarkerPosLocal _pos;
|
|
|
|
|
|
|
|
if (isServer) then {
|
|
|
|
private _index = (GETGVAR(allMapMarkers,[])) find _marker; // case-sensitive, but should be fine
|
|
|
|
if (_index < 0) exitWith {ERROR_1("Could not find data for %1", _marker);};
|
|
|
|
private _data = GVAR(allMapMarkersProperties) select _index;
|
|
|
|
_data set [2, _pos];
|
|
|
|
};
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
|
|
|
["ace_settingsInitialized", {
|
|
|
|
if (GVAR(movableMarkersEnabled)) then {
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
[{
|
|
|
|
!isNull (findDisplay 12)
|
|
|
|
}, {
|
|
|
|
(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["MouseButtonDown", FUNC(onMouseButtonDownMap)];
|
|
|
|
(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["MouseButtonUp", FUNC(onMouseButtonUpMap)];
|
|
|
|
}] call CBA_fnc_waitUntilAndExecute;
|
|
|
|
};
|
|
|
|
}] call CBA_fnc_addEventHandler;
|