2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
|
|
|
* Add a map marker creation event handler.
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Code to execute (Code or String)
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* ID of the event script (used to remove it later).
|
|
|
|
*/
|
2015-01-13 19:56:02 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-05-14 18:02:42 +00:00
|
|
|
private ["_actionsVar", "_id", "_actionIDs", "_actions"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-05-14 18:02:42 +00:00
|
|
|
PARAMS_1(_statement);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
if (typeName _statement == "STRING") then {
|
2015-05-14 18:02:42 +00:00
|
|
|
_statement = compile _statement;
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
2015-01-12 04:02:33 +00:00
|
|
|
_actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_id = (_actionsVar select 0) + 1;
|
|
|
|
_actionIDs = _actionsVar select 1;
|
|
|
|
_actions = _actionsVar select 2;
|
|
|
|
|
|
|
|
if (_id == 0) then {
|
2015-05-14 18:02:42 +00:00
|
|
|
uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers];
|
|
|
|
("ACE_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["ACE_EventHandlerHelper2", "PLAIN"];
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
_actionIDs pushBack _id;
|
|
|
|
_actions pushBack _statement;
|
|
|
|
|
2015-01-12 04:02:33 +00:00
|
|
|
missionNamespace setVariable ["ACE_EventHandler_MapMarker", [_id, _actionIDs, _actions]];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_id
|