diff --git a/addons/maptools/CfgMarkers.hpp b/addons/maptools/CfgMarkers.hpp deleted file mode 100644 index 8a2b86fc13..0000000000 --- a/addons/maptools/CfgMarkers.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// MARKERS -class CfgMarkers { - class ACE_MapToolFixed { - name = "MapToolFixed"; - icon = PATHTOF(data\mapToolFixed.paa); - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; - - class ACE_MapToolRotatingNormal { - name = "MapToolRotating"; - icon = PATHTOF(data\mapToolRotatingNormal.paa); - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; - - class ACE_MapToolRotatingSmall { - name = "MapToolRotating"; - icon = PATHTOF(data\mapToolRotatingSmall.paa); - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; -}; diff --git a/addons/maptools/config.cpp b/addons/maptools/config.cpp index d5b1f26396..6ccf874e69 100644 --- a/addons/maptools/config.cpp +++ b/addons/maptools/config.cpp @@ -32,7 +32,6 @@ class RscEdit; #include "MapGpsUI.hpp" #include "CfgEventHandlers.hpp" -#include "CfgMarkers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" diff --git a/addons/maptools/functions/fnc_addLineMarker.sqf b/addons/maptools/functions/fnc_addLineMarker.sqf index a55792e98a..83e983d0e3 100644 --- a/addons/maptools/functions/fnc_addLineMarker.sqf +++ b/addons/maptools/functions/fnc_addLineMarker.sqf @@ -1,18 +1,18 @@ /* * Author: esteldunedain - * * Add the line marker * - * Argument: - * 0: Marker Name (string) - * 1: Marker start pos (array) - * 2: Marker end pos (array) - * 3: Color index (Number) + * Arguments: + * 0: Marker Name + * 1: Marker start pos + * 2: Marker end pos + * 3: Color index * * Return value: - * Return + * None + * + * Public: No */ - #include "script_component.hpp" _name = _this select 0; @@ -27,16 +27,16 @@ _name setMarkerColorLocal _color; _name setMarkerPosLocal (_startPos vectorAdd (_difPos vectorMultiply 0.5)); _mag = vectorMagnitude _difPos; if (_mag > 0) then { - _name setMarkerSizeLocal [5, _mag / 2]; - _name setMarkerDirLocal (180 + (_difPos select 0) atan2 (_difPos select 1) mod 360); + _name setMarkerSizeLocal [5, _mag / 2]; + _name setMarkerDirLocal (180 + (_difPos select 0) atan2 (_difPos select 1) mod 360); } else { - _name setMarkerSizeLocal [5, 5]; - _name setMarkerDirLocal 0; + _name setMarkerSizeLocal [5, 5]; + _name setMarkerDirLocal 0; }; GVAR(drawing_lineMarkers) pushBack (+_this); if (isServer && GVAR(drawing_syncMarkers)) then { - GVAR(drawing_serverLineMarkers) pushBack (+_this); - publicVariable QGVAR(drawing_serverLineMarkers); + GVAR(drawing_serverLineMarkers) pushBack (+_this); + publicVariable QGVAR(drawing_serverLineMarkers); }; diff --git a/addons/maptools/functions/fnc_calculateMapScale.sqf b/addons/maptools/functions/fnc_calculateMapScale.sqf index d8ed1cfcb9..700e089a88 100644 --- a/addons/maptools/functions/fnc_calculateMapScale.sqf +++ b/addons/maptools/functions/fnc_calculateMapScale.sqf @@ -1,15 +1,15 @@ /* * Author: esteldunedain - * * Returns the equivalent of 100m in screen coordinates * - * Argument: + * Arguments: * None * * Return value: - * Return + * No + * + * Public: No */ - #include "script_component.hpp" _pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5]; diff --git a/addons/maptools/functions/fnc_canDraw.sqf b/addons/maptools/functions/fnc_canDraw.sqf index a5088f668b..da55043d85 100644 --- a/addons/maptools/functions/fnc_canDraw.sqf +++ b/addons/maptools/functions/fnc_canDraw.sqf @@ -1,5 +1,15 @@ -// by esteldunedain - +/* + * Author: esteldunedain + * canDraw + * + * Arguments: + * None + * + * Return value: + * + * + * Public: No + */ #include "script_component.hpp" (missionNameSpace getVariable [QGVAR(drawing_syncMarkers), true] && {GVAR(EveryoneCanDrawOnBriefing)}) || diff --git a/addons/maptools/functions/fnc_canUseMapGPS.sqf b/addons/maptools/functions/fnc_canUseMapGPS.sqf index f3d0b10c56..381136a1cc 100644 --- a/addons/maptools/functions/fnc_canUseMapGPS.sqf +++ b/addons/maptools/functions/fnc_canUseMapGPS.sqf @@ -1,5 +1,15 @@ -// by esteldunedain - +/* + * Author: esteldunedain + * canUseMapGPS + * + * Arguments: + * None + * + * Return value: + * + * + * Public: No + */ #include "script_component.hpp" visibleMap && diff --git a/addons/maptools/functions/fnc_canUseMapTools.sqf b/addons/maptools/functions/fnc_canUseMapTools.sqf index fe0bf012da..30d86160ab 100644 --- a/addons/maptools/functions/fnc_canUseMapTools.sqf +++ b/addons/maptools/functions/fnc_canUseMapTools.sqf @@ -1,5 +1,15 @@ -// by esteldunedain - +/* + * Author: esteldunedain + * canUseMapTools + * + * Arguments: + * None + * + * Return value: + * + * + * Public: No + */ #include "script_component.hpp" visibleMap && diff --git a/addons/maptools/functions/fnc_cancelDrawing.sqf b/addons/maptools/functions/fnc_cancelDrawing.sqf index 09396e61fe..bc80602cfc 100644 --- a/addons/maptools/functions/fnc_cancelDrawing.sqf +++ b/addons/maptools/functions/fnc_cancelDrawing.sqf @@ -1,19 +1,19 @@ /* * Author: esteldunedain - * * Cancel the drawing of the current line marker * - * Argument: + * Arguments: * None * * Return value: - * Nothing + * None + * + * Public: No */ - #include "script_component.hpp" GVAR(drawing_isDrawing) = false; if (count GVAR(drawing_tempLineMarker) > 0) then { - deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0); + deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0); }; GVAR(drawing_tempLineMarker) = []; diff --git a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf index d2675a2b06..e3de77316a 100644 --- a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf +++ b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf @@ -1,23 +1,23 @@ /* * Author: esteldunedain - * * Copy recieved markers to map * - * Argument: - * 0: Array of markers to copy (Array) + * Arguments: + * 0: Array of markers to copy * * Return value: - * Return + * None + * + * Public: No */ - #include "script_component.hpp" PARAMS_1(_lineMarkers); { - _marker = _x; - //Add marker if we don't already have it - if (({(_x select 0) == (_marker select 0)} count GVAR(drawing_lineMarkers)) == 0) then { - _marker call FUNC(addLineMarker); - }; + _marker = _x; + //Add marker if we don't already have it + if (({(_x select 0) == (_marker select 0)} count GVAR(drawing_lineMarkers)) == 0) then { + _marker call FUNC(addLineMarker); + }; } forEach _lineMarkers; diff --git a/addons/maptools/functions/fnc_copyMapStart.sqf b/addons/maptools/functions/fnc_copyMapStart.sqf index 11464d7573..a39c74d225 100644 --- a/addons/maptools/functions/fnc_copyMapStart.sqf +++ b/addons/maptools/functions/fnc_copyMapStart.sqf @@ -1,11 +1,10 @@ /* * Author: esteldunedain - * * Send request to remote player * - * Argument: - * 0: Player (Unit) - * 0: Target player (Unit) + * Arguments: + * 0: Player + * 0: Target player * * Code Chain: * START: copyMapStart: triggers event drawing_requestMarkers on remote diff --git a/addons/maptools/functions/fnc_handleKeyDown.sqf b/addons/maptools/functions/fnc_handleKeyDown.sqf index 4553ed62ab..d2b3a060b8 100644 --- a/addons/maptools/functions/fnc_handleKeyDown.sqf +++ b/addons/maptools/functions/fnc_handleKeyDown.sqf @@ -1,9 +1,8 @@ /* * Author: esteldunedain - * * Handle key down on map. * - * Argument: + * Arguments: * 0: Display (display) * 1: Key code (number) * 2: Shift Key (boolean) @@ -30,45 +29,45 @@ _handled = false; // If pressed Esc while drawing if (_code == DIK_ESCAPE) exitWith { - if (GVAR(drawing_isDrawing)) then { - call FUNC(cancelDrawing); - _handled = true; - }; + if (GVAR(drawing_isDrawing)) then { + call FUNC(cancelDrawing); + _handled = true; + }; }; if (_code == DIK_DELETE) exitWith { - if (GVAR(drawing_isDrawing)) then { - call FUNC(cancelDrawing); - _handled = true; - } else { - - // Check if a line marker needs to be deleted - { - _relPos = GVAR(mousePosition) vectorDiff (_x select 1); - _diffVector = (_x select 2) vectorDiff (_x select 1); - _magDiffVector = vectorMagnitude _diffVector; - if (_magDiffVector == 0) then { - _diffVector = [10,0,0]; - _magDiffVector = vectorMagnitude _diffVector; - }; - _diffVector = _diffVector vectorMultiply (1/_magDiffVector); - - // Projection of the relative position over the longitudinal axis - _lambdaLong = _diffVector vectorDotProduct _relPos; - // Projection of the relative position over the trasversal axis - _lambdaTrasAbs = vectorMagnitude (_relPos vectorDiff (_diffVector vectorMultiply _lambdaLong)); - if (_lambdaLong >= 0 && _lambdaLong <= _magDiffVector && _lambdaTrasAbs <= 5) exitWith { - // Delete the line marker - if (GVAR(drawing_syncMarkers)) then { - ["drawing_removeLineMarker", [_x select 0]] call EFUNC(common,globalEvent); - } else { - deleteMarkerLocal (_x select 0); - GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x]; - }; + if (GVAR(drawing_isDrawing)) then { + call FUNC(cancelDrawing); _handled = true; - }; - } forEach GVAR(drawing_lineMarkers); - }; + } else { + + // Check if a line marker needs to be deleted + { + _relPos = GVAR(mousePosition) vectorDiff (_x select 1); + _diffVector = (_x select 2) vectorDiff (_x select 1); + _magDiffVector = vectorMagnitude _diffVector; + if (_magDiffVector == 0) then { + _diffVector = [10,0,0]; + _magDiffVector = vectorMagnitude _diffVector; + }; + _diffVector = _diffVector vectorMultiply (1/_magDiffVector); + + // Projection of the relative position over the longitudinal axis + _lambdaLong = _diffVector vectorDotProduct _relPos; + // Projection of the relative position over the trasversal axis + _lambdaTrasAbs = vectorMagnitude (_relPos vectorDiff (_diffVector vectorMultiply _lambdaLong)); + if (_lambdaLong >= 0 && _lambdaLong <= _magDiffVector && _lambdaTrasAbs <= 5) exitWith { + // Delete the line marker + if (GVAR(drawing_syncMarkers)) then { + ["drawing_removeLineMarker", [_x select 0]] call EFUNC(common,globalEvent); + } else { + deleteMarkerLocal (_x select 0); + GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x]; + }; + _handled = true; + }; + } forEach GVAR(drawing_lineMarkers); + }; }; _handled diff --git a/addons/maptools/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf index 99c36f1581..4111c8fad4 100644 --- a/addons/maptools/functions/fnc_handleMouseMove.sqf +++ b/addons/maptools/functions/fnc_handleMouseMove.sqf @@ -22,18 +22,18 @@ GVAR(mousePosition) set [2, 0]; //convert 2d pos to 3d // If cannot draw then exit if !(call FUNC(canDraw)) exitWith { - // If was drawing, cancel - if (GVAR(drawing_isDrawing)) then { - call FUNC(cancelDrawing); - }; - false + // If was drawing, cancel + if (GVAR(drawing_isDrawing)) then { + call FUNC(cancelDrawing); + }; + false }; // Handle drawing if (GVAR(drawing_isDrawing)) exitWith { - GVAR(drawing_tempLineMarker) set [2, GVAR(mousePosition)]; - GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker); - false + GVAR(drawing_tempLineMarker) set [2, GVAR(mousePosition)]; + GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker); + false }; // Handle Map tools @@ -41,23 +41,23 @@ if (GVAR(mapTool_Shown) == 0) exitWith {false}; // Translation 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 [1, (GVAR(mapTool_startPos) select 1) + (GVAR(mousePosition) select 1) - (GVAR(mapTool_startDragPos) select 1)]; + 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)]; - // Update the size and rotation of the maptool - [] call FUNC(updateMapToolMarkers); - true + // Update the size and rotation of the maptool + [] call FUNC(updateMapToolMarkers); + true }; // Rotation if (GVAR(mapTool_isRotating)) exitWith { - // Get new angle - _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); + // Get new angle + _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); - // Update the size and rotation of the maptool - [] call FUNC(updateMapToolMarkers); - true + // Update the size and rotation of the maptool + [] call FUNC(updateMapToolMarkers); + true }; false diff --git a/addons/maptools/functions/fnc_handleMouseZChanged.sqf b/addons/maptools/functions/fnc_handleMouseZChanged.sqf index 483efc56b7..35626238e5 100644 --- a/addons/maptools/functions/fnc_handleMouseZChanged.sqf +++ b/addons/maptools/functions/fnc_handleMouseZChanged.sqf @@ -29,16 +29,16 @@ _handled = true; // ACE_Map_drawColors is never defined /* if (count GVAR(drawing_tempLineMarker) > 0) then { - ACE_Map_drawColor = if (_dir > 0) then {ACE_Map_drawColor + 1} else {ACE_Map_drawColor - 1}; - if (ACE_Map_drawColor >= count ACE_Map_drawColors) then { +ACE_Map_drawColor = if (_dir > 0) then {ACE_Map_drawColor + 1} else {ACE_Map_drawColor - 1}; +if (ACE_Map_drawColor >= count ACE_Map_drawColors) then { ACE_Map_drawColor = ACE_Map_drawColor - count ACE_Map_drawColors; - }; - if (ACE_Map_drawColor < 0) then { +}; +if (ACE_Map_drawColor < 0) then { ACE_Map_drawColor = ACE_Map_drawColor + count ACE_Map_drawColors; - }; - GVAR(drawing_tempLineMarker) set [3, ACE_Map_drawColor]; - GVAR(drawing_tempLineMarker) call ACE_Map_fnc_updateLineMarker; +}; +GVAR(drawing_tempLineMarker) set [3, ACE_Map_drawColor]; +GVAR(drawing_tempLineMarker) call ACE_Map_fnc_updateLineMarker; - _handled = true; +_handled = true; }; */ _handled diff --git a/addons/maptools/functions/fnc_isInsideMapTool.sqf b/addons/maptools/functions/fnc_isInsideMapTool.sqf index b4d4fc8814..4dd66e2b9a 100644 --- a/addons/maptools/functions/fnc_isInsideMapTool.sqf +++ b/addons/maptools/functions/fnc_isInsideMapTool.sqf @@ -1,16 +1,14 @@ /* * Author: esteldunedain - * * Return true if the position is inside the map marker (to allow dragging). * - * Argument: - * 0: x Position (in meters) - * 1: y Position (in meters) + * Arguments: + * 0: x Position (in meters) + * 1: y Position (in meters) * * Return value: * Boolean */ - #include "script_component.hpp" #define TEXTURE_WIDTH_IN_M 6205 @@ -19,7 +17,6 @@ #define DIST_LEFT_TO_CENTER_PERC 0.30 - if (GVAR(mapTool_Shown) == 0) exitWith {false}; _textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapTool_Shown) - 1); diff --git a/addons/maptools/functions/fnc_mapStateUpdater.sqf b/addons/maptools/functions/fnc_mapStateUpdater.sqf index ffe331df71..2b4e634567 100644 --- a/addons/maptools/functions/fnc_mapStateUpdater.sqf +++ b/addons/maptools/functions/fnc_mapStateUpdater.sqf @@ -2,32 +2,32 @@ #include "script_component.hpp" if (visibleMap) then { - // Show/Hide draw buttons - if ("ACE_MapTools" in items ACE_player) then { - { ((finddisplay 12) displayctrl _x) ctrlShow true; } forEach GVAR(drawing_controls); - } else { - { ((finddisplay 12) displayctrl _x) ctrlShow false; } forEach GVAR(drawing_controls); - if (GVAR(drawing_isDrawing)) then { - call FUNC(cancelDrawing); + // Show/Hide draw buttons + if ("ACE_MapTools" in items ACE_player) then { + { ((finddisplay 12) displayctrl _x) ctrlShow true; } forEach GVAR(drawing_controls); + } else { + { ((finddisplay 12) displayctrl _x) ctrlShow false; } forEach GVAR(drawing_controls); + if (GVAR(drawing_isDrawing)) then { + call FUNC(cancelDrawing); + }; }; - }; }; //When Map is Closed: if (GVAR(mapVisableLastFrame) && (!visibleMap)) then { - GVAR(mapVisableLastFrame) = false; - // Hide GPS - [false] call FUNC(openMapGps); - // Cancel drawing - call FUNC(cancelDrawing); + GVAR(mapVisableLastFrame) = false; + // Hide GPS + [false] call FUNC(openMapGps); + // Cancel drawing + call FUNC(cancelDrawing); }; //When Map is Opened: if ((!GVAR(mapVisableLastFrame)) && (visibleMap)) then { - //todo: "mapOpened" Event???? - GVAR(mapVisableLastFrame) = true; - // Show and update map tools if required - [] call FUNC(updateMapToolMarkers); - // Show GPS if required - [GVAR(mapGpsShow)] call FUNC(openMapGps); + //todo: "mapOpened" Event???? + GVAR(mapVisableLastFrame) = true; + // Show and update map tools if required + [] call FUNC(updateMapToolMarkers); + // Show GPS if required + [GVAR(mapGpsShow)] call FUNC(openMapGps); }; diff --git a/addons/maptools/functions/fnc_openMapGps.sqf b/addons/maptools/functions/fnc_openMapGps.sqf index 03b3f5525c..c4e2436b3b 100644 --- a/addons/maptools/functions/fnc_openMapGps.sqf +++ b/addons/maptools/functions/fnc_openMapGps.sqf @@ -1,25 +1,24 @@ /* -* Author: esteldunedain -* -* Opens or closes the gps on the map screen, showing coordinates -* -* Argument: -* 0: Open GPS? (Boolean) -* -* Return value: -* Nothing -*/ - + * Author: esteldunedain + * Opens or closes the gps on the map screen, showing coordinates + * + * Arguments: + * 0: Open GPS? + * + * Return value: + * Nothing + * + * Public: No + */ #include "script_component.hpp" _shouldOpenGps = _this select 0; _isOpen = !(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])); if (_shouldOpenGps && {"ItemGPS" in assignedItems ACE_player} && {!_isOpen}) then { - ("RscACE_MapGps" call BIS_fnc_rscLayer) cutRsc ["RscACE_MapGps","PLAIN"]; + ("RscACE_MapGps" call BIS_fnc_rscLayer) cutRsc ["RscACE_MapGps","PLAIN"]; - [FUNC(openMapGpsUpdate), 0.5, []] call CBA_fnc_addPerFrameHandler; //update bearing/altitude every 0.5 sec (ticktime) + [FUNC(openMapGpsUpdate), 0.5, []] call CBA_fnc_addPerFrameHandler; //update bearing/altitude every 0.5 sec (ticktime) } else { - ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; + ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; }; - diff --git a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf index a26a02dd34..ddc177f182 100644 --- a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf +++ b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf @@ -11,8 +11,8 @@ disableSerialization; _mapGpsDisplay = uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull]; _ctrl = _mapGpsDisplay displayCtrl 913590; -_ctrl ctrlSetText str(round(getDir player)); //set Heading +_ctrl ctrlSetText str(round(getDir ACE_player)); //set Heading _ctrl = _mapGpsDisplay displayCtrl 913591; -_ctrl ctrlSetText str(round((getPosASL player) select 2)); //set Altitude +_ctrl ctrlSetText str(round((getPosASL ACE_player) select 2)); //set Altitude _ctrl = _mapGpsDisplay displayCtrl 913592; -_ctrl ctrlSetText mapGridPosition player; //set grid cords +_ctrl ctrlSetText mapGridPosition ACE_player; //set grid cords diff --git a/addons/maptools/functions/fnc_removeLineMarker.sqf b/addons/maptools/functions/fnc_removeLineMarker.sqf index 15af48217e..45c39611db 100644 --- a/addons/maptools/functions/fnc_removeLineMarker.sqf +++ b/addons/maptools/functions/fnc_removeLineMarker.sqf @@ -1,10 +1,9 @@ /* * Author: esteldunedain - * * Remove the line marker * - * Argument: - * 0: Marker Name (string) + * Arguments: + * 0: Marker Name * * Return value: * Return @@ -12,20 +11,20 @@ #include "script_component.hpp" - _name = _this select 0; +_name = _this select 0; - deleteMarkerLocal _name; +deleteMarkerLocal _name; { - if ((_x select 0) == _name) exitWith { - GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x]; - }; + if ((_x select 0) == _name) exitWith { + GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x]; + }; } forEach GVAR(drawing_lineMarkers); if (isServer && GVAR(drawing_syncMarkers)) then { - { - if ((_x select 0) == _name) exitWith { - GVAR(drawing_serverLineMarkers) = GVAR(drawing_serverLineMarkers) - [_x]; - publicVariable QGVAR(drawing_serverLineMarkers); - }; - } forEach GVAR(drawing_serverLineMarkers); + { + if ((_x select 0) == _name) exitWith { + GVAR(drawing_serverLineMarkers) = GVAR(drawing_serverLineMarkers) - [_x]; + publicVariable QGVAR(drawing_serverLineMarkers); + }; + } forEach GVAR(drawing_serverLineMarkers); }; diff --git a/addons/maptools/functions/fnc_updateLineMarker.sqf b/addons/maptools/functions/fnc_updateLineMarker.sqf index 9635dc02fa..cf80c1ac26 100644 --- a/addons/maptools/functions/fnc_updateLineMarker.sqf +++ b/addons/maptools/functions/fnc_updateLineMarker.sqf @@ -1,24 +1,22 @@ /* * Author: esteldunedain - * * Updates the line marker position and scale * - * Argument: - * 0: Marker Name (string) - * 1: Marker start pos (array) - * 2: Marker end pos (array) - * 3: Color index (Number) + * Arguments: + * 0: Marker Name + * 1: Marker start pos + * 2: Marker end pos + * 3: Color index * * Return value: - * Return + * None */ - #include "script_component.hpp" - _name = _this select 0; - _startPos = _this select 1; - _difPos = (_this select 2) vectorDiff _startPos ; - _color = _this select 3; +_name = _this select 0; +_startPos = _this select 1; +_difPos = (_this select 2) vectorDiff _startPos ; +_color = _this select 3; _name setMarkerShapeLocal "RECTANGLE"; _name setMarkerAlphaLocal 1; @@ -26,9 +24,9 @@ _name setMarkerColorLocal GVAR(drawing_drawColor); _name setMarkerPosLocal (_startPos vectorAdd (_difPos vectorMultiply 0.5)); _mag = vectorMagnitude _difPos; if (_mag > 0) then { - _name setMarkerSizeLocal [5, _mag / 2]; - _name setMarkerDirLocal (180 + (_difPos select 0) atan2 (_difPos select 1) mod 360); + _name setMarkerSizeLocal [5, _mag / 2]; + _name setMarkerDirLocal (180 + (_difPos select 0) atan2 (_difPos select 1) mod 360); } else { - _name setMarkerSizeLocal [5, 5]; - _name setMarkerDirLocal 0; + _name setMarkerSizeLocal [5, 5]; + _name setMarkerDirLocal 0; }; diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index 13967413f6..3a7b919b8b 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -7,8 +7,9 @@ * * Return value: * Nothing + * + * Public: No */ - #include "script_component.hpp" #define TEXTURE_WIDTH_IN_M 6205 diff --git a/addons/maptools/script_component.hpp b/addons/maptools/script_component.hpp index df2a8d3f62..30a9f83d0d 100644 --- a/addons/maptools/script_component.hpp +++ b/addons/maptools/script_component.hpp @@ -10,8 +10,3 @@ #endif #include "\z\ace\Addons\main\script_macros.hpp" - - -#define MARKERNAME_MAPTOOL_FIXED "ACE_MapToolFixed" -#define MARKERNAME_MAPTOOL_ROTATINGNORMAL "ACE_MapToolRotatingNormal" -#define MARKERNAME_MAPTOOL_ROTATINGSMALL "ACE_MapToolRotatingSmall"