mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cleanup / Headers
This commit is contained in:
parent
2ad9193475
commit
6b0fb84f65
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
@ -32,7 +32,6 @@ class RscEdit;
|
|||||||
|
|
||||||
#include "MapGpsUI.hpp"
|
#include "MapGpsUI.hpp"
|
||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
#include "CfgMarkers.hpp"
|
|
||||||
#include "CfgVehicles.hpp"
|
#include "CfgVehicles.hpp"
|
||||||
#include "CfgWeapons.hpp"
|
#include "CfgWeapons.hpp"
|
||||||
|
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
*
|
|
||||||
* Add the line marker
|
* Add the line marker
|
||||||
*
|
*
|
||||||
* Argument:
|
* Arguments:
|
||||||
* 0: Marker Name (string)
|
* 0: Marker Name <STRING>
|
||||||
* 1: Marker start pos (array)
|
* 1: Marker start pos <ARRAY>
|
||||||
* 2: Marker end pos (array)
|
* 2: Marker end pos <ARRAY>
|
||||||
* 3: Color index (Number)
|
* 3: Color index <NUMBER>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Return
|
* None
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_name = _this select 0;
|
_name = _this select 0;
|
||||||
@ -27,16 +27,16 @@ _name setMarkerColorLocal _color;
|
|||||||
_name setMarkerPosLocal (_startPos vectorAdd (_difPos vectorMultiply 0.5));
|
_name setMarkerPosLocal (_startPos vectorAdd (_difPos vectorMultiply 0.5));
|
||||||
_mag = vectorMagnitude _difPos;
|
_mag = vectorMagnitude _difPos;
|
||||||
if (_mag > 0) then {
|
if (_mag > 0) then {
|
||||||
_name setMarkerSizeLocal [5, _mag / 2];
|
_name setMarkerSizeLocal [5, _mag / 2];
|
||||||
_name setMarkerDirLocal (180 + (_difPos select 0) atan2 (_difPos select 1) mod 360);
|
_name setMarkerDirLocal (180 + (_difPos select 0) atan2 (_difPos select 1) mod 360);
|
||||||
} else {
|
} else {
|
||||||
_name setMarkerSizeLocal [5, 5];
|
_name setMarkerSizeLocal [5, 5];
|
||||||
_name setMarkerDirLocal 0;
|
_name setMarkerDirLocal 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(drawing_lineMarkers) pushBack (+_this);
|
GVAR(drawing_lineMarkers) pushBack (+_this);
|
||||||
|
|
||||||
if (isServer && GVAR(drawing_syncMarkers)) then {
|
if (isServer && GVAR(drawing_syncMarkers)) then {
|
||||||
GVAR(drawing_serverLineMarkers) pushBack (+_this);
|
GVAR(drawing_serverLineMarkers) pushBack (+_this);
|
||||||
publicVariable QGVAR(drawing_serverLineMarkers);
|
publicVariable QGVAR(drawing_serverLineMarkers);
|
||||||
};
|
};
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
*
|
|
||||||
* Returns the equivalent of 100m in screen coordinates
|
* Returns the equivalent of 100m in screen coordinates
|
||||||
*
|
*
|
||||||
* Argument:
|
* Arguments:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Return
|
* No
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5];
|
_pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5];
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
// by esteldunedain
|
/*
|
||||||
|
* Author: esteldunedain
|
||||||
|
* canDraw
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return value:
|
||||||
|
* <BOOL>
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
(missionNameSpace getVariable [QGVAR(drawing_syncMarkers), true] && {GVAR(EveryoneCanDrawOnBriefing)}) ||
|
(missionNameSpace getVariable [QGVAR(drawing_syncMarkers), true] && {GVAR(EveryoneCanDrawOnBriefing)}) ||
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
// by esteldunedain
|
/*
|
||||||
|
* Author: esteldunedain
|
||||||
|
* canUseMapGPS
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return value:
|
||||||
|
* <BOOL>
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
visibleMap &&
|
visibleMap &&
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
// by esteldunedain
|
/*
|
||||||
|
* Author: esteldunedain
|
||||||
|
* canUseMapTools
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return value:
|
||||||
|
* <BOOL>
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
visibleMap &&
|
visibleMap &&
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
*
|
|
||||||
* Cancel the drawing of the current line marker
|
* Cancel the drawing of the current line marker
|
||||||
*
|
*
|
||||||
* Argument:
|
* Arguments:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Nothing
|
* None
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
GVAR(drawing_isDrawing) = false;
|
GVAR(drawing_isDrawing) = false;
|
||||||
if (count GVAR(drawing_tempLineMarker) > 0) then {
|
if (count GVAR(drawing_tempLineMarker) > 0) then {
|
||||||
deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0);
|
deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0);
|
||||||
};
|
};
|
||||||
GVAR(drawing_tempLineMarker) = [];
|
GVAR(drawing_tempLineMarker) = [];
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
*
|
|
||||||
* Copy recieved markers to map
|
* Copy recieved markers to map
|
||||||
*
|
*
|
||||||
* Argument:
|
* Arguments:
|
||||||
* 0: Array of markers to copy (Array)
|
* 0: Array of markers to copy <ARRAY>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Return
|
* None
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_1(_lineMarkers);
|
PARAMS_1(_lineMarkers);
|
||||||
|
|
||||||
{
|
{
|
||||||
_marker = _x;
|
_marker = _x;
|
||||||
//Add marker if we don't already have it
|
//Add marker if we don't already have it
|
||||||
if (({(_x select 0) == (_marker select 0)} count GVAR(drawing_lineMarkers)) == 0) then {
|
if (({(_x select 0) == (_marker select 0)} count GVAR(drawing_lineMarkers)) == 0) then {
|
||||||
_marker call FUNC(addLineMarker);
|
_marker call FUNC(addLineMarker);
|
||||||
};
|
};
|
||||||
} forEach _lineMarkers;
|
} forEach _lineMarkers;
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
*
|
|
||||||
* Send request to remote player
|
* Send request to remote player
|
||||||
*
|
*
|
||||||
* Argument:
|
* Arguments:
|
||||||
* 0: Player (Unit)
|
* 0: Player <OBJECT>
|
||||||
* 0: Target player (Unit)
|
* 0: Target player <OBJECT>
|
||||||
*
|
*
|
||||||
* Code Chain:
|
* Code Chain:
|
||||||
* START: copyMapStart: triggers event drawing_requestMarkers on remote
|
* START: copyMapStart: triggers event drawing_requestMarkers on remote
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
*
|
|
||||||
* Handle key down on map.
|
* Handle key down on map.
|
||||||
*
|
*
|
||||||
* Argument:
|
* Arguments:
|
||||||
* 0: Display (display)
|
* 0: Display (display)
|
||||||
* 1: Key code (number)
|
* 1: Key code (number)
|
||||||
* 2: Shift Key (boolean)
|
* 2: Shift Key (boolean)
|
||||||
@ -30,45 +29,45 @@ _handled = false;
|
|||||||
|
|
||||||
// If pressed Esc while drawing
|
// If pressed Esc while drawing
|
||||||
if (_code == DIK_ESCAPE) exitWith {
|
if (_code == DIK_ESCAPE) exitWith {
|
||||||
if (GVAR(drawing_isDrawing)) then {
|
if (GVAR(drawing_isDrawing)) then {
|
||||||
call FUNC(cancelDrawing);
|
call FUNC(cancelDrawing);
|
||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_code == DIK_DELETE) exitWith {
|
if (_code == DIK_DELETE) exitWith {
|
||||||
if (GVAR(drawing_isDrawing)) then {
|
if (GVAR(drawing_isDrawing)) then {
|
||||||
call FUNC(cancelDrawing);
|
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];
|
|
||||||
};
|
|
||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
} else {
|
||||||
} forEach GVAR(drawing_lineMarkers);
|
|
||||||
};
|
// 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
|
_handled
|
||||||
|
@ -22,18 +22,18 @@ GVAR(mousePosition) set [2, 0]; //convert 2d pos to 3d
|
|||||||
|
|
||||||
// If cannot draw then exit
|
// If cannot draw then exit
|
||||||
if !(call FUNC(canDraw)) exitWith {
|
if !(call FUNC(canDraw)) exitWith {
|
||||||
// If was drawing, cancel
|
// If was drawing, cancel
|
||||||
if (GVAR(drawing_isDrawing)) then {
|
if (GVAR(drawing_isDrawing)) then {
|
||||||
call FUNC(cancelDrawing);
|
call FUNC(cancelDrawing);
|
||||||
};
|
};
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
// 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)];
|
||||||
GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker);
|
GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker);
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle Map tools
|
// Handle Map tools
|
||||||
@ -41,23 +41,23 @@ if (GVAR(mapTool_Shown) == 0) exitWith {false};
|
|||||||
|
|
||||||
// Translation
|
// Translation
|
||||||
if (GVAR(mapTool_isDragging)) exitWith {
|
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
|
// Update the size and rotation of the maptool
|
||||||
[] call FUNC(updateMapToolMarkers);
|
[] call FUNC(updateMapToolMarkers);
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
|
|
||||||
// Rotation
|
// Rotation
|
||||||
if (GVAR(mapTool_isRotating)) exitWith {
|
if (GVAR(mapTool_isRotating)) exitWith {
|
||||||
// Get new angle
|
// 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);
|
_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
|
// Update the size and rotation of the maptool
|
||||||
[] call FUNC(updateMapToolMarkers);
|
[] call FUNC(updateMapToolMarkers);
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
|
|
||||||
false
|
false
|
||||||
|
@ -29,16 +29,16 @@ _handled = true;
|
|||||||
// ACE_Map_drawColors is never defined
|
// ACE_Map_drawColors is never defined
|
||||||
|
|
||||||
/* if (count GVAR(drawing_tempLineMarker) > 0) then {
|
/* if (count GVAR(drawing_tempLineMarker) > 0) then {
|
||||||
ACE_Map_drawColor = if (_dir > 0) then {ACE_Map_drawColor + 1} else {ACE_Map_drawColor - 1};
|
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 {
|
if (ACE_Map_drawColor >= count ACE_Map_drawColors) then {
|
||||||
ACE_Map_drawColor = ACE_Map_drawColor - count ACE_Map_drawColors;
|
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;
|
ACE_Map_drawColor = ACE_Map_drawColor + count ACE_Map_drawColors;
|
||||||
};
|
};
|
||||||
GVAR(drawing_tempLineMarker) set [3, ACE_Map_drawColor];
|
GVAR(drawing_tempLineMarker) set [3, ACE_Map_drawColor];
|
||||||
GVAR(drawing_tempLineMarker) call ACE_Map_fnc_updateLineMarker;
|
GVAR(drawing_tempLineMarker) call ACE_Map_fnc_updateLineMarker;
|
||||||
|
|
||||||
_handled = true;
|
_handled = true;
|
||||||
}; */
|
}; */
|
||||||
_handled
|
_handled
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
*
|
|
||||||
* Return true if the position is inside the map marker (to allow dragging).
|
* Return true if the position is inside the map marker (to allow dragging).
|
||||||
*
|
*
|
||||||
* Argument:
|
* Arguments:
|
||||||
* 0: x Position (in meters)
|
* 0: x Position (in meters) <NUMBER>
|
||||||
* 1: y Position (in meters)
|
* 1: y Position (in meters) <NUMBER>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Boolean
|
* Boolean
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#define TEXTURE_WIDTH_IN_M 6205
|
#define TEXTURE_WIDTH_IN_M 6205
|
||||||
@ -19,7 +17,6 @@
|
|||||||
#define DIST_LEFT_TO_CENTER_PERC 0.30
|
#define DIST_LEFT_TO_CENTER_PERC 0.30
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (GVAR(mapTool_Shown) == 0) exitWith {false};
|
if (GVAR(mapTool_Shown) == 0) exitWith {false};
|
||||||
_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapTool_Shown) - 1);
|
_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapTool_Shown) - 1);
|
||||||
|
|
||||||
|
@ -2,32 +2,32 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if (visibleMap) then {
|
if (visibleMap) then {
|
||||||
// Show/Hide draw buttons
|
// Show/Hide draw buttons
|
||||||
if ("ACE_MapTools" in items ACE_player) then {
|
if ("ACE_MapTools" in items ACE_player) 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);
|
||||||
if (GVAR(drawing_isDrawing)) then {
|
if (GVAR(drawing_isDrawing)) then {
|
||||||
call FUNC(cancelDrawing);
|
call FUNC(cancelDrawing);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//When Map is Closed:
|
//When Map is Closed:
|
||||||
if (GVAR(mapVisableLastFrame) && (!visibleMap)) then {
|
if (GVAR(mapVisableLastFrame) && (!visibleMap)) then {
|
||||||
GVAR(mapVisableLastFrame) = false;
|
GVAR(mapVisableLastFrame) = false;
|
||||||
// Hide GPS
|
// Hide GPS
|
||||||
[false] call FUNC(openMapGps);
|
[false] call FUNC(openMapGps);
|
||||||
// Cancel drawing
|
// Cancel drawing
|
||||||
call FUNC(cancelDrawing);
|
call FUNC(cancelDrawing);
|
||||||
};
|
};
|
||||||
|
|
||||||
//When Map is Opened:
|
//When Map is Opened:
|
||||||
if ((!GVAR(mapVisableLastFrame)) && (visibleMap)) then {
|
if ((!GVAR(mapVisableLastFrame)) && (visibleMap)) then {
|
||||||
//todo: "mapOpened" Event????
|
//todo: "mapOpened" Event????
|
||||||
GVAR(mapVisableLastFrame) = true;
|
GVAR(mapVisableLastFrame) = true;
|
||||||
// Show and update map tools if required
|
// Show and update map tools if required
|
||||||
[] call FUNC(updateMapToolMarkers);
|
[] call FUNC(updateMapToolMarkers);
|
||||||
// Show GPS if required
|
// Show GPS if required
|
||||||
[GVAR(mapGpsShow)] call FUNC(openMapGps);
|
[GVAR(mapGpsShow)] call FUNC(openMapGps);
|
||||||
};
|
};
|
||||||
|
@ -1,25 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
*
|
* Opens or closes the gps on the map screen, showing coordinates
|
||||||
* Opens or closes the gps on the map screen, showing coordinates
|
*
|
||||||
*
|
* Arguments:
|
||||||
* Argument:
|
* 0: Open GPS? <BOOL>
|
||||||
* 0: Open GPS? (Boolean)
|
*
|
||||||
*
|
* Return value:
|
||||||
* Return value:
|
* Nothing
|
||||||
* Nothing
|
*
|
||||||
*/
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_shouldOpenGps = _this select 0;
|
_shouldOpenGps = _this select 0;
|
||||||
_isOpen = !(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull]));
|
_isOpen = !(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull]));
|
||||||
|
|
||||||
if (_shouldOpenGps && {"ItemGPS" in assignedItems ACE_player} && {!_isOpen}) then {
|
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 {
|
} else {
|
||||||
("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ disableSerialization;
|
|||||||
|
|
||||||
_mapGpsDisplay = uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull];
|
_mapGpsDisplay = uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull];
|
||||||
_ctrl = _mapGpsDisplay displayCtrl 913590;
|
_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 = _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 = _mapGpsDisplay displayCtrl 913592;
|
||||||
_ctrl ctrlSetText mapGridPosition player; //set grid cords
|
_ctrl ctrlSetText mapGridPosition ACE_player; //set grid cords
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
*
|
|
||||||
* Remove the line marker
|
* Remove the line marker
|
||||||
*
|
*
|
||||||
* Argument:
|
* Arguments:
|
||||||
* 0: Marker Name (string)
|
* 0: Marker Name <STRING>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Return
|
* Return
|
||||||
@ -12,20 +11,20 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_name = _this select 0;
|
_name = _this select 0;
|
||||||
|
|
||||||
deleteMarkerLocal _name;
|
deleteMarkerLocal _name;
|
||||||
{
|
{
|
||||||
if ((_x select 0) == _name) exitWith {
|
if ((_x select 0) == _name) exitWith {
|
||||||
GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x];
|
GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x];
|
||||||
};
|
};
|
||||||
} forEach GVAR(drawing_lineMarkers);
|
} forEach GVAR(drawing_lineMarkers);
|
||||||
|
|
||||||
if (isServer && GVAR(drawing_syncMarkers)) then {
|
if (isServer && GVAR(drawing_syncMarkers)) then {
|
||||||
{
|
{
|
||||||
if ((_x select 0) == _name) exitWith {
|
if ((_x select 0) == _name) exitWith {
|
||||||
GVAR(drawing_serverLineMarkers) = GVAR(drawing_serverLineMarkers) - [_x];
|
GVAR(drawing_serverLineMarkers) = GVAR(drawing_serverLineMarkers) - [_x];
|
||||||
publicVariable QGVAR(drawing_serverLineMarkers);
|
publicVariable QGVAR(drawing_serverLineMarkers);
|
||||||
};
|
};
|
||||||
} forEach GVAR(drawing_serverLineMarkers);
|
} forEach GVAR(drawing_serverLineMarkers);
|
||||||
};
|
};
|
||||||
|
@ -1,24 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
*
|
|
||||||
* Updates the line marker position and scale
|
* Updates the line marker position and scale
|
||||||
*
|
*
|
||||||
* Argument:
|
* Arguments:
|
||||||
* 0: Marker Name (string)
|
* 0: Marker Name <STRING>
|
||||||
* 1: Marker start pos (array)
|
* 1: Marker start pos <ARRAY>
|
||||||
* 2: Marker end pos (array)
|
* 2: Marker end pos <ARRAY>
|
||||||
* 3: Color index (Number)
|
* 3: Color index <NUMBER>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Return
|
* None
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_name = _this select 0;
|
_name = _this select 0;
|
||||||
_startPos = _this select 1;
|
_startPos = _this select 1;
|
||||||
_difPos = (_this select 2) vectorDiff _startPos ;
|
_difPos = (_this select 2) vectorDiff _startPos ;
|
||||||
_color = _this select 3;
|
_color = _this select 3;
|
||||||
|
|
||||||
_name setMarkerShapeLocal "RECTANGLE";
|
_name setMarkerShapeLocal "RECTANGLE";
|
||||||
_name setMarkerAlphaLocal 1;
|
_name setMarkerAlphaLocal 1;
|
||||||
@ -26,9 +24,9 @@ _name setMarkerColorLocal GVAR(drawing_drawColor);
|
|||||||
_name setMarkerPosLocal (_startPos vectorAdd (_difPos vectorMultiply 0.5));
|
_name setMarkerPosLocal (_startPos vectorAdd (_difPos vectorMultiply 0.5));
|
||||||
_mag = vectorMagnitude _difPos;
|
_mag = vectorMagnitude _difPos;
|
||||||
if (_mag > 0) then {
|
if (_mag > 0) then {
|
||||||
_name setMarkerSizeLocal [5, _mag / 2];
|
_name setMarkerSizeLocal [5, _mag / 2];
|
||||||
_name setMarkerDirLocal (180 + (_difPos select 0) atan2 (_difPos select 1) mod 360);
|
_name setMarkerDirLocal (180 + (_difPos select 0) atan2 (_difPos select 1) mod 360);
|
||||||
} else {
|
} else {
|
||||||
_name setMarkerSizeLocal [5, 5];
|
_name setMarkerSizeLocal [5, 5];
|
||||||
_name setMarkerDirLocal 0;
|
_name setMarkerDirLocal 0;
|
||||||
};
|
};
|
||||||
|
@ -7,8 +7,9 @@
|
|||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Nothing
|
* Nothing
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#define TEXTURE_WIDTH_IN_M 6205
|
#define TEXTURE_WIDTH_IN_M 6205
|
||||||
|
@ -10,8 +10,3 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "\z\ace\Addons\main\script_macros.hpp"
|
#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"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user