mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
maptools - Improve behaviour upon first open (show under mouse position instead of bottom-left corner) (#8848)
* 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>
This commit is contained in:
parent
d135371319
commit
020cf2ddd8
@ -32,14 +32,14 @@ class CfgVehicles {
|
|||||||
class ACE_MapToolsShowNormal {
|
class ACE_MapToolsShowNormal {
|
||||||
displayName = CSTRING(MapToolsShowNormal);
|
displayName = CSTRING(MapToolsShowNormal);
|
||||||
condition = QUOTE(GVAR(mapTool_Shown) != 1);
|
condition = QUOTE(GVAR(mapTool_Shown) != 1);
|
||||||
statement = QUOTE(GVAR(mapTool_Shown) = 1;);
|
statement = QUOTE(if (GVAR(mapTool_Shown) == 0) then {GVAR(mapTool_moveToMouse) = true}; GVAR(mapTool_Shown) = 1;);
|
||||||
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
||||||
showDisabled = 1;
|
showDisabled = 1;
|
||||||
};
|
};
|
||||||
class ACE_MapToolsShowSmall {
|
class ACE_MapToolsShowSmall {
|
||||||
displayName = CSTRING(MapToolsShowSmall);
|
displayName = CSTRING(MapToolsShowSmall);
|
||||||
condition = QUOTE(GVAR(mapTool_Shown) != 2);
|
condition = QUOTE(GVAR(mapTool_Shown) != 2);
|
||||||
statement = QUOTE(GVAR(mapTool_Shown) = 2;);
|
statement = QUOTE(if (GVAR(mapTool_Shown) == 0) then {GVAR(mapTool_moveToMouse) = true}; GVAR(mapTool_Shown) = 2;);
|
||||||
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
||||||
showDisabled = 1;
|
showDisabled = 1;
|
||||||
};
|
};
|
||||||
|
@ -13,6 +13,7 @@ GVAR(mapTool_pos) = [0,0];
|
|||||||
GVAR(mapTool_angle) = 0;
|
GVAR(mapTool_angle) = 0;
|
||||||
GVAR(mapTool_isDragging) = false;
|
GVAR(mapTool_isDragging) = false;
|
||||||
GVAR(mapTool_isRotating) = 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
|
//Install the event handers for the map tools on the main in-game map
|
||||||
[{!isNull findDisplay 12},
|
[{!isNull findDisplay 12},
|
||||||
|
@ -19,6 +19,13 @@ params ["_theMap"];
|
|||||||
|
|
||||||
if ((GVAR(mapTool_Shown) == 0) || {!("ACE_MapTools" in (ACE_player call EFUNC(common,uniqueItems)))}) exitWith {};
|
if ((GVAR(mapTool_Shown) == 0) || {!("ACE_MapTools" in (ACE_player call EFUNC(common,uniqueItems)))}) exitWith {};
|
||||||
|
|
||||||
|
// open map tools in center of screen when toggled to be shown
|
||||||
|
if (GVAR(mapTool_moveToMouse)) then {
|
||||||
|
private _mousePosition = _theMap ctrlMapScreenToWorld getMousePosition;
|
||||||
|
GVAR(mapTool_pos) = _mousePosition;
|
||||||
|
GVAR(mapTool_moveToMouse) = false; // we only need to do this once after opening the map tool
|
||||||
|
};
|
||||||
|
|
||||||
private _rotatingTexture = "";
|
private _rotatingTexture = "";
|
||||||
private _textureWidth = 0;
|
private _textureWidth = 0;
|
||||||
if (GVAR(mapTool_Shown) == 1) then {
|
if (GVAR(mapTool_Shown) == 1) then {
|
||||||
|
Loading…
Reference in New Issue
Block a user