mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Converted to CBA style
This commit is contained in:
parent
f4c84182d4
commit
b12844f175
@ -27,7 +27,7 @@ class controls {
|
|||||||
colorBackground[] = {0.2,0.2,0.2,1};
|
colorBackground[] = {0.2,0.2,0.2,1};
|
||||||
colorBackgroundActive[] = {0,0,0,1};
|
colorBackgroundActive[] = {0,0,0,1};
|
||||||
colorFocused[] = {0,0,0,1};
|
colorFocused[] = {0,0,0,1};
|
||||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorBlack""]";
|
onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorBlack")]);
|
||||||
};
|
};
|
||||||
class ColorRed: RscButton {
|
class ColorRed: RscButton {
|
||||||
idc = 36733;
|
idc = 36733;
|
||||||
@ -38,7 +38,8 @@ class controls {
|
|||||||
colorBackground[] = {0.8,0.2,0.2,1};
|
colorBackground[] = {0.8,0.2,0.2,1};
|
||||||
colorBackgroundActive[] = {1,0,0,1};
|
colorBackgroundActive[] = {1,0,0,1};
|
||||||
colorFocused[] = {1,0,0,1};
|
colorFocused[] = {1,0,0,1};
|
||||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorRed""]";
|
// onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorRed""]";
|
||||||
|
onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorRed")]);
|
||||||
};
|
};
|
||||||
class ColorGreen: RscButton {
|
class ColorGreen: RscButton {
|
||||||
idc = 36734;
|
idc = 36734;
|
||||||
@ -49,7 +50,8 @@ class controls {
|
|||||||
colorBackground[] = {0.2,0.8,0.2,1};
|
colorBackground[] = {0.2,0.8,0.2,1};
|
||||||
colorBackgroundActive[] = {0,1,0,1};
|
colorBackgroundActive[] = {0,1,0,1};
|
||||||
colorFocused[] = {0,1,0,1};
|
colorFocused[] = {0,1,0,1};
|
||||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorGreen""]";
|
// onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorGreen""]";
|
||||||
|
onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorGreen")]);
|
||||||
};
|
};
|
||||||
class ColorBlue: RscButton {
|
class ColorBlue: RscButton {
|
||||||
idc = 36735;
|
idc = 36735;
|
||||||
@ -60,7 +62,8 @@ class controls {
|
|||||||
colorBackground[] = {0.2,0.2,0.8,1};
|
colorBackground[] = {0.2,0.2,0.8,1};
|
||||||
colorBackgroundActive[] = {0,0,1,1};
|
colorBackgroundActive[] = {0,0,1,1};
|
||||||
colorFocused[] = {0,0,1,1};
|
colorFocused[] = {0,0,1,1};
|
||||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorBlue""]";
|
// onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorBlue""]";
|
||||||
|
onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorBlue")]);
|
||||||
};
|
};
|
||||||
class ColorYellow: RscButton {
|
class ColorYellow: RscButton {
|
||||||
idc = 36736;
|
idc = 36736;
|
||||||
@ -71,7 +74,8 @@ class controls {
|
|||||||
colorBackground[] = {0.8,0.8,0.2,1};
|
colorBackground[] = {0.8,0.8,0.2,1};
|
||||||
colorBackgroundActive[] = {1,1,0,1};
|
colorBackgroundActive[] = {1,1,0,1};
|
||||||
colorFocused[] = {1,1,0,1};
|
colorFocused[] = {1,1,0,1};
|
||||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorYellow""]";
|
// onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorYellow""]";
|
||||||
|
onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorYellow")]);
|
||||||
};
|
};
|
||||||
class ColorWhite: RscButton {
|
class ColorWhite: RscButton {
|
||||||
idc = 36737;
|
idc = 36737;
|
||||||
@ -82,6 +86,7 @@ class controls {
|
|||||||
colorBackground[] = {0.8,0.8,0.8,1};
|
colorBackground[] = {0.8,0.8,0.8,1};
|
||||||
colorBackgroundActive[] = {1,1,1,1};
|
colorBackgroundActive[] = {1,1,1,1};
|
||||||
colorFocused[] = {1,1,1,1};
|
colorFocused[] = {1,1,1,1};
|
||||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorWhite""]";
|
// onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorWhite""]";
|
||||||
|
onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorWhite")]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -19,7 +19,7 @@ class RscTitles {
|
|||||||
duration = 3600;
|
duration = 3600;
|
||||||
fadein = 0;
|
fadein = 0;
|
||||||
fadeout = 0;
|
fadeout = 0;
|
||||||
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QGVAR(mapGpsDisplay), _this select 0)];);
|
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QGVAR(ui_mapGpsDisplay), _this select 0)];);
|
||||||
//onUnLoad = "_this call onRscLoad";
|
//onUnLoad = "_this call onRscLoad";
|
||||||
class controls {
|
class controls {
|
||||||
class back:RscPicture {
|
class back:RscPicture {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// by CAA-Picard
|
// by CAA-Picard
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if (!hasInterface) exitWith{};
|
if (!hasInterface) exitWith{};
|
||||||
|
|
||||||
[] spawn {
|
[] spawn {
|
||||||
@ -7,20 +9,20 @@ if (!hasInterface) exitWith{};
|
|||||||
sleep 5;
|
sleep 5;
|
||||||
_markers = [];
|
_markers = [];
|
||||||
|
|
||||||
while {AGM_Map_BFT_Enabled and {(!isNil "AGM_player") and {alive AGM_player}}} do {
|
while {GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}} do {
|
||||||
|
|
||||||
_groups = [];
|
_groups = [];
|
||||||
_playerSide = call AGM_Core_fnc_playerSide;
|
_playerSide = call EFUNC(common,playerSide);
|
||||||
|
|
||||||
if (AGM_Map_BFT_HideAiGroups) then {
|
if (GVAR(BFT_HideAiGroups)) then {
|
||||||
_groups = [allGroups, {side _this == _playerSide}] call AGM_Core_fnc_filter;
|
_groups = [allGroups, {side _this == _playerSide}] call EFUNC(common,filter);
|
||||||
} else {
|
} else {
|
||||||
_groups = [allGroups, {
|
_groups = [allGroups, {
|
||||||
_anyPlayers = {
|
_anyPlayers = {
|
||||||
[_x] call AGM_Core_fnc_isPlayer
|
[_x] call EFUNC(common,isPlayer);
|
||||||
} count units _this;
|
} count units _this;
|
||||||
(side _this == _playerSide) && _anyPlayers > 0
|
(side _this == _playerSide) && _anyPlayers > 0
|
||||||
}] call AGM_Core_fnc_filter;
|
}] call EFUNC(common,filter);
|
||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -31,11 +33,11 @@ if (!hasInterface) exitWith{};
|
|||||||
for "_i" from 0 to (count _groups - 1) do {
|
for "_i" from 0 to (count _groups - 1) do {
|
||||||
_group1 = _groups select _i;
|
_group1 = _groups select _i;
|
||||||
|
|
||||||
_markerType = [_group1] call AGM_Core_fnc_getMarkerType;
|
_markerType = [_group1] call EFUNC(common,getMarkerType);
|
||||||
|
|
||||||
_colour = format ["Color%1", side _group1];
|
_colour = format ["Color%1", side _group1];
|
||||||
|
|
||||||
_marker = createMarkerLocal [format ["AGM_BFT_%1", _i], [(getPos leader _group1) select 0, (getPos leader _group1) select 1]];
|
_marker = createMarkerLocal [format ["ACE_BFT_%1", _i], [(getPos leader _group1) select 0, (getPos leader _group1) select 1]];
|
||||||
_marker setMarkerTypeLocal _markerType;
|
_marker setMarkerTypeLocal _markerType;
|
||||||
_marker setMarkerColorLocal _colour;
|
_marker setMarkerColorLocal _colour;
|
||||||
_marker setMarkerTextLocal (groupID _group1);
|
_marker setMarkerTextLocal (groupID _group1);
|
||||||
@ -43,7 +45,7 @@ if (!hasInterface) exitWith{};
|
|||||||
_markers pushBack _marker;
|
_markers pushBack _marker;
|
||||||
};
|
};
|
||||||
|
|
||||||
sleep AGM_Map_BFT_Interval;
|
sleep GVAR(BFT_Interval);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Delete markers as soon as the player dies
|
// Delete markers as soon as the player dies
|
||||||
@ -55,27 +57,28 @@ if (!hasInterface) exitWith{};
|
|||||||
|
|
||||||
[] spawn {
|
[] spawn {
|
||||||
// Init variables
|
// Init variables
|
||||||
GVAR(mapToolsShown) = 0;
|
GVAR(mapTool_Shown) = 0;
|
||||||
AGM_Map_pos = [0,0];
|
GVAR(mapTool_pos) = [0,0];
|
||||||
AGM_Map_angle = 0;
|
GVAR(mapTool_angle) = 0;
|
||||||
GVAR(mapToolDragging) = false;
|
GVAR(mapTool_isDragging) = false;
|
||||||
GVAR(mapToolRotating) = false;
|
GVAR(mapTool_isRotating) = false;
|
||||||
AGM_Map_mapGpsShow = true;
|
|
||||||
GVAR(drawing) = false;
|
GVAR(mapGpsShow) = true;
|
||||||
GVAR(tempLineMarker) = [];
|
|
||||||
GVAR(lineMarkers) = [];
|
GVAR(drawing_isDrawing) = false;
|
||||||
|
GVAR(drawing_tempLineMarker) = [];
|
||||||
|
GVAR(drawing_lineMarkers) = [];
|
||||||
|
GVAR(drawing_drawColor) = "ColorBlack";
|
||||||
|
GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737];
|
||||||
|
|
||||||
AGM_Map_drawColor = "ColorBlack";
|
_fnc_installMapEvents = {
|
||||||
GVAR(drawing)Controls = [36732, 36733, 36734, 36735, 36736, 36737];
|
|
||||||
|
|
||||||
AGM_Map_fnc_installEvents = {
|
|
||||||
_d = _this;
|
_d = _this;
|
||||||
diag_log format ["Installing EH in display %1", _d];
|
diag_log format ["Installing EH in display %1", _d];
|
||||||
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call AGM_Map_fnc_handleMouseMove;}];
|
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}];
|
||||||
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call AGM_Map_fnc_handleMouseButton;}];
|
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}];
|
||||||
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call AGM_Map_fnc_handleMouseButton}];
|
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}];
|
||||||
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call AGM_Map_fnc_updateMapToolMarkers;}];
|
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapToolMarkers);}];
|
||||||
(finddisplay _d) displayAddEventHandler ["KeyDown", {_this call AGM_Map_fnc_handleKeyDown;}];
|
(finddisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Wait until the briefing map is detected
|
// Wait until the briefing map is detected
|
||||||
@ -86,51 +89,51 @@ if (!hasInterface) exitWith{};
|
|||||||
|
|
||||||
if (isNull findDisplay 12) then {
|
if (isNull findDisplay 12) then {
|
||||||
// Install event handlers on the map control of the briefing screen (control = 51)
|
// Install event handlers on the map control of the briefing screen (control = 51)
|
||||||
GVAR(syncMarkers) = true;
|
GVAR(drawing_syncMarkers) = true;
|
||||||
if (!isNull findDisplay 52) then {
|
if (!isNull findDisplay 52) then {
|
||||||
52 call AGM_Map_fnc_installEvents;
|
52 call _fnc_installMapEvents;
|
||||||
} else {
|
} else {
|
||||||
if (!isNull findDisplay 53) then {
|
if (!isNull findDisplay 53) then {
|
||||||
53 call AGM_Map_fnc_installEvents;
|
53 call _fnc_installMapEvents;
|
||||||
} else {
|
} else {
|
||||||
37 call AGM_Map_fnc_installEvents;
|
37 call _fnc_installMapEvents;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// Briefing screen was skipped; the player is JIP, create the markers defined during the briefing
|
// Briefing screen was skipped; the player is JIP, create the markers defined during the briefing
|
||||||
GVAR(syncMarkers) = false;
|
GVAR(drawing_syncMarkers) = false;
|
||||||
{
|
{
|
||||||
_x call FUNC(addLineMarker);
|
_x call FUNC(addLineMarker);
|
||||||
} forEach GVAR(serverLineMarkers);
|
} forEach GVAR(drawing_serverLineMarkers);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Wait until the main map display is detected (display = 12)
|
// Wait until the main map display is detected (display = 12)
|
||||||
waitUntil { !isNull findDisplay 12 };
|
waitUntil { !isNull findDisplay 12 };
|
||||||
// Install event handlers on the map control and display (control = 51)
|
// Install event handlers on the map control and display (control = 51)
|
||||||
GVAR(syncMarkers) = false;
|
GVAR(drawing_syncMarkers) = false;
|
||||||
12 call AGM_Map_fnc_installEvents;
|
12 call _fnc_installMapEvents;
|
||||||
|
|
||||||
// Update the size and rotation of map tools
|
// Update the size and rotation of map tools
|
||||||
[] call AGM_Map_fnc_updateMapToolMarkers;
|
[] call FUNC(updateMapToolMarkers);
|
||||||
|
|
||||||
while {true} do {
|
while {true} do {
|
||||||
waitUntil {visibleMap};
|
waitUntil {visibleMap};
|
||||||
|
|
||||||
// Show and update map tools if required
|
// Show and update map tools if required
|
||||||
[] call AGM_Map_fnc_updateMapToolMarkers;
|
[] call FUNC(updateMapToolMarkers);
|
||||||
// Show GPS if required
|
// Show GPS if required
|
||||||
[AGM_Map_mapGpsShow] call AGM_Map_fnc_openMapGps;
|
[GVAR(mapGpsShow)] call FUNC(openMapGps);
|
||||||
|
|
||||||
// Update visibility of maptools and gps, handling inventory changes
|
// Update visibility of maptools and gps, handling inventory changes
|
||||||
[] spawn {
|
[] spawn {
|
||||||
while {visibleMap} do {
|
while {visibleMap} do {
|
||||||
// Show/Hide draw buttons
|
// Show/Hide draw buttons
|
||||||
if ("ACE_MapTools" in items player) then {
|
if ("ACE_MapTools" in items 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)) then {
|
if (GVAR(drawing_isDrawing)) then {
|
||||||
call AGM_Map_fnc_cancelDrawing;
|
call FUNC(cancelDrawing);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
@ -140,15 +143,15 @@ if (!hasInterface) exitWith{};
|
|||||||
waitUntil {!visibleMap};
|
waitUntil {!visibleMap};
|
||||||
|
|
||||||
// Hide GPS
|
// Hide GPS
|
||||||
[false] call AGM_Map_fnc_openMapGps;
|
[false] call FUNC(openMapGps);
|
||||||
// Hide Map tools
|
// Hide Map tools
|
||||||
deleteMarkerLocal MARKERNAME_MAPTOOL_FIXED;
|
deleteMarkerLocal MARKERNAME_MAPTOOL_FIXED;
|
||||||
deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGNORMAL;
|
deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGNORMAL;
|
||||||
deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGSMALL;
|
deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGSMALL;
|
||||||
GVAR(mapToolFixed) = nil;
|
GVAR(mapTool_markerRotatingFixed) = nil;
|
||||||
AGM_Map_mapToolRotatingNormal = nil;
|
GVAR(mapTool_markerRotatingNormal) = nil;
|
||||||
AGM_Map_mapToolRotatingSmall = nil;
|
GVAR(mapTool_markerRotatingSmall) = nil;
|
||||||
// Cancel drawing
|
// Cancel drawing
|
||||||
call AGM_Map_fnc_cancelDrawing;
|
call FUNC(cancelDrawing);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// by CAA-Picard
|
// by CAA-Picard
|
||||||
|
|
||||||
GVAR(serverLineMarkers) = [];
|
#include "script_component.hpp"
|
||||||
publicVariable QGVAR(serverLineMarkers);
|
|
||||||
|
GVAR(drawing_serverLineMarkers) = [];
|
||||||
|
publicVariable QGVAR(drawing_serverLineMarkers);
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
class CfgPatches {
|
class CfgPatches {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
units[] = {};
|
units[] = {};
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
* Return
|
* Return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#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 ;
|
||||||
@ -32,9 +34,9 @@ if (_mag > 0) then {
|
|||||||
_name setMarkerDirLocal 0;
|
_name setMarkerDirLocal 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(lineMarkers) pushBack (+_this);
|
GVAR(drawing_lineMarkers) pushBack (+_this);
|
||||||
|
|
||||||
if (isServer && GVAR(syncMarkers)) then {
|
if (isServer && GVAR(drawing_syncMarkers)) then {
|
||||||
GVAR(serverLineMarkers) pushBack (+_this);
|
GVAR(drawing_serverLineMarkers) pushBack (+_this);
|
||||||
publicVariable QGVAR(serverLineMarkers);
|
publicVariable QGVAR(drawing_serverLineMarkers);
|
||||||
};
|
};
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
* None
|
* None
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if !(hasInterface) exitWith {};
|
if !(hasInterface) exitWith {};
|
||||||
|
|
||||||
_logic = _this select 0;
|
_logic = _this select 0;
|
||||||
@ -22,8 +24,8 @@ _logic spawn {
|
|||||||
waitUntil {alive player};
|
waitUntil {alive player};
|
||||||
|
|
||||||
GVAR(BFT_Enabled) = true;
|
GVAR(BFT_Enabled) = true;
|
||||||
[_this, QGVAR(BFT_Interval), "Interval"] call AGM_Core_fnc_readNumericParameterFromModule;
|
[_this, QGVAR(BFT_Interval), "Interval"] call EFUNC(common,readNumericParameterFromModule);
|
||||||
[_this, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call AGM_Core_fnc_readBooleanParameterFromModule;
|
[_this, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readBooleanParameterFromModule);
|
||||||
|
|
||||||
diag_log text "[ACE]: Blue Force Tracking Module initialized.";
|
diag_log text "[ACE]: Blue Force Tracking Module initialized.";
|
||||||
TRACE_2("[ACE]: Blue Force Tracking Module initialized.",GVAR(BFT_Interval), GVAR(BFT_HideAiGroups));
|
TRACE_2("[ACE]: Blue Force Tracking Module initialized.",GVAR(BFT_Interval), GVAR(BFT_HideAiGroups));
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
* Return
|
* Return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5];
|
_pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5];
|
||||||
_screenOffset = ((finddisplay 12) displayctrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)];
|
_screenOffset = ((finddisplay 12) displayctrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)];
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// by CAA-Picard
|
// by CAA-Picard
|
||||||
|
|
||||||
(missionNameSpace getVariable [QGVAR(syncMarkers), true] && {GVAR(EveryoneCanDrawOnBriefing)}) ||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
(missionNameSpace getVariable [QGVAR(drawing_syncMarkers), true] && {GVAR(EveryoneCanDrawOnBriefing)}) ||
|
||||||
{(!isNull player) && {"ACE_MapTools" in items player}}
|
{(!isNull player) && {"ACE_MapTools" in items player}}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// by CAA-Picard
|
// by CAA-Picard
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
visibleMap &&
|
visibleMap &&
|
||||||
{alive ACE_player} &&
|
{alive ACE_player} &&
|
||||||
{"ItemGPS" in (assignedItems ACE_player)}
|
{"ItemGPS" in (assignedItems ACE_player)}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
// by CAA-Picard
|
// by CAA-Picard
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
visibleMap &&
|
visibleMap &&
|
||||||
{alive player} &&
|
{alive player} &&
|
||||||
{"ItemMap" in (assignedItems ACE_player)} &&
|
{"ItemMap" in (assignedItems ACE_player)} &&
|
||||||
{"ACE_MapTools" in (items ACE_player)} &&
|
{"ACE_MapTools" in (items ACE_player)} &&
|
||||||
{!GVAR(mapToolDragging)} &&
|
{!GVAR(mapTool_isDragging)} &&
|
||||||
{!GVAR(mapToolRotating)}
|
{!GVAR(mapTool_isRotating)}
|
||||||
|
@ -10,8 +10,10 @@
|
|||||||
* Nothing
|
* Nothing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GVAR(drawing) = false;
|
#include "script_component.hpp"
|
||||||
if (count GVAR(tempLineMarker) > 0) then {
|
|
||||||
deleteMarkerLocal (GVAR(tempLineMarker) select 0);
|
GVAR(drawing_isDrawing) = false;
|
||||||
|
if (count GVAR(drawing_tempLineMarker) > 0) then {
|
||||||
|
deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0);
|
||||||
};
|
};
|
||||||
GVAR(tempLineMarker) = [];
|
GVAR(drawing_tempLineMarker) = [];
|
||||||
|
@ -10,12 +10,14 @@
|
|||||||
* Return
|
* Return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_lineMarkers = _this;
|
_lineMarkers = _this;
|
||||||
|
|
||||||
{
|
{
|
||||||
_marker = _x;
|
_marker = _x;
|
||||||
|
|
||||||
if (({(_x select 0) == (_marker select 0)} count GVAR(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;
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
* Boolean, true if event was handled
|
* Boolean, true if event was handled
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"];
|
private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"];
|
||||||
|
|
||||||
_display = _this select 0;
|
_display = _this select 0;
|
||||||
@ -28,15 +30,15 @@ _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)) then {
|
if (GVAR(drawing_isDrawing)) then {
|
||||||
call AGM_Map_fnc_cancelDrawing;
|
call FUNC(cancelDrawing);
|
||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_code == DIK_DELETE) exitWith {
|
if (_code == DIK_DELETE) exitWith {
|
||||||
if (GVAR(drawing)) then {
|
if (GVAR(drawing_isDrawing)) then {
|
||||||
call AGM_Map_fnc_cancelDrawing;
|
call FUNC(cancelDrawing);
|
||||||
_handled = true;
|
_handled = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -57,16 +59,16 @@ if (_code == DIK_DELETE) exitWith {
|
|||||||
_lambdaTrasAbs = vectorMagnitude (_relPos vectorDiff (_diffVector vectorMultiply _lambdaLong));
|
_lambdaTrasAbs = vectorMagnitude (_relPos vectorDiff (_diffVector vectorMultiply _lambdaLong));
|
||||||
if (_lambdaLong >= 0 && _lambdaLong <= _magDiffVector && _lambdaTrasAbs <= 5) exitWith {
|
if (_lambdaLong >= 0 && _lambdaLong <= _magDiffVector && _lambdaTrasAbs <= 5) exitWith {
|
||||||
// Delete the line marker
|
// Delete the line marker
|
||||||
if (GVAR(syncMarkers)) then {
|
if (GVAR(drawing_syncMarkers)) then {
|
||||||
[[_x select 0], "AGM_Map_fnc_removeLineMarker", 2] call AGM_Core_fnc_execRemoteFnc;
|
[[_x select 0], QFUNC(removeLineMarker), 2] call EFUNC(common,execRemoteFnc);
|
||||||
} else {
|
} else {
|
||||||
deleteMarkerLocal (_x select 0);
|
deleteMarkerLocal (_x select 0);
|
||||||
GVAR(lineMarkers) = GVAR(lineMarkers) - [_x];
|
GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x];
|
||||||
};
|
};
|
||||||
_handled = true;
|
_handled = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
} forEach GVAR(lineMarkers);
|
} forEach GVAR(drawing_lineMarkers);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
* Boolean, true if event was handled
|
* Boolean, true if event was handled
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"];
|
private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"];
|
||||||
|
|
||||||
_dir = _this select 0;
|
_dir = _this select 0;
|
||||||
@ -27,9 +29,9 @@ _handled = false;
|
|||||||
if (_button != 0) exitWith {};
|
if (_button != 0) exitWith {};
|
||||||
|
|
||||||
// If releasing
|
// If releasing
|
||||||
if (_dir != 1 && (GVAR(mapToolDragging) or GVAR(mapToolRotating))) exitWith {
|
if (_dir != 1 && (GVAR(mapTool_isDragging) or GVAR(mapTool_isRotating))) exitWith {
|
||||||
GVAR(mapToolDragging) = false;
|
GVAR(mapTool_isDragging) = false;
|
||||||
GVAR(mapToolRotating) = false;
|
GVAR(mapTool_isRotating) = false;
|
||||||
_handled = true;
|
_handled = true;
|
||||||
_handled
|
_handled
|
||||||
};
|
};
|
||||||
@ -43,53 +45,53 @@ if (_dir == 1) exitWith {
|
|||||||
_pos = _control ctrlMapScreenToWorld _screenPos;
|
_pos = _control ctrlMapScreenToWorld _screenPos;
|
||||||
_pos set [count _pos, 0];
|
_pos set [count _pos, 0];
|
||||||
|
|
||||||
if (GVAR(drawing)) exitWith {
|
if (GVAR(drawing_isDrawing)) exitWith {
|
||||||
// Already drawing -> Add tempLineMarker to permanent list
|
// Already drawing -> Add tempLineMarker to permanent list
|
||||||
if (GVAR(syncMarkers)) then {
|
if (GVAR(drawing_syncMarkers)) then {
|
||||||
deleteMarkerLocal (GVAR(tempLineMarker) select 0);
|
deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0);
|
||||||
[GVAR(tempLineMarker), "FUNC(addLineMarker)", 2] call AGM_Core_fnc_execRemoteFnc;
|
[GVAR(drawing_tempLineMarker), "FUNC(addLineMarker)", 2] call EFUNC(common,execRemoteFnc);
|
||||||
// Log who drew on the briefing screen
|
// Log who drew on the briefing screen
|
||||||
(text format ["[AGM] Server: Player %1 drew on the briefing screen", name player]) call AGM_Core_fnc_serverLog;
|
(text format ["[ACE] Server: Player %1 drew on the briefing screen", name player]) call EFUNC(common,serverLog);
|
||||||
} else {
|
} else {
|
||||||
GVAR(tempLineMarker) call AGM_Map_fnc_updateLineMarker;
|
GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker);
|
||||||
GVAR(lineMarkers) pushBack (+GVAR(tempLineMarker));
|
GVAR(drawing_lineMarkers) pushBack (+GVAR(drawing_tempLineMarker));
|
||||||
};
|
};
|
||||||
GVAR(tempLineMarker) = [];
|
GVAR(drawing_tempLineMarker) = [];
|
||||||
GVAR(drawing) = false;
|
GVAR(drawing_isDrawing) = false;
|
||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_altKey) exitWith {
|
if (_altKey) exitWith {
|
||||||
// Start drawing
|
// Start drawing
|
||||||
GVAR(drawing) = true;
|
GVAR(drawing_isDrawing) = true;
|
||||||
// Create tempLineMarker
|
// Create tempLineMarker
|
||||||
_gui = format ["%1%2%3%4", random (100), random (100), random (100), random (100)];
|
_gui = format ["%1%2%3%4", random (100), random (100), random (100), random (100)];
|
||||||
GVAR(tempLineMarker) = [_gui, + _pos, + _pos, AGM_Map_drawColor];
|
GVAR(drawing_tempLineMarker) = [_gui, + _pos, + _pos, GVAR(drawing_drawColor)];
|
||||||
_marker = createMarkerLocal [_gui, [0,0]];
|
_marker = createMarkerLocal [_gui, [0,0]];
|
||||||
GVAR(tempLineMarker) call AGM_Map_fnc_updateLineMarker;
|
GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker);
|
||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(mapToolDragging) = false;
|
GVAR(mapTool_isDragging) = false;
|
||||||
GVAR(mapToolRotating) = false;
|
GVAR(mapTool_isRotating) = false;
|
||||||
|
|
||||||
// If no map tool marker then exit
|
// If no map tool marker then exit
|
||||||
if (isNil QGVAR(mapToolFixed)) exitWith {_handled = false;};
|
if (isNil QGVAR(mapTool_markerRotatingFixed)) exitWith {_handled = false;};
|
||||||
|
|
||||||
// Check if clicking the maptool
|
// Check if clicking the maptool
|
||||||
if (_pos call AGM_Map_fnc_isInsideMapTool) exitWith {
|
if (_pos call FUNC(isInsideMapTool)) exitWith {
|
||||||
// Store data for dragging
|
// Store data for dragging
|
||||||
AGM_Map_startPos = + AGM_Map_pos;
|
GVAR(mapTool_startPos) = + GVAR(mapTool_pos);
|
||||||
AGM_Map_startDragPos = + _pos;
|
GVAR(mapTool_startDragPos) = + _pos;
|
||||||
if (_ctrlKey) then {
|
if (_ctrlKey) then {
|
||||||
// Store data for rotating
|
// Store data for rotating
|
||||||
AGM_Map_startAngle = + AGM_Map_angle;
|
GVAR(mapTool_startAngle) = + GVAR(mapTool_angle);
|
||||||
AGM_Map_startDragAngle = (180 + ((AGM_Map_startDragPos select 0) - (AGM_Map_startPos select 0)) atan2 ((AGM_Map_startDragPos select 1) - (AGM_Map_startPos select 1)) mod 360);
|
GVAR(mapTool_startDragAngle) = (180 + ((GVAR(mapTool_startDragPos) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mapTool_startDragPos) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360);
|
||||||
// Start rotating
|
// Start rotating
|
||||||
GVAR(mapToolRotating) = true;
|
GVAR(mapTool_isRotating) = true;
|
||||||
} else {
|
} else {
|
||||||
// Start dragging
|
// Start dragging
|
||||||
GVAR(mapToolDragging) = true;
|
GVAR(mapTool_isDragging) = true;
|
||||||
};
|
};
|
||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
};
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
* Boolean, true if event was handled
|
* Boolean, true if event was handled
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_control", "_pos"];
|
private ["_control", "_pos"];
|
||||||
|
|
||||||
_control = _this select 0;
|
_control = _this select 0;
|
||||||
@ -21,40 +23,40 @@ 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)) then {
|
if (GVAR(drawing_isDrawing)) then {
|
||||||
call AGM_Map_fnc_cancelDrawing;
|
call FUNC(cancelDrawing);
|
||||||
};
|
};
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle drawing
|
// Handle drawing
|
||||||
if (GVAR(drawing)) exitWith {
|
if (GVAR(drawing_isDrawing)) exitWith {
|
||||||
GVAR(tempLineMarker) set [2, GVAR(mousePosition)];
|
GVAR(drawing_tempLineMarker) set [2, GVAR(mousePosition)];
|
||||||
GVAR(tempLineMarker) call AGM_Map_fnc_updateLineMarker;
|
GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker);
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle Map tools
|
// Handle Map tools
|
||||||
if (isNil QGVAR(mapToolFixed)) exitWith {false};
|
if (isNil QGVAR(mapTool_markerRotatingFixed)) exitWith {false};
|
||||||
|
|
||||||
// Translation
|
// Translation
|
||||||
if (GVAR(mapToolDragging)) exitWith {
|
if (GVAR(mapTool_isDragging)) exitWith {
|
||||||
AGM_Map_pos set [0, (AGM_Map_startPos select 0) + (GVAR(mousePosition) select 0) - (AGM_Map_startDragPos select 0)];
|
GVAR(mapTool_pos) set [0, (GVAR(mapTool_startPos) select 0) + (GVAR(mousePosition) select 0) - (GVAR(mapTool_startDragPos) select 0)];
|
||||||
AGM_Map_pos set [1, (AGM_Map_startPos select 1) + (GVAR(mousePosition) select 1) - (AGM_Map_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 AGM_Map_fnc_updateMapToolMarkers;
|
[] call FUNC(updateMapToolMarkers);
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
|
|
||||||
// Rotation
|
// Rotation
|
||||||
if (GVAR(mapToolRotating)) exitWith {
|
if (GVAR(mapTool_isRotating)) exitWith {
|
||||||
// Get new angle
|
// Get new angle
|
||||||
_angle = (180 + ((GVAR(mousePosition) select 0) - (AGM_Map_startPos select 0)) atan2 ((GVAR(mousePosition) select 1) - (AGM_Map_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);
|
||||||
AGM_Map_angle = AGM_Map_startAngle + _angle - AGM_Map_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 AGM_Map_fnc_updateMapToolMarkers;
|
[] call FUNC(updateMapToolMarkers);
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
* Boolean, true if event was handled
|
* Boolean, true if event was handled
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"];
|
private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"];
|
||||||
|
|
||||||
_control = _this select 0;
|
_control = _this select 0;
|
||||||
@ -20,17 +22,22 @@ diag_log _this;
|
|||||||
_handled = false;
|
_handled = false;
|
||||||
|
|
||||||
// If drawing, change line color
|
// If drawing, change line color
|
||||||
if (count GVAR(tempLineMarker) > 0) then {
|
|
||||||
AGM_Map_drawColor = if (_dir > 0) then {AGM_Map_drawColor + 1} else {AGM_Map_drawColor - 1};
|
|
||||||
if (AGM_Map_drawColor >= count AGM_Map_drawColors) then {
|
//@todo AGM bug:
|
||||||
AGM_Map_drawColor = AGM_Map_drawColor - count AGM_Map_drawColors;
|
// 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 = ACE_Map_drawColor - count ACE_Map_drawColors;
|
||||||
};
|
};
|
||||||
if (AGM_Map_drawColor < 0) then {
|
if (ACE_Map_drawColor < 0) then {
|
||||||
AGM_Map_drawColor = AGM_Map_drawColor + count AGM_Map_drawColors;
|
ACE_Map_drawColor = ACE_Map_drawColor + count ACE_Map_drawColors;
|
||||||
};
|
};
|
||||||
GVAR(tempLineMarker) set [3, AGM_Map_drawColor];
|
GVAR(drawing_tempLineMarker) set [3, ACE_Map_drawColor];
|
||||||
GVAR(tempLineMarker) call AGM_Map_fnc_updateLineMarker;
|
GVAR(drawing_tempLineMarker) call ACE_Map_fnc_updateLineMarker;
|
||||||
|
|
||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
}; */
|
||||||
_handled
|
_handled
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
* Boolean
|
* Boolean
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#define TEXTURE_WIDTH_IN_M 6205
|
#define TEXTURE_WIDTH_IN_M 6205
|
||||||
#define DIST_BOTTOM_TO_CENTER_PERC -0.33
|
#define DIST_BOTTOM_TO_CENTER_PERC -0.33
|
||||||
#define DIST_TOP_TO_CENTER_PERC 0.65
|
#define DIST_TOP_TO_CENTER_PERC 0.65
|
||||||
@ -20,8 +22,8 @@ if (GVAR(mapToolsShown) == 0) exitWith {false};
|
|||||||
_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapToolsShown) - 1);
|
_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapToolsShown) - 1);
|
||||||
|
|
||||||
_pos = [_this select 0, _this select 1, 0];
|
_pos = [_this select 0, _this select 1, 0];
|
||||||
_relPos = _pos vectorDiff [AGM_Map_pos select 0, AGM_Map_pos select 1, 0];
|
_relPos = _pos vectorDiff [GVAR(mapTool_pos) select 0, GVAR(mapTool_pos) select 1, 0];
|
||||||
_dirVector = [sin(AGM_Map_angle), cos(AGM_Map_angle), 0];
|
_dirVector = [sin(GVAR(mapTool_angle)), cos(GVAR(mapTool_angle)), 0];
|
||||||
|
|
||||||
// Projection of the relative position over the longitudinal axis of the map tool
|
// Projection of the relative position over the longitudinal axis of the map tool
|
||||||
_lambdaLong = _dirVector vectorDotProduct _relPos;
|
_lambdaLong = _dirVector vectorDotProduct _relPos;
|
||||||
|
@ -10,20 +10,21 @@
|
|||||||
* Nothing
|
* Nothing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_open = _this select 0;
|
_open = _this select 0;
|
||||||
_isOpen = !(isNull (uiNamespace getVariable ['AGM_Map_mapGpsDisplay', displayNull]));
|
_isOpen = !(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull]));
|
||||||
|
|
||||||
if (_open && {"ItemGPS" in assignedItems player} && {!_isOpen}) then {
|
if (_open && {"ItemGPS" in assignedItems player} && {!_isOpen}) then {
|
||||||
("AGM_mapGpsLayer" call BIS_fnc_rscLayer) cutRsc ["RscAGM_MapGps","PLAIN"];
|
("RscACE_MapGps" call BIS_fnc_rscLayer) cutRsc ["RscACE_MapGps","PLAIN"];
|
||||||
|
|
||||||
// Spawn a thread to update gps display
|
// Spawn a thread to update gps display
|
||||||
[] spawn {
|
[] spawn {
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
while {!(isNull (uiNamespace getVariable ['AGM_Map_mapGpsDisplay', displayNull]))} do {
|
while {!(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull]))} do {
|
||||||
if !("ItemGPS" in assignedItems player) exitWith {};
|
if !("ItemGPS" in assignedItems player) exitWith {};
|
||||||
|
|
||||||
_mapGpsDisplay = uiNamespace getVariable ['AGM_Map_mapGpsDisplay', displayNull];
|
_mapGpsDisplay = uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull];
|
||||||
_ctrl = _mapGpsDisplay displayCtrl 913590;
|
_ctrl = _mapGpsDisplay displayCtrl 913590;
|
||||||
_ctrl ctrlSetText str(round(getDir player));
|
_ctrl ctrlSetText str(round(getDir player));
|
||||||
_ctrl = _mapGpsDisplay displayCtrl 913591;
|
_ctrl = _mapGpsDisplay displayCtrl 913591;
|
||||||
@ -33,10 +34,10 @@ if (_open && {"ItemGPS" in assignedItems player} && {!_isOpen}) then {
|
|||||||
|
|
||||||
sleep 0.5;
|
sleep 0.5;
|
||||||
};
|
};
|
||||||
("AGM_mapGpsLayer" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
||||||
};
|
};
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
("AGM_mapGpsLayer" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,20 +10,22 @@
|
|||||||
* Return
|
* Return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#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(lineMarkers) = GVAR(lineMarkers) - [_x];
|
GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x];
|
||||||
};
|
};
|
||||||
} forEach GVAR(lineMarkers);
|
} forEach GVAR(drawing_lineMarkers);
|
||||||
|
|
||||||
if (isServer && GVAR(syncMarkers)) then {
|
if (isServer && GVAR(drawing_syncMarkers)) then {
|
||||||
{
|
{
|
||||||
if ((_x select 0) == _name) exitWith {
|
if ((_x select 0) == _name) exitWith {
|
||||||
GVAR(serverLineMarkers) = GVAR(serverLineMarkers) - [_x];
|
GVAR(drawing_serverLineMarkers) = GVAR(drawing_serverLineMarkers) - [_x];
|
||||||
publicVariable "GVAR(serverLineMarkers)";
|
publicVariable QGVAR(drawing_serverLineMarkers);
|
||||||
};
|
};
|
||||||
} forEach GVAR(serverLineMarkers);
|
} forEach GVAR(drawing_serverLineMarkers);
|
||||||
};
|
};
|
||||||
|
@ -10,4 +10,6 @@
|
|||||||
* Return
|
* Return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[GVAR(lineMarkers), "AGM_Map_fnc_copyMapMarkers", _this] call AGM_Core_fnc_execRemoteFnc;
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
[GVAR(drawing_lineMarkers), QFUNC(copyMapMarkers), _this] call EFUNC(common,execRemoteFnc);
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
* Return
|
* Return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#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 ;
|
||||||
@ -20,7 +22,7 @@
|
|||||||
|
|
||||||
_name setMarkerShapeLocal "RECTANGLE";
|
_name setMarkerShapeLocal "RECTANGLE";
|
||||||
_name setMarkerAlphaLocal 1;
|
_name setMarkerAlphaLocal 1;
|
||||||
_name setMarkerColorLocal AGM_Map_drawColor;
|
_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 {
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
* Nothing
|
* Nothing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#define TEXTURE_WIDTH_IN_M 6205
|
#define TEXTURE_WIDTH_IN_M 6205
|
||||||
#define CENTER_OFFSET_Y_PERC 0.1606
|
#define CENTER_OFFSET_Y_PERC 0.1606
|
||||||
#define CONSTANT_SCALE 0.2
|
#define CONSTANT_SCALE 0.2
|
||||||
@ -17,37 +19,37 @@
|
|||||||
// If markers exist and they should'nt, delete them
|
// If markers exist and they should'nt, delete them
|
||||||
if (!("ACE_MapTools" in items player) || {GVAR(mapToolsShown) == 0}) then {
|
if (!("ACE_MapTools" in items player) || {GVAR(mapToolsShown) == 0}) then {
|
||||||
// If markers exist, delete them
|
// If markers exist, delete them
|
||||||
if (!isNil QGVAR(mapToolFixed)) then {
|
if (!isNil QGVAR(mapTool_markerRotatingFixed)) then {
|
||||||
deleteMarkerLocal MARKERNAME_MAPTOOL_FIXED;
|
deleteMarkerLocal MARKERNAME_MAPTOOL_FIXED;
|
||||||
GVAR(mapToolFixed) = nil;
|
GVAR(mapTool_markerRotatingFixed) = nil;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (!("ACE_MapTools" in items player) || {GVAR(mapToolsShown) != 1}) then {
|
if (!("ACE_MapTools" in items player) || {GVAR(mapToolsShown) != 1}) then {
|
||||||
if (!isNil "AGM_Map_mapToolRotatingNormal") then {
|
if (!isNil "GVAR(mapTool_markerRotatingNormal)") then {
|
||||||
deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGNORMAL;
|
deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGNORMAL;
|
||||||
AGM_Map_mapToolRotatingNormal = nil;
|
GVAR(mapTool_markerRotatingNormal) = nil;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (!("ACE_MapTools" in items player) || {GVAR(mapToolsShown) != 2}) then {
|
if (!("ACE_MapTools" in items player) || {GVAR(mapToolsShown) != 2}) then {
|
||||||
if (!isNil "AGM_Map_mapToolRotatingSmall") then {
|
if (!isNil "GVAR(mapTool_markerRotatingSmall)") then {
|
||||||
deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGSMALL;
|
deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGSMALL;
|
||||||
AGM_Map_mapToolRotatingSmall = nil;
|
GVAR(mapTool_markerRotatingSmall) = nil;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!("ACE_MapTools" in items player)|| {GVAR(mapToolsShown) == 0}) exitWith {};
|
if (!("ACE_MapTools" in items player)|| {GVAR(mapToolsShown) == 0}) exitWith {};
|
||||||
|
|
||||||
// If markers don't exist and should, create them
|
// If markers don't exist and should, create them
|
||||||
if (isNil QGVAR(mapToolFixed)) then {
|
if (isNil QGVAR(mapTool_markerRotatingFixed)) then {
|
||||||
GVAR(mapToolFixed) = createMarkerLocal [MARKERNAME_MAPTOOL_FIXED, AGM_Map_pos];
|
GVAR(mapTool_markerRotatingFixed) = createMarkerLocal [MARKERNAME_MAPTOOL_FIXED, GVAR(mapTool_pos)];
|
||||||
MARKERNAME_MAPTOOL_FIXED setMarkerType MARKERNAME_MAPTOOL_FIXED;
|
MARKERNAME_MAPTOOL_FIXED setMarkerType MARKERNAME_MAPTOOL_FIXED;
|
||||||
};
|
};
|
||||||
if ((isNil "AGM_Map_mapToolRotatingNormal") && {GVAR(mapToolsShown) == 1}) then {
|
if ((isNil "GVAR(mapTool_markerRotatingNormal)") && {GVAR(mapToolsShown) == 1}) then {
|
||||||
AGM_Map_mapToolRotatingNormal = createMarkerLocal [MARKERNAME_MAPTOOL_ROTATINGNORMAL, AGM_Map_pos];
|
GVAR(mapTool_markerRotatingNormal) = createMarkerLocal [MARKERNAME_MAPTOOL_ROTATINGNORMAL, GVAR(mapTool_pos)];
|
||||||
MARKERNAME_MAPTOOL_ROTATINGNORMAL setMarkerType MARKERNAME_MAPTOOL_ROTATINGNORMAL;
|
MARKERNAME_MAPTOOL_ROTATINGNORMAL setMarkerType MARKERNAME_MAPTOOL_ROTATINGNORMAL;
|
||||||
};
|
};
|
||||||
if ((isNil "AGM_Map_mapToolRotatingSmall") && {GVAR(mapToolsShown) == 2}) then {
|
if ((isNil "GVAR(mapTool_markerRotatingSmall)") && {GVAR(mapToolsShown) == 2}) then {
|
||||||
AGM_Map_mapToolRotatingSmall = createMarkerLocal [MARKERNAME_MAPTOOL_ROTATINGSMALL, AGM_Map_pos];
|
GVAR(mapTool_markerRotatingSmall) = createMarkerLocal [MARKERNAME_MAPTOOL_ROTATINGSMALL, GVAR(mapTool_pos)];
|
||||||
MARKERNAME_MAPTOOL_ROTATINGSMALL setMarkerType MARKERNAME_MAPTOOL_ROTATINGSMALL;
|
MARKERNAME_MAPTOOL_ROTATINGSMALL setMarkerType MARKERNAME_MAPTOOL_ROTATINGSMALL;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -55,17 +57,17 @@ _rotatingMarker = [MARKERNAME_MAPTOOL_ROTATINGNORMAL, MARKERNAME_MAPTOOL_ROTATIN
|
|||||||
_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapToolsShown) - 1);
|
_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapToolsShown) - 1);
|
||||||
|
|
||||||
// Update scale of both parts
|
// Update scale of both parts
|
||||||
_scale = _textureWidth * CONSTANT_SCALE * (call AGM_Map_fnc_calculateMapScale);
|
_scale = _textureWidth * CONSTANT_SCALE * (call FUNC(calculateMapScale));
|
||||||
MARKERNAME_MAPTOOL_FIXED setMarkerSizeLocal [_scale,_scale];
|
MARKERNAME_MAPTOOL_FIXED setMarkerSizeLocal [_scale,_scale];
|
||||||
_rotatingMarker setMarkerSizeLocal [_scale,_scale];
|
_rotatingMarker setMarkerSizeLocal [_scale,_scale];
|
||||||
|
|
||||||
// Position of the fixed part
|
// Position of the fixed part
|
||||||
_xPos = AGM_Map_pos select 0;
|
_xPos = GVAR(mapTool_pos) select 0;
|
||||||
_yPos = (AGM_Map_pos select 1) + _textureWidth * CENTER_OFFSET_Y_PERC;
|
_yPos = (GVAR(mapTool_pos) select 1) + _textureWidth * CENTER_OFFSET_Y_PERC;
|
||||||
MARKERNAME_MAPTOOL_FIXED setMarkerPosLocal [_xPos,_yPos];
|
MARKERNAME_MAPTOOL_FIXED setMarkerPosLocal [_xPos,_yPos];
|
||||||
|
|
||||||
// Position and rotation of the rotating part
|
// Position and rotation of the rotating part
|
||||||
_xPos = (AGM_Map_pos select 0) + sin(AGM_Map_angle) * _textureWidth * CENTER_OFFSET_Y_PERC;
|
_xPos = (GVAR(mapTool_pos) select 0) + sin(GVAR(mapTool_angle)) * _textureWidth * CENTER_OFFSET_Y_PERC;
|
||||||
_yPos = (AGM_Map_pos select 1) + cos(AGM_Map_angle) * _textureWidth * CENTER_OFFSET_Y_PERC;
|
_yPos = (GVAR(mapTool_pos) select 1) + cos(GVAR(mapTool_angle)) * _textureWidth * CENTER_OFFSET_Y_PERC;
|
||||||
_rotatingMarker setMarkerPosLocal [_xPos,_yPos];
|
_rotatingMarker setMarkerPosLocal [_xPos,_yPos];
|
||||||
_rotatingMarker setMarkerDirLocal AGM_Map_angle;
|
_rotatingMarker setMarkerDirLocal GVAR(mapTool_angle);
|
||||||
|
Loading…
Reference in New Issue
Block a user