2015-03-24 04:18:00 +00:00
|
|
|
// by esteldunedain
|
2015-03-14 19:58:05 +00:00
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
|
|
|
// Init variables
|
|
|
|
GVAR(mapGpsShow) = true;
|
|
|
|
|
|
|
|
GVAR(mapTool_Shown) = 0;
|
|
|
|
GVAR(mapTool_pos) = [0,0];
|
|
|
|
GVAR(mapTool_angle) = 0;
|
|
|
|
GVAR(mapTool_isDragging) = false;
|
|
|
|
GVAR(mapTool_isRotating) = false;
|
|
|
|
|
2016-06-02 19:36:25 +00:00
|
|
|
//Install the event handers for the map tools on the main in-game map
|
|
|
|
[{!isNull findDisplay 12},
|
|
|
|
{
|
|
|
|
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}];
|
|
|
|
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}];
|
|
|
|
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}];
|
|
|
|
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(updateMapToolMarkers);}];
|
|
|
|
}, []] call CBA_fnc_waitUntilAndExecute;
|
2015-06-28 18:08:47 +00:00
|
|
|
|
2016-06-22 09:16:55 +00:00
|
|
|
["visibleMap", {
|
2015-08-30 20:26:43 +00:00
|
|
|
params ["", "_mapOn"];
|
|
|
|
if (_mapOn) then {
|
|
|
|
// Show GPS if required
|
|
|
|
[GVAR(mapGpsShow)] call FUNC(openMapGps);
|
|
|
|
} else {
|
|
|
|
// Hide GPS
|
|
|
|
[false] call FUNC(openMapGps);
|
|
|
|
};
|
2016-06-22 09:16:55 +00:00
|
|
|
}] call CBA_fnc_addPlayerEventHandler;
|