mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
020cf2ddd8
* open map tools in center of screen upon first open Don't show the map tools at the bottom-left corner of the map when you first open it, but right where your mouse is. * always move to mouse position when opened (not just once) incorporated feedback from co-authors Co-Authored-By: Drofseh <Drofseh@users.noreply.github.com> Co-Authored-By: PabstMirror <pabstmirror@gmail.com> * replace tabs by 4x whitespaces in order for checks to complete successfully * move code to fnc_updateMapToolMarkers so it always runs Co-authored-by: Drofseh <Drofseh@users.noreply.github.com> Co-authored-by: PabstMirror <pabstmirror@gmail.com>
39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
// by esteldunedain
|
|
|
|
#include "script_component.hpp"
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
// Init variables
|
|
GVAR(mapGpsShow) = true;
|
|
GVAR(mapGpsNextUpdate) = -1;
|
|
|
|
GVAR(mapTool_Shown) = 0;
|
|
GVAR(mapTool_pos) = [0,0];
|
|
GVAR(mapTool_angle) = 0;
|
|
GVAR(mapTool_isDragging) = false;
|
|
GVAR(mapTool_isRotating) = false;
|
|
GVAR(mapTool_moveToMouse) = true; // used to display it in center of screen when opened
|
|
|
|
//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", {call FUNC(updateMapToolMarkers); call FUNC(openMapGpsUpdate);}];
|
|
}, []] call CBA_fnc_waitUntilAndExecute;
|
|
|
|
["visibleMap", {
|
|
params ["", "_mapOn"];
|
|
if (!_mapOn) then {
|
|
// Handle closing map in middle of line drawing (it's never created)
|
|
GVAR(freedrawing) = false;
|
|
};
|
|
}] call CBA_fnc_addPlayerEventHandler;
|
|
|
|
|
|
GVAR(freeDrawingData) = [];
|
|
GVAR(freedrawing) = false;
|
|
|