diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index c7dceacd759..3eb33afafa9 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -13,6 +13,7 @@ GVAR(mapTool_pos) = [0,0]; GVAR(mapTool_angle) = 0; GVAR(mapTool_isDragging) = false; GVAR(mapTool_isRotating) = false; +GVAR(mapTool_isFirstShown) = true; // used to display it in center of screen when first opened //Install the event handers for the map tools on the main in-game map [{!isNull findDisplay 12}, diff --git a/addons/maptools/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf index 6ba8e1938c9..50b64a21a36 100644 --- a/addons/maptools/functions/fnc_handleMouseMove.sqf +++ b/addons/maptools/functions/fnc_handleMouseMove.sqf @@ -29,6 +29,12 @@ if (GVAR(mapTool_Shown) == 0) exitWith {false}; private _mousePosition = _control ctrlMapScreenToWorld [_mousePosX, _mousePosY]; +// open map tools in center of screen upon first open +if (GVAR(mapTool_isFirstShown)) then { + GVAR(mapTool_pos) = _mousePosition; + GVAR(mapTool_isFirstShown) = false; // we only need to do this once +}; + // Translation if (GVAR(mapTool_isDragging)) exitWith { GVAR(mapTool_pos) set [0, (GVAR(mapTool_startPos) select 0) + (_mousePosition select 0) - (GVAR(mapTool_startDragPos) select 0)];