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
|
2024-03-28 18:57:23 +00:00
|
|
|
[QGVAR(setMarkerNetwork), LINKFUNC(setMarkerNetwork)] call CBA_fnc_addEventHandler;
|
2015-01-18 16:17:06 +00:00
|
|
|
|
|
|
|
// recieve marker data for JIP
|
2024-03-28 18:57:23 +00:00
|
|
|
[QGVAR(setMarkerJIP), LINKFUNC(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 {
|
2017-12-11 19:11:21 +00:00
|
|
|
[QGVAR(sendMarkersJIP), CBA_clientID] 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;
|
2021-04-21 20:36:08 +00:00
|
|
|
GVAR(currentMarkerScale) = 1;
|
2015-03-28 03:55:19 +00:00
|
|
|
GVAR(currentMarkerColorConfigName) = "";
|
2015-12-10 14:32:31 +00:00
|
|
|
GVAR(currentMarkerConfigName) = "";
|
2017-09-07 17:26:32 +00:00
|
|
|
|
2019-01-03 19:31:21 +00:00
|
|
|
GVAR(userPlacedMarkers) = [];
|
|
|
|
|
2018-01-05 17:55:00 +00:00
|
|
|
// set marker pos local on every machine (prevent markers visible for everyone)
|
|
|
|
[QGVAR(setMarkerPosLocal), {
|
|
|
|
params ["_marker", "_pos"];
|
2017-09-07 17:26:32 +00:00
|
|
|
_marker setMarkerPosLocal _pos;
|
|
|
|
|
2018-01-05 17:55:00 +00:00
|
|
|
// handle JIP
|
2017-09-07 17:26:32 +00:00
|
|
|
if (isServer) then {
|
|
|
|
private _index = (GETGVAR(allMapMarkers,[])) find _marker; // case-sensitive, but should be fine
|
2018-01-05 17:55:00 +00:00
|
|
|
|
|
|
|
if (_index < 0) exitWith {
|
2019-01-03 19:31:21 +00:00
|
|
|
if (!isMultiplayer) exitWith {};
|
2024-02-05 17:04:24 +00:00
|
|
|
WARNING_1("Could not find data for %1",_marker);
|
2018-01-05 17:55:00 +00:00
|
|
|
};
|
|
|
|
|
2017-09-07 17:26:32 +00:00
|
|
|
private _data = GVAR(allMapMarkersProperties) select _index;
|
|
|
|
_data set [2, _pos];
|
|
|
|
};
|
|
|
|
}] call CBA_fnc_addEventHandler;
|