2024-01-07 18:02:05 +00:00
|
|
|
// by esteldunedain, LorenLuke
|
2015-03-14 19:58:05 +00:00
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
|
|
|
// Init variables
|
|
|
|
GVAR(mapGpsShow) = true;
|
2019-09-05 20:58:05 +00:00
|
|
|
GVAR(mapGpsNextUpdate) = -1;
|
2015-03-14 19:58:05 +00:00
|
|
|
|
|
|
|
GVAR(mapTool_Shown) = 0;
|
2024-01-07 18:02:05 +00:00
|
|
|
GVAR(mapTool_pos) = [0, 0];
|
2015-03-14 19:58:05 +00:00
|
|
|
GVAR(mapTool_angle) = 0;
|
|
|
|
GVAR(mapTool_isDragging) = false;
|
|
|
|
GVAR(mapTool_isRotating) = false;
|
2022-04-06 21:49:27 +00:00
|
|
|
GVAR(mapTool_moveToMouse) = true; // used to display it in center of screen when opened
|
2015-03-14 19:58:05 +00:00
|
|
|
|
2024-01-07 18:02:05 +00:00
|
|
|
GVAR(plottingBoard_Shown) = 0;
|
|
|
|
GVAR(plottingBoard_pos) = [0, 0];
|
|
|
|
GVAR(plottingBoard_angle) = 0;
|
|
|
|
GVAR(plottingBoard_acrylicAngle) = 0;
|
|
|
|
GVAR(plottingBoard_rulerAngle) = 0;
|
|
|
|
GVAR(plottingBoard_isDragging) = false;
|
|
|
|
GVAR(plottingBoard_isRotating) = -1;
|
|
|
|
GVAR(plottingBoard_moveToMouse) = true; // used to display it in center of screen when opened
|
|
|
|
GVAR(plottingBoard_markers) = createHashMap;
|
|
|
|
|
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)}];
|
2019-09-05 20:58:05 +00:00
|
|
|
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {call FUNC(updateMapToolMarkers); call FUNC(openMapGpsUpdate);}];
|
2016-06-02 19:36:25 +00:00
|
|
|
}, []] 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"];
|
2019-09-05 20:58:05 +00:00
|
|
|
if (!_mapOn) then {
|
2016-10-07 22:21:19 +00:00
|
|
|
// Handle closing map in middle of line drawing (it's never created)
|
|
|
|
GVAR(freedrawing) = false;
|
2015-08-30 20:26:43 +00:00
|
|
|
};
|
2016-06-22 09:16:55 +00:00
|
|
|
}] call CBA_fnc_addPlayerEventHandler;
|
2016-10-07 22:21:19 +00:00
|
|
|
|
2024-01-07 18:02:05 +00:00
|
|
|
addMissionEventHandler ["MarkerCreated", {
|
|
|
|
[_this, false] call FUNC(handlePlottingBoardMarkers);
|
|
|
|
}];
|
|
|
|
|
|
|
|
addMissionEventHandler ["MarkerDeleted", {
|
|
|
|
[[_this select 0, -1, objNull, _this select 1], true] call FUNC(handlePlottingBoardMarkers);
|
|
|
|
}];
|
2016-10-07 22:21:19 +00:00
|
|
|
|
|
|
|
GVAR(freeDrawingData) = [];
|
|
|
|
GVAR(freedrawing) = false;
|