Release autotrack when trying to drag map

This commit is contained in:
PabstMirror 2015-03-25 09:00:49 -05:00
parent 600c7aed97
commit a88908d795
4 changed files with 34 additions and 1 deletions

View File

@ -12,6 +12,7 @@ PREP(deviceAddWaypoint);
PREP(deviceDeleteWaypoint);
PREP(deviceGetWaypoints);
PREP(dialogClosedEH);
PREP(mapButtonDownEH);
PREP(mapDoubleTapEH);
PREP(mapOnDrawEH);
PREP(modeMapButtons);

View File

@ -0,0 +1,30 @@
/*
* Author: PabstMirror
* Handles right clicking on the map ('dragging' the map)
* Release autotrack if enabled.
*
* Arguments:
* 0: The Map <CONTROL>
* 1: MouseButton <NUMBER>
* 2: MousePosX <NUMBER>
* 3: MousePosY <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapButtonDownEH
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
//Only handle RMB
if (_mouseButton != 1) exitWith {};
if (GVAR(mapAutoTrackPosition)) then {
GVAR(mapAutoTrackPosition) = false;
[] call FUNC(showApplicationPage);
};

View File

@ -12,7 +12,7 @@
* Nothing
*
* Example:
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapOnDrawEH
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapDoubleTapEH
*
* Public: No
*/

View File

@ -53,6 +53,7 @@ class controlsBackground {
h = H_PART(19);
onDraw = QUOTE(_this call FUNC(mapOnDrawEH));
onMouseButtonDblClick = QUOTE(_this call FUNC(mapDoubleTapEH));
onMouseButtonDown = QUOTE(_this call FUNC(mapButtonDownEH));
scaleMin = 0.005;
scaleMax = 10; //Lets the mini display zoom out far enough
@ -113,6 +114,7 @@ class controlsBackground {
h = H_PART(19);
onDraw = QUOTE(_this call FUNC(mapOnDrawEH));
onMouseButtonDblClick = QUOTE(_this call FUNC(mapDoubleTapEH));
onMouseButtonDown = QUOTE(_this call FUNC(mapButtonDownEH));
// ptsPerSquareSea = 5;
// ptsPerSquareTxt = 20;