2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2018-01-05 17:55:00 +00:00
|
|
|
/*
|
|
|
|
* Author: chris579
|
|
|
|
* Triggered when a mouse button is pressed on the map.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Map Control the EVH was assigned to <CONTROL>
|
|
|
|
* 1: Button code <NUMBER>
|
|
|
|
* 2: Position of x <NUMBER>
|
|
|
|
* 3: Position of y <NUMBER>
|
|
|
|
* 4: State of Shift <BOOL>
|
|
|
|
* 5: State of Ctrl <BOOL>
|
|
|
|
* 6: State of Alt <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2018-01-06 06:52:57 +00:00
|
|
|
* [CONTROL, 2, 0, 0, true, false, false] call ace_markers_fnc_onMouseButtonDown
|
2018-01-05 17:55:00 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_ctrlMap", "_button", "_x", "_y", "_shift", "_ctrl", "_alt"];
|
|
|
|
|
2021-02-27 17:05:05 +00:00
|
|
|
if (_button != 0 || {[_shift, _ctrl, _alt] isNotEqualTo [false, false, true]}) exitWith {};
|
2018-01-05 17:55:00 +00:00
|
|
|
|
|
|
|
ctrlMapMouseOver _ctrlMap params [["_type", ""], "_marker"];
|
|
|
|
|
2019-01-03 19:31:21 +00:00
|
|
|
if (_type == "marker" && {_marker find "_USER_DEFINED" != -1 && {_marker call FUNC(canMove)}}) then {
|
2018-01-05 17:55:00 +00:00
|
|
|
_ctrlMap ctrlMapCursor ["Track", "Move"];
|
|
|
|
|
|
|
|
private _originalPos = getMarkerPos _marker;
|
|
|
|
private _originalAlpha = markerAlpha _marker;
|
|
|
|
|
|
|
|
if !([QGVAR(markerMoveStarted), [ACE_player, _marker, _originalPos]] call CBA_fnc_localEvent) exitWith {};
|
|
|
|
|
|
|
|
GVAR(moving) = true;
|
|
|
|
_marker setMarkerAlphaLocal 0.5;
|
2018-01-06 06:52:57 +00:00
|
|
|
[FUNC(movePFH), 0, [_marker, _ctrlMap, _originalPos, _originalAlpha]] call CBA_fnc_addPerFrameHandler;
|
2018-01-05 17:55:00 +00:00
|
|
|
};
|