mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Clean old updateMapToolMarkers calls
This commit is contained in:
parent
4a245bd935
commit
4e3bbfac16
@ -14,7 +14,7 @@ class CfgVehicles {
|
|||||||
class ACE_MapToolsHide {
|
class ACE_MapToolsHide {
|
||||||
displayName = CSTRING(MapToolsHide);
|
displayName = CSTRING(MapToolsHide);
|
||||||
condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0}));
|
condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0}));
|
||||||
statement = QUOTE(GVAR(mapTool_Shown) = 0; [] call FUNC(updateMapToolMarkers));
|
statement = QUOTE(GVAR(mapTool_Shown) = 0;);
|
||||||
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
||||||
showDisabled = 1;
|
showDisabled = 1;
|
||||||
priority = 5;
|
priority = 5;
|
||||||
@ -22,7 +22,7 @@ class CfgVehicles {
|
|||||||
class ACE_MapToolsShowNormal {
|
class ACE_MapToolsShowNormal {
|
||||||
displayName = CSTRING(MapToolsShowNormal);
|
displayName = CSTRING(MapToolsShowNormal);
|
||||||
condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 1}));
|
condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 1}));
|
||||||
statement = QUOTE(GVAR(mapTool_Shown) = 1; [] call FUNC(updateMapToolMarkers));
|
statement = QUOTE(GVAR(mapTool_Shown) = 1;);
|
||||||
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
||||||
showDisabled = 1;
|
showDisabled = 1;
|
||||||
priority = 4;
|
priority = 4;
|
||||||
@ -30,7 +30,7 @@ class CfgVehicles {
|
|||||||
class ACE_MapToolsShowSmall {
|
class ACE_MapToolsShowSmall {
|
||||||
displayName = CSTRING(MapToolsShowSmall);
|
displayName = CSTRING(MapToolsShowSmall);
|
||||||
condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 2}));
|
condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 2}));
|
||||||
statement = QUOTE(GVAR(mapTool_Shown) = 2; [] call FUNC(updateMapToolMarkers));
|
statement = QUOTE(GVAR(mapTool_Shown) = 2;);
|
||||||
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
||||||
showDisabled = 1;
|
showDisabled = 1;
|
||||||
priority = 3;
|
priority = 3;
|
||||||
@ -38,7 +38,7 @@ class CfgVehicles {
|
|||||||
class ACE_MapToolsAlignNorth {
|
class ACE_MapToolsAlignNorth {
|
||||||
displayName = CSTRING(MapToolsAlignNorth);
|
displayName = CSTRING(MapToolsAlignNorth);
|
||||||
condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0}));
|
condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0}));
|
||||||
statement = QUOTE(GVAR(mapTool_angle) = 0; [] call FUNC(updateMapToolMarkers));
|
statement = QUOTE(GVAR(mapTool_angle) = 0;);
|
||||||
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
||||||
showDisabled = 1;
|
showDisabled = 1;
|
||||||
priority = 2;
|
priority = 2;
|
||||||
@ -46,7 +46,7 @@ class CfgVehicles {
|
|||||||
class ACE_MapToolsAlignCompass {
|
class ACE_MapToolsAlignCompass {
|
||||||
displayName = CSTRING(MapToolsAlignCompass);
|
displayName = CSTRING(MapToolsAlignCompass);
|
||||||
condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0} && {('ItemCompass' in assigneditems ACE_player) || {'ItemCompass' in assigneditems ACE_player}}));
|
condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0} && {('ItemCompass' in assigneditems ACE_player) || {'ItemCompass' in assigneditems ACE_player}}));
|
||||||
statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player; [] call FUNC(updateMapToolMarkers));
|
statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player;);
|
||||||
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
|
||||||
showDisabled = 1;
|
showDisabled = 1;
|
||||||
priority = 1;
|
priority = 1;
|
||||||
|
@ -64,9 +64,6 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737];
|
|||||||
// Install event handlers on the map control and display (control = 51)
|
// Install event handlers on the map control and display (control = 51)
|
||||||
GVAR(drawing_syncMarkers) = false;
|
GVAR(drawing_syncMarkers) = false;
|
||||||
12 call _fnc_installMapEvents;
|
12 call _fnc_installMapEvents;
|
||||||
|
|
||||||
// Update the size and rotation of map tools
|
|
||||||
[] call FUNC(updateMapToolMarkers);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
["mapOpened", {
|
["mapOpened", {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["", "_code"];
|
params ["", "_code"];
|
||||||
|
TRACE_1("params",_code);
|
||||||
|
|
||||||
private ["_handled", "_relPos", "_diffVector", "_magDiffVector", "_lambdaLong", "_lambdaTrasAbs"];
|
private ["_handled", "_relPos", "_diffVector", "_magDiffVector", "_lambdaLong", "_lambdaTrasAbs"];
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
params ["_dir", "_params"];
|
params ["_dir", "_params"];
|
||||||
_params params ["_control", "_button", "_screenPosX", "_screenPosY", "_shiftKey", "_ctrlKey", "_altKey"];
|
_params params ["_control", "_button", "_screenPosX", "_screenPosY", "_shiftKey", "_ctrlKey", "_altKey"];
|
||||||
|
TRACE_2("params",_dir,_params);
|
||||||
|
|
||||||
private["_gui", "_handled", "_marker", "_pos"];
|
private["_gui", "_handled", "_marker", "_pos"];
|
||||||
|
|
||||||
@ -23,16 +24,14 @@ _handled = false;
|
|||||||
if (_button != 0) exitWith {_handled};
|
if (_button != 0) exitWith {_handled};
|
||||||
|
|
||||||
// If releasing
|
// If releasing
|
||||||
if ((_dir != 1) && {(GVAR(mapTool_isDragging) || GVAR(mapTool_isRotating))}) exitWith {
|
if (_dir != 1) then {
|
||||||
|
if (GVAR(mapTool_isDragging) || GVAR(mapTool_isRotating)) then {
|
||||||
GVAR(mapTool_isDragging) = false;
|
GVAR(mapTool_isDragging) = false;
|
||||||
GVAR(mapTool_isRotating) = false;
|
GVAR(mapTool_isRotating) = false;
|
||||||
_handled = true;
|
_handled = true;
|
||||||
_handled
|
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
// If clicking
|
// If clicking
|
||||||
if (_dir == 1) exitWith {
|
|
||||||
|
|
||||||
if !(call FUNC(canDraw)) exitWith {_handled = false;};
|
if !(call FUNC(canDraw)) exitWith {_handled = false;};
|
||||||
|
|
||||||
// Transform mouse screen position to coordinates
|
// Transform mouse screen position to coordinates
|
||||||
@ -43,7 +42,6 @@ if (_dir == 1) exitWith {
|
|||||||
// Already drawing -> Add tempLineMarker to permanent list
|
// Already drawing -> Add tempLineMarker to permanent list
|
||||||
if (GVAR(drawing_syncMarkers)) then {
|
if (GVAR(drawing_syncMarkers)) then {
|
||||||
deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0);
|
deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0);
|
||||||
// [GVAR(drawing_tempLineMarker), "FUNC(addLineMarker)", 2] call EFUNC(common,execRemoteFnc);
|
|
||||||
["drawing_addLineMarker", GVAR(drawing_tempLineMarker)] call EFUNC(common,globalEvent);
|
["drawing_addLineMarker", GVAR(drawing_tempLineMarker)] call EFUNC(common,globalEvent);
|
||||||
// Log who drew on the briefing screen
|
// Log who drew on the briefing screen
|
||||||
(text format ["[ACE] Server: Player %1 drew on the briefing screen", profileName]) call EFUNC(common,serverLog);
|
(text format ["[ACE] Server: Player %1 drew on the briefing screen", profileName]) call EFUNC(common,serverLog);
|
||||||
@ -90,8 +88,9 @@ if (_dir == 1) exitWith {
|
|||||||
};
|
};
|
||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
_handled
|
_handled
|
||||||
};
|
};
|
||||||
|
|
||||||
|
diag_log text format ["HJa %1", _handled];
|
||||||
|
|
||||||
_handled
|
_handled
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_control", "_mousePosX", "_mousePosY"];
|
params ["_control", "_mousePosX", "_mousePosY"];
|
||||||
|
TRACE_3("params",_control,_mousePosX,_mousePosY);
|
||||||
|
|
||||||
private ["_control", "_pos"];
|
private ["_control", "_pos"];
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ if !(call FUNC(canDraw)) exitWith {
|
|||||||
// Handle drawing
|
// Handle drawing
|
||||||
if (GVAR(drawing_isDrawing)) exitWith {
|
if (GVAR(drawing_isDrawing)) exitWith {
|
||||||
GVAR(drawing_tempLineMarker) set [2, GVAR(mousePosition)];
|
GVAR(drawing_tempLineMarker) set [2, GVAR(mousePosition)];
|
||||||
|
TRACE_1("updating line pos",GVAR(mousePosition));
|
||||||
GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker);
|
GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker);
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
@ -43,8 +45,6 @@ if (GVAR(mapTool_isDragging)) exitWith {
|
|||||||
GVAR(mapTool_pos) set [0, (GVAR(mapTool_startPos) select 0) + (GVAR(mousePosition) select 0) - (GVAR(mapTool_startDragPos) select 0)];
|
GVAR(mapTool_pos) set [0, (GVAR(mapTool_startPos) select 0) + (GVAR(mousePosition) select 0) - (GVAR(mapTool_startDragPos) select 0)];
|
||||||
GVAR(mapTool_pos) set [1, (GVAR(mapTool_startPos) select 1) + (GVAR(mousePosition) select 1) - (GVAR(mapTool_startDragPos) select 1)];
|
GVAR(mapTool_pos) set [1, (GVAR(mapTool_startPos) select 1) + (GVAR(mousePosition) select 1) - (GVAR(mapTool_startDragPos) select 1)];
|
||||||
|
|
||||||
// Update the size and rotation of the maptool
|
|
||||||
[] call FUNC(updateMapToolMarkers);
|
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -55,8 +55,6 @@ if (GVAR(mapTool_isRotating)) exitWith {
|
|||||||
_angle = (180 + ((GVAR(mousePosition) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mousePosition) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360);
|
_angle = (180 + ((GVAR(mousePosition) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mousePosition) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360);
|
||||||
GVAR(mapTool_angle) = GVAR(mapTool_startAngle) + _angle - GVAR(mapTool_startDragAngle);
|
GVAR(mapTool_angle) = GVAR(mapTool_startAngle) + _angle - GVAR(mapTool_startDragAngle);
|
||||||
|
|
||||||
// Update the size and rotation of the maptool
|
|
||||||
[] call FUNC(updateMapToolMarkers);
|
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_name", "_startPos", "_endPos", "_color"];
|
params ["_name", "_startPos", "_endPos", "_color"];
|
||||||
|
TRACE_4("params",_name,_startPos,_endPos,_color);
|
||||||
|
|
||||||
private ["_difPos", "_mag"];
|
private ["_difPos", "_mag"];
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ params ["_theMap"];
|
|||||||
private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"];
|
private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"];
|
||||||
|
|
||||||
// Show/Hide draw buttons
|
// Show/Hide draw buttons
|
||||||
if ("ACE_MapTools" in items ACE_player) then {
|
if ([] call FUNC(canDraw)) then {
|
||||||
{ ((findDisplay 12) displayCtrl _x) ctrlShow true; } forEach GVAR(drawing_controls);
|
{ ((findDisplay 12) displayCtrl _x) ctrlShow true; } forEach GVAR(drawing_controls);
|
||||||
} else {
|
} else {
|
||||||
{ ((findDisplay 12) displayCtrl _x) ctrlShow false; } forEach GVAR(drawing_controls);
|
{ ((findDisplay 12) displayCtrl _x) ctrlShow false; } forEach GVAR(drawing_controls);
|
||||||
|
Loading…
Reference in New Issue
Block a user