2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2017-09-07 17:26:32 +00:00
|
|
|
/*
|
|
|
|
* Author: chris579
|
|
|
|
* When the marker is being moved.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Marker data <ARRAY>
|
|
|
|
* 1: PFH ID <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [[MARKER], 5] call ace_markers_fnc_movePFH
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2018-01-06 06:52:57 +00:00
|
|
|
(_this select 0) params ["_marker", "_ctrlMap", "_originalPos", "_originalAlpha"];
|
2017-09-07 17:26:32 +00:00
|
|
|
|
2018-01-05 17:55:00 +00:00
|
|
|
if (isNull _ctrlMap || !GVAR(moving)) exitWith {
|
|
|
|
(_this select 1) call CBA_fnc_removePerFrameHandler;
|
2017-09-07 17:26:32 +00:00
|
|
|
|
2018-01-05 17:55:00 +00:00
|
|
|
private _finalPos = getMarkerPos _marker;
|
2018-11-25 14:02:27 +00:00
|
|
|
private _overrule = [QGVAR(markerMoveEnded), [ACE_player, _marker, _originalPos, _finalPos]] call CBA_fnc_localEvent;
|
2017-09-07 17:26:32 +00:00
|
|
|
|
2018-11-25 14:02:27 +00:00
|
|
|
if (!isNil "_overrule" && {_overrule isEqualTo true}) then {
|
2018-01-05 17:55:00 +00:00
|
|
|
_marker setMarkerPosLocal _originalPos;
|
|
|
|
} else {
|
|
|
|
[QGVAR(setMarkerPosLocal), [_marker, _finalPos]] call CBA_fnc_globalEvent;
|
2017-09-07 17:26:32 +00:00
|
|
|
};
|
|
|
|
|
2018-01-05 17:55:00 +00:00
|
|
|
_marker setMarkerAlphaLocal _originalAlpha;
|
|
|
|
_ctrlMap ctrlMapCursor ["Track", "Track"];
|
2017-09-07 17:26:32 +00:00
|
|
|
};
|
|
|
|
|
2018-01-05 17:55:00 +00:00
|
|
|
_marker setMarkerPosLocal (_ctrlMap posScreenToWorld getMousePosition);
|