mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Code Cleanup MicroDagr Module
This commit is contained in:
parent
bcb6c474a0
commit
ca71dd43e1
@ -6,7 +6,7 @@
|
|||||||
* 0: String version of Keypad entry ["ok","del","1",...] <STRING>
|
* 0: String version of Keypad entry ["ok","del","1",...] <STRING>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* ["ok"] call ace_microdagr_fnc_appMarkKeypadEntry
|
* ["ok"] call ace_microdagr_fnc_appMarkKeypadEntry
|
||||||
@ -16,15 +16,12 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_display", "_editText", "_actualPos"];
|
private ["_display", "_editText", "_actualPos"];
|
||||||
PARAMS_1(_keypadButton);
|
|
||||||
|
params ["_keypadButton"];
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
_display = displayNull;
|
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
|
||||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
|
||||||
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
|
|
||||||
} else {
|
|
||||||
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
|
|
||||||
};
|
|
||||||
if (isNull _display) exitWith {ERROR("No Display");};
|
if (isNull _display) exitWith {ERROR("No Display");};
|
||||||
|
|
||||||
if (GVAR(currentApplicationPage) != APP_MODE_MARK) exitWith {};
|
if (GVAR(currentApplicationPage) != APP_MODE_MARK) exitWith {};
|
||||||
|
@ -3,18 +3,18 @@
|
|||||||
* Handles the "Connect To" button from the menu application
|
* Handles the "Connect To" button from the menu application
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [] call ace_microdagr_fnc_appMenuButtonConnectRangefinder
|
* call ace_microdagr_fnc_appMenuButtonConnectRangefinder
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
GVAR(currentWaypoint) = if (GVAR(currentWaypoint) == -2) then {-1} else {-2};
|
GVAR(currentWaypoint) = [-2, -1] select (GVAR(currentWaypoint) == -2);
|
||||||
GVAR(rangeFinderPositionASL) = [];
|
GVAR(rangeFinderPositionASL) = [];
|
||||||
[APP_MODE_INFODISPLAY] call FUNC(saveCurrentAndSetNewMode);
|
[APP_MODE_INFODISPLAY] call FUNC(saveCurrentAndSetNewMode);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* 1: Index <NUMBER>
|
* 1: Index <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [settingList, 1] call ace_microdagr_fnc_appSettingsLBClick
|
* [settingList, 1] call ace_microdagr_fnc_appSettingsLBClick
|
||||||
@ -17,7 +17,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
PARAMS_2(_control,_itemClicked);
|
params ["_control", "_itemClicked"];
|
||||||
|
|
||||||
switch (_itemClicked) do {
|
switch (_itemClicked) do {
|
||||||
case (0): { GVAR(settingUseMils) = ! GVAR(settingUseMils)};
|
case (0): { GVAR(settingUseMils) = ! GVAR(settingUseMils)};
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
* Handles clicking the delete button from the waypoint application
|
* Handles clicking the delete button from the waypoint application
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [] call ace_microdagr_fnc_appWaypointsButtonDeleteWP
|
* call ace_microdagr_fnc_appWaypointsButtonDeleteWP
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
@ -18,12 +18,8 @@
|
|||||||
private ["_display", "_wpIndex"];
|
private ["_display", "_wpIndex"];
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
_display = displayNull;
|
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select GVAR(currentShowMode) == DISPLAY_MODE_DIALOG, displayNull];
|
||||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
|
||||||
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
|
|
||||||
} else {
|
|
||||||
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
|
|
||||||
};
|
|
||||||
if (isNull _display) exitWith {ERROR("No Display");};
|
if (isNull _display) exitWith {ERROR("No Display");};
|
||||||
|
|
||||||
_wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS);
|
_wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS);
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
* The "SetWP" button <CONTROL>
|
* The "SetWP" button <CONTROL>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [] call ace_microdagr_fnc_appWaypointsButtonSetWP
|
* [1234] call ace_microdagr_fnc_appWaypointsButtonSetWP
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
@ -18,7 +18,7 @@
|
|||||||
private ["_wpListBox", "_newWpIndex", "_waypoints"];
|
private ["_wpListBox", "_newWpIndex", "_waypoints"];
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
PARAMS_1(_wpButton);
|
params ["_wpButton"];
|
||||||
|
|
||||||
_wpListBox = (ctrlParent _wpButton) displayCtrl 144501;
|
_wpListBox = (ctrlParent _wpButton) displayCtrl 144501;
|
||||||
_newWpIndex = lbCurSel _wpListBox;
|
_newWpIndex = lbCurSel _wpListBox;
|
||||||
|
@ -6,32 +6,31 @@
|
|||||||
* The display mode to test showing <NUMBER>
|
* The display mode to test showing <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [mode] call ace_microdagr_fnc_canShow
|
* [1] call ace_microdagr_fnc_canShow
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
params ["_showType"];
|
||||||
PARAMS_1(_showType);
|
|
||||||
|
|
||||||
private ["_returnValue"];
|
private ["_returnValue"];
|
||||||
|
|
||||||
_returnValue = false;
|
_returnValue = false;
|
||||||
|
|
||||||
switch (_showType) do {
|
_returnValue = switch (_showType) do {
|
||||||
case (DISPLAY_MODE_CLOSED): {_returnValue = true}; //Can always close
|
case (DISPLAY_MODE_CLOSED): { true }; //Can always close
|
||||||
case (DISPLAY_MODE_HIDDEN): {_returnValue = true}; //Can always hide
|
case (DISPLAY_MODE_HIDDEN): { true }; //Can always hide
|
||||||
|
|
||||||
case (DISPLAY_MODE_DIALOG): {
|
case (DISPLAY_MODE_DIALOG): {
|
||||||
_returnValue = ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)};
|
("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}
|
||||||
};
|
};
|
||||||
case (DISPLAY_MODE_DISPLAY): {
|
case (DISPLAY_MODE_DISPLAY): {
|
||||||
//Can't have minimap up while zoomed in
|
//Can't have minimap up while zoomed in
|
||||||
_returnValue = (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)};
|
(cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}
|
||||||
};
|
};
|
||||||
|
default { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
_returnValue
|
_returnValue
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* 1: Waypoint Position ASL <ARRAY>
|
* 1: Waypoint Position ASL <ARRAY>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceAddWaypoint
|
* ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceAddWaypoint
|
||||||
@ -17,10 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_2(_waypointName,_waypointPosASL);
|
|
||||||
|
|
||||||
private "_waypoints";
|
private "_waypoints";
|
||||||
|
params ["_waypointName","_waypointPosASL"];
|
||||||
|
|
||||||
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
|
|
||||||
|
|
||||||
|
_waypoints = ACE_player getVariable [QGVAR(waypoints), []];
|
||||||
_waypoints pushBack [_waypointName, _waypointPosASL];
|
_waypoints pushBack [_waypointName, _waypointPosASL];
|
||||||
ace_player setVariable [QGVAR(waypoints), _waypoints];
|
ACE_player setVariable [QGVAR(waypoints), _waypoints];
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* 0: Waypoint Index <NUMBER>
|
* 0: Waypoint Index <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceDeleteWaypoint
|
* ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceDeleteWaypoint
|
||||||
@ -16,13 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_1(_wpIndex);
|
|
||||||
|
|
||||||
private "_waypoints";
|
private "_waypoints";
|
||||||
|
params ["_wpIndex"];
|
||||||
|
|
||||||
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
|
_waypoints = ACE_player getVariable [QGVAR(waypoints), []];
|
||||||
|
|
||||||
if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");};
|
if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");};
|
||||||
|
|
||||||
_waypoints deleteAt _wpIndex;
|
_waypoints deleteAt _wpIndex;
|
||||||
ace_player setVariable [QGVAR(waypoints), _waypoints];
|
ACE_player setVariable [QGVAR(waypoints), _waypoints];
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Device saving not implemented yet, just save to player object
|
* Device saving not implemented yet, just save to player object
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Waypoints <ARRAY>
|
* Waypoints <ARRAY>
|
||||||
@ -16,4 +16,4 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
(ace_player getVariable [QGVAR(waypoints), []])
|
(ACE_player getVariable [QGVAR(waypoints), []])
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
* Handles the dialog closeing, switches back to display mode
|
* Handles the dialog closeing, switches back to display mode
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [] call ace_microdagr_fnc_dialogClosedEH
|
* call ace_microdagr_fnc_dialogClosedEH
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* 3: MousePosY <NUMBER>
|
* 3: MousePosY <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapButtonDownEH
|
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapButtonDownEH
|
||||||
@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
|
params ["_theMap", "_mouseButton", "_xPos", "_yPos"];
|
||||||
|
|
||||||
//Only handle RMB
|
//Only handle RMB
|
||||||
if (_mouseButton != 1) exitWith {};
|
if (_mouseButton != 1) exitWith {};
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* 3: MousePosY <NUMBER>
|
* 3: MousePosY <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapDoubleTapEH
|
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapDoubleTapEH
|
||||||
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
|
params ["_theMap", "_mouseButton", "_xPos", "_yPos"];
|
||||||
|
|
||||||
private ["_worldPos"];
|
private ["_worldPos"];
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ private ["_worldPos"];
|
|||||||
if (_mouseButton != 0) exitWith {};
|
if (_mouseButton != 0) exitWith {};
|
||||||
|
|
||||||
_worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos];
|
_worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos];
|
||||||
_worldPos set [2, (getTerrainHeightASL _worldPos)];
|
_worldPos pushBack (getTerrainHeightASL _worldPos);
|
||||||
|
|
||||||
GVAR(newWaypointPosition) = _worldPos;
|
GVAR(newWaypointPosition) = _worldPos;
|
||||||
[APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode);
|
[APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* 0: The Map <CONTROL>
|
* 0: The Map <CONTROL>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [compassMap] call ace_microdagr_fnc_mapOnDrawEH
|
* [compassMap] call ace_microdagr_fnc_mapOnDrawEH
|
||||||
@ -15,10 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_1(_theMap);
|
|
||||||
|
|
||||||
private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"];
|
private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"];
|
||||||
|
|
||||||
|
params ["_theMap"];
|
||||||
|
|
||||||
_mapSize = (ctrlPosition _theMap) select 3;
|
_mapSize = (ctrlPosition _theMap) select 3;
|
||||||
|
|
||||||
_waypoints = [] call FUNC(deviceGetWaypoints);
|
_waypoints = [] call FUNC(deviceGetWaypoints);
|
||||||
@ -27,7 +27,7 @@ if (GVAR(currentApplicationPage) == 1) then {
|
|||||||
_theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS];
|
_theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS];
|
||||||
ctrlMapAnimCommit _theMap;
|
ctrlMapAnimCommit _theMap;
|
||||||
_size = 412 * _mapSize;
|
_size = 412 * _mapSize;
|
||||||
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ace_player)), '', 0 ];
|
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ACE_player)), '', 0 ];
|
||||||
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [0.533,0.769,0.76,1], DUMMY_POS, _size, _size, 0, '', 0 ];
|
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [0.533,0.769,0.76,1], DUMMY_POS, _size, _size, 0, '', 0 ];
|
||||||
|
|
||||||
if (GVAR(currentWaypoint) != -1) then {
|
if (GVAR(currentWaypoint) != -1) then {
|
||||||
@ -42,23 +42,23 @@ if (GVAR(currentApplicationPage) == 1) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
if ((count _targetPos) == 3) then {
|
if ((count _targetPos) == 3) then {
|
||||||
_relBearing = [ace_player, _targetPos] call BIS_fnc_relativeDirTo;
|
_relBearing = [ACE_player, _targetPos] call BIS_fnc_relativeDirTo;
|
||||||
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [1,0.564,0.564,1], DUMMY_POS, _size, _size, _relBearing, '', 0 ];
|
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [1,0.564,0.564,1], DUMMY_POS, _size, _size, _relBearing, '', 0 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
} else { //Map Mode:
|
} else { //Map Mode:
|
||||||
if (GVAR(mapAutoTrackPosition)) then {
|
if (GVAR(mapAutoTrackPosition)) then {
|
||||||
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ace_player)];
|
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ACE_player)];
|
||||||
ctrlMapAnimCommit _theMap;
|
ctrlMapAnimCommit _theMap;
|
||||||
};
|
};
|
||||||
_size = 48 * _mapSize;
|
_size = 48 * _mapSize;
|
||||||
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ace_player), _size, _size, (getDir ace_player), '', 0 ];
|
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ACE_player), _size, _size, (getDir ACE_player), '', 0 ];
|
||||||
|
|
||||||
if (GVAR(settingShowAllWaypointsOnMap)) then {
|
if (GVAR(settingShowAllWaypointsOnMap)) then {
|
||||||
_size = 32 * _mapSize;
|
_size = 32 * _mapSize;
|
||||||
{
|
{
|
||||||
EXPLODE_2_PVT(_x,_wpName,_wpPos);
|
_x params ["_wpName", "_wpPos"];
|
||||||
_alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5};
|
_alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5};
|
||||||
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_mapWaypoints.paa)), [1,1,1,_alpha], _wpPos, _size, _size, 0, '', 0 ];
|
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_mapWaypoints.paa)), [1,1,1,_alpha], _wpPos, _size, _size, 0, '', 0 ];
|
||||||
} forEach _waypoints;
|
} forEach _waypoints;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* 0: String of the map button pressed <STRING>
|
* 0: String of the map button pressed <STRING>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* ["autotrack"] call ace_microdagr_fnc_modeMapButtons
|
* ["autotrack"] call ace_microdagr_fnc_modeMapButtons
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_1(_mode);
|
params ["_mode"];
|
||||||
|
|
||||||
[-1] call FUNC(saveCurrentAndSetNewMode); //backup current draw pos/zoom
|
[-1] call FUNC(saveCurrentAndSetNewMode); //backup current draw pos/zoom
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* 2: Module Activated <BOOL>
|
* 2: Module Activated <BOOL>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [module, [], true] call ace_microdagr_fnc_moduleMapFill
|
* [module, [], true] call ace_microdagr_fnc_moduleMapFill
|
||||||
@ -17,10 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_3(_logic,_syncedUnits,_activated);
|
if !(isServer) exitWith {};
|
||||||
|
params ["_logic", "_syncedUnits", "_activated"];
|
||||||
|
|
||||||
if (!_activated) exitWith {WARNING("Module Placed but not active");};
|
if (!_activated) exitWith {WARNING("Module Placed but not active");};
|
||||||
|
|
||||||
if (isServer) then {
|
|
||||||
[_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule);
|
|
||||||
};
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* 0: Display Mode to show the microDAGR in <NUMBER><OPTIONAL>
|
* 0: Display Mode to show the microDAGR in <NUMBER><OPTIONAL>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [1] call ace_microdagr_fnc_openDisplay
|
* [1] call ace_microdagr_fnc_openDisplay
|
||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
private ["_oldShowMode", "_args", "_pfID", "_player"];
|
private ["_oldShowMode", "_args", "_pfID", "_player"];
|
||||||
|
|
||||||
DEFAULT_PARAM(0,_newDisplayShowMode,-1);
|
params [["_newDisplayShowMode", -1, [-1]]];
|
||||||
_oldShowMode = GVAR(currentShowMode);
|
_oldShowMode = GVAR(currentShowMode);
|
||||||
|
|
||||||
if (_newDisplayShowMode == -1) then {
|
if (_newDisplayShowMode == -1) then {
|
||||||
@ -34,7 +34,7 @@ if ((_newDisplayShowMode == DISPLAY_MODE_DIALOG) && {!([DISPLAY_MODE_DIALOG] cal
|
|||||||
//On first-startup
|
//On first-startup
|
||||||
if (GVAR(currentApplicationPage) == APP_MODE_NULL) then {
|
if (GVAR(currentApplicationPage) == APP_MODE_NULL) then {
|
||||||
GVAR(currentApplicationPage) = APP_MODE_INFODISPLAY;
|
GVAR(currentApplicationPage) = APP_MODE_INFODISPLAY;
|
||||||
GVAR(mapPosition) = getPos ace_player;
|
GVAR(mapPosition) = getPos ACE_player;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_newDisplayShowMode in [DISPLAY_MODE_CLOSED, DISPLAY_MODE_HIDDEN]) then {
|
if (_newDisplayShowMode in [DISPLAY_MODE_CLOSED, DISPLAY_MODE_HIDDEN]) then {
|
||||||
@ -74,14 +74,14 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M
|
|||||||
//Start a pfeh to update display and handle hiding display
|
//Start a pfeh to update display and handle hiding display
|
||||||
|
|
||||||
[{
|
[{
|
||||||
PARAMS_2(_args,_pfID);
|
params ["_args", "_idPFH"];
|
||||||
EXPLODE_1_PVT(_args,_player);
|
_args params ["_player"];
|
||||||
if ((isNull ace_player) || {!alive ace_player} || {ace_player != _player} || {!("ACE_microDAGR" in (items ace_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then {
|
if ((isNull ACE_player) || {!alive ACE_player} || {ACE_player != _player} || {!("ACE_microDAGR" in (items ACE_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then {
|
||||||
//Close Display if still open:
|
//Close Display if still open:
|
||||||
if (GVAR(currentShowMode) != DISPLAY_MODE_CLOSED) then {
|
if (GVAR(currentShowMode) != DISPLAY_MODE_CLOSED) then {
|
||||||
[DISPLAY_MODE_CLOSED] call FUNC(openDisplay);
|
[DISPLAY_MODE_CLOSED] call FUNC(openDisplay);
|
||||||
};
|
};
|
||||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||||
} else {
|
} else {
|
||||||
if (GVAR(currentShowMode) == DISPLAY_MODE_HIDDEN) then {
|
if (GVAR(currentShowMode) == DISPLAY_MODE_HIDDEN) then {
|
||||||
//If display is hidden, and we can show, then swithc modes:
|
//If display is hidden, and we can show, then swithc modes:
|
||||||
@ -96,5 +96,5 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}, 0.1, [ace_player]] call CBA_fnc_addPerFrameHandler;
|
}, 0.1, [ACE_player]] call CBA_fnc_addPerFrameHandler;
|
||||||
};
|
};
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* 2: Inclination (Degrees) <NUMBER>
|
* 2: Inclination (Degrees) <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [1000, 45, 1] call ace_microdagr_fnc_recieveRangefinderData
|
* [1000, 45, 1] call ace_microdagr_fnc_recieveRangefinderData
|
||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
private ["_horizontalDistance", "_verticleDistance", "_targetOffset", "_targetPosASL"];
|
private ["_horizontalDistance", "_verticleDistance", "_targetOffset", "_targetPosASL"];
|
||||||
|
|
||||||
PARAMS_3(_slopeDistance,_azimuth,_inclination);
|
params ["_slopeDistance", "_azimuth", "_inclination"];
|
||||||
|
|
||||||
if (GVAR(currentWaypoint) != -2) exitWith {}; //Only take waypoint when "connected"
|
if (GVAR(currentWaypoint) != -2) exitWith {}; //Only take waypoint when "connected"
|
||||||
if (_slopeDistance < 0) exitWith {}; //Bad Data
|
if (_slopeDistance < 0) exitWith {}; //Bad Data
|
||||||
@ -29,6 +29,6 @@ _verticleDistance = (sin _inclination) * _slopeDistance;
|
|||||||
|
|
||||||
_targetOffset = [((sin _azimuth) * _horizontalDistance), ((cos _azimuth) * _horizontalDistance), _verticleDistance];
|
_targetOffset = [((sin _azimuth) * _horizontalDistance), ((cos _azimuth) * _horizontalDistance), _verticleDistance];
|
||||||
//This assumes the "rangefinder view" pos is very close to player, at worst the turret should only be a few meters different
|
//This assumes the "rangefinder view" pos is very close to player, at worst the turret should only be a few meters different
|
||||||
_targetPosASL = (getPosASL ace_player) vectorAdd _targetOffset;
|
_targetPosASL = (getPosASL ACE_player) vectorAdd _targetOffset;
|
||||||
|
|
||||||
GVAR(rangeFinderPositionASL) = _targetPosASL;
|
GVAR(rangeFinderPositionASL) = _targetPosASL;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* 0: New Mode <NUMBER>
|
* 0: New Mode <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [2] call ace_microdagr_fnc_saveCurrentAndSetNewMode
|
* [2] call ace_microdagr_fnc_saveCurrentAndSetNewMode
|
||||||
@ -16,24 +16,21 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_display", "_theMap", "_mapSize", "_centerPos", "_mapCtrlPos"];
|
private ["_display", "_theMap", "_centerPos", "_mapCtrlPos"];
|
||||||
|
|
||||||
PARAMS_1(_newMode);
|
params ["_newMode"];
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
_display = displayNull;
|
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
|
||||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
|
||||||
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
|
|
||||||
} else {
|
|
||||||
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
|
|
||||||
};
|
|
||||||
if (isNull _display) exitWith {ERROR("No Display");};
|
if (isNull _display) exitWith {ERROR("No Display");};
|
||||||
|
|
||||||
if (GVAR(currentApplicationPage) == 2) then {
|
if (GVAR(currentApplicationPage) == 2) then {
|
||||||
_theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS};
|
_theMap = [_display displayCtrl IDC_MAPDETAILS, _display displayCtrl IDC_MAPPLAIN] select (!GVAR(mapShowTexture));
|
||||||
_mapCtrlPos = ctrlPosition _theMap;
|
_mapCtrlPos = ctrlPosition _theMap;
|
||||||
_mapSize = _mapCtrlPos select 3;
|
|
||||||
_centerPos = [((_mapCtrlPos select 0) + (_mapCtrlPos select 2) / 2), ((_mapCtrlPos select 1) + (_mapCtrlPos select 3) / 2)];
|
_mapCtrlPos params ["_mapCtrlPosX", "_mapCtrlPosY", "_mapCtrlPosZ", "_mapSize"];
|
||||||
|
_centerPos = [(_mapCtrlPosX + _mapCtrlPosZ / 2), (_mapCtrlPosY + _mapSize / 2)];
|
||||||
GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos;
|
GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos;
|
||||||
GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize;
|
GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize;
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
* Changes the "application page" shown on the microDAGR
|
* Changes the "application page" shown on the microDAGR
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [] call ace_microdagr_fnc_showApplicationPage
|
* [] call ace_microdagr_fnc_showApplicationPage
|
||||||
@ -19,12 +19,8 @@ private ["_display", "_theMap", "_mapSize"];
|
|||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
|
|
||||||
_display = displayNull;
|
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
|
||||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
|
||||||
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
|
|
||||||
} else {
|
|
||||||
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
|
|
||||||
};
|
|
||||||
if (isNull _display) exitWith {ERROR("No Display");};
|
if (isNull _display) exitWith {ERROR("No Display");};
|
||||||
|
|
||||||
//TopBar
|
//TopBar
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
* Updates the display (several times a second) called from the pfeh
|
* Updates the display (several times a second) called from the pfeh
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [] call ace_microdagr_fnc_updateDisplay
|
* [] call ace_microdagr_fnc_updateDisplay
|
||||||
@ -18,12 +18,8 @@
|
|||||||
private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_playerPos2d", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString"];
|
private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_playerPos2d", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString"];
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
_display = displayNull;
|
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
|
||||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
|
||||||
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
|
|
||||||
} else {
|
|
||||||
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
|
|
||||||
};
|
|
||||||
if (isNull _display) exitWith {ERROR("No Display");};
|
if (isNull _display) exitWith {ERROR("No Display");};
|
||||||
|
|
||||||
//Fade "shell" at night
|
//Fade "shell" at night
|
||||||
@ -44,21 +40,21 @@ case (APP_MODE_INFODISPLAY): {
|
|||||||
(_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText;
|
(_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText;
|
||||||
|
|
||||||
//Elevation:
|
//Elevation:
|
||||||
_numASL = ((getPosASL ace_player) select 2) + EGVAR(common,mapAltitude);
|
_numASL = ((getPosASL ACE_player) select 2) + EGVAR(common,mapAltitude);
|
||||||
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
|
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
|
||||||
_aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"};
|
_aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"};
|
||||||
(_display displayCtrl IDC_MODEDISPLAY_ELEVATIONNUM) ctrlSetText _aboveSeaLevelText;
|
(_display displayCtrl IDC_MODEDISPLAY_ELEVATIONNUM) ctrlSetText _aboveSeaLevelText;
|
||||||
|
|
||||||
//Heading:
|
//Heading:
|
||||||
_compassAngleText = if (GVAR(settingUseMils)) then {
|
_compassAngleText = if (GVAR(settingUseMils)) then {
|
||||||
[(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber;
|
[(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber;
|
||||||
} else {
|
} else {
|
||||||
([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
||||||
};
|
};
|
||||||
(_display displayCtrl IDC_MODEDISPLAY_HEADINGNUM) ctrlSetText _compassAngleText;
|
(_display displayCtrl IDC_MODEDISPLAY_HEADINGNUM) ctrlSetText _compassAngleText;
|
||||||
|
|
||||||
//Speed:
|
//Speed:
|
||||||
(_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ace_player)))];;
|
(_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ACE_player)))];;
|
||||||
|
|
||||||
|
|
||||||
if (GVAR(currentWaypoint) == -1) then {
|
if (GVAR(currentWaypoint) == -1) then {
|
||||||
@ -89,13 +85,13 @@ case (APP_MODE_INFODISPLAY): {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!(_targetPosLocationASL isEqualTo [])) then {
|
if (!(_targetPosLocationASL isEqualTo [])) then {
|
||||||
_bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo;
|
_bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo;
|
||||||
_bearingText = if (GVAR(settingUseMils)) then {
|
_bearingText = if (GVAR(settingUseMils)) then {
|
||||||
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
|
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
|
||||||
} else {
|
} else {
|
||||||
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
||||||
};
|
};
|
||||||
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
|
_2dDistanceKm = (((getPosASL ACE_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
|
||||||
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
|
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
|
||||||
_numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude);
|
_numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude);
|
||||||
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
|
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
|
||||||
@ -111,14 +107,14 @@ case (APP_MODE_INFODISPLAY): {
|
|||||||
case (APP_MODE_COMPASS): {
|
case (APP_MODE_COMPASS): {
|
||||||
//Heading:
|
//Heading:
|
||||||
_compassAngleText = if (GVAR(settingUseMils)) then {
|
_compassAngleText = if (GVAR(settingUseMils)) then {
|
||||||
[(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber;
|
[(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber;
|
||||||
} else {
|
} else {
|
||||||
([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
||||||
};
|
};
|
||||||
(_display displayCtrl IDC_MODECOMPASS_HEADING) ctrlSetText _compassAngleText;
|
(_display displayCtrl IDC_MODECOMPASS_HEADING) ctrlSetText _compassAngleText;
|
||||||
|
|
||||||
//Speed:
|
//Speed:
|
||||||
_SpeedText = format ["%1kph", (round (speed (vehicle ace_player)))];;
|
_SpeedText = format ["%1kph", (round (speed (vehicle ACE_player)))];;
|
||||||
(_display displayCtrl IDC_MODECOMPASS_SPEED) ctrlSetText _SpeedText;
|
(_display displayCtrl IDC_MODECOMPASS_SPEED) ctrlSetText _SpeedText;
|
||||||
|
|
||||||
if (GVAR(currentWaypoint) == -1) then {
|
if (GVAR(currentWaypoint) == -1) then {
|
||||||
@ -126,7 +122,7 @@ case (APP_MODE_COMPASS): {
|
|||||||
(_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText "";
|
(_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText "";
|
||||||
(_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText "";
|
(_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText "";
|
||||||
} else {
|
} else {
|
||||||
_playerPos2d = (getPosASL ace_player) select [0,2];
|
_playerPos2d = (getPosASL ACE_player) select [0,2];
|
||||||
|
|
||||||
_targetPosName = "";
|
_targetPosName = "";
|
||||||
_targetPosLocationASL = [];
|
_targetPosLocationASL = [];
|
||||||
@ -147,13 +143,13 @@ case (APP_MODE_COMPASS): {
|
|||||||
_rangeText = "---";
|
_rangeText = "---";
|
||||||
|
|
||||||
if (!(_targetPosLocationASL isEqualTo [])) then {
|
if (!(_targetPosLocationASL isEqualTo [])) then {
|
||||||
_bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo;
|
_bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo;
|
||||||
_bearingText = if (GVAR(settingUseMils)) then {
|
_bearingText = if (GVAR(settingUseMils)) then {
|
||||||
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
|
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
|
||||||
} else {
|
} else {
|
||||||
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
||||||
};
|
};
|
||||||
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
|
_2dDistanceKm = (((getPosASL ACE_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
|
||||||
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
|
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -171,7 +167,7 @@ case (APP_MODE_WAYPOINTS): {
|
|||||||
{
|
{
|
||||||
EXPLODE_2_PVT(_x,_wpName,_wpPos);
|
EXPLODE_2_PVT(_x,_wpName,_wpPos);
|
||||||
_wpListBox lbAdd _wpName;
|
_wpListBox lbAdd _wpName;
|
||||||
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_wpPos select [0,2])) / 1000;
|
_2dDistanceKm = (((getPosASL ACE_player) select [0,2]) distance (_wpPos select [0,2])) / 1000;
|
||||||
_wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])];
|
_wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])];
|
||||||
} forEach _waypoints;
|
} forEach _waypoints;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user