mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Various Changes
This commit is contained in:
parent
f387da1475
commit
1d6cfbf6b7
32
addons/microdagr/CfgVehicles.hpp
Normal file
32
addons/microdagr/CfgVehicles.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
class CfgVehicles {
|
||||
class Logic;
|
||||
class Module_F: Logic {
|
||||
class ArgumentsBaseUnits {};
|
||||
class ModuleDescription {};
|
||||
};
|
||||
class GVAR(dagrModule): Module_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
category = "ACE";
|
||||
displayName = "MicroDAGR Map Fill";
|
||||
function = QFUNC(moduleMapFill);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
// icon = QUOTE(PATHTOF(ui\IconLock_ca.paa));
|
||||
functionPriority = 0;
|
||||
class Arguments {
|
||||
class MapDataAvailable {
|
||||
displayName = "MicroDAGR Map Fill"; // Argument label
|
||||
description = "How much map data is filled on MicroDAGRs "; // Tooltip description
|
||||
typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL"
|
||||
class values {
|
||||
class None {name = "Full Satellite + Buildings"; value = MAP_DETAIL_SAT; default = 1;};
|
||||
class Side {name = "Topographical + Roads"; value = MAP_DETAIL_TOPOROADS;};
|
||||
class Unique {name = "None (Cannot use map view)"; value = MAP_DETAIL_NONE;};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ModuleDescription: ModuleDescription {
|
||||
description = "Controls how muchdata is filled in the microDAGR items. Less data restricts the map view to show less on the minimap.<br/>Source: microDAGR.pbo";
|
||||
};
|
||||
};
|
||||
};
|
@ -8,8 +8,6 @@ class CfgWeapons {
|
||||
displayName = "$STR_ACE_microdagr_itemName";
|
||||
descriptionShort = "$STR_ACE_microdagr_itemDescription";
|
||||
picture = QUOTE(PATHTOF(images\microDAGR_item.paa));
|
||||
icon = "iconObject_circle";
|
||||
mapSize = 0.034;
|
||||
class ItemInfo: InventoryItem_Base_F {
|
||||
mass = 2;
|
||||
};
|
||||
|
@ -12,6 +12,7 @@ if (!hasInterface) exitWith {};
|
||||
// Conditions: specific
|
||||
if (!("ACE_microDAGR" in (items ace_player))) exitWith {false};
|
||||
|
||||
systemChat "Toggle Button Press";
|
||||
[] call FUNC(openDisplay);
|
||||
true;
|
||||
},
|
||||
@ -26,6 +27,7 @@ if (!hasInterface) exitWith {};
|
||||
// Conditions: specific
|
||||
if (!("ACE_microDAGR" in (items ace_player))) exitWith {false};
|
||||
|
||||
systemChat "Close Button Press";
|
||||
[DISPLAY_MODE_CLOSED] call FUNC(openDisplay);
|
||||
true;
|
||||
},
|
||||
@ -46,7 +48,7 @@ GVAR(currentShowMode) = DISPLAY_MODE_CLOSED;
|
||||
GVAR(newWaypointPosition) = [];
|
||||
GVAR(currentWaypoint) = -1;
|
||||
GVAR(rangeFinderPositionASL) = [];
|
||||
GVAR(waypointList) = [["Alpha Base", [4000, 4000, 69]], ["Bravo Base", [5000, 5000, 0]]];
|
||||
|
||||
|
||||
GVAR(mapAltitude) = getNumber (configFile >> "CfgWorlds" >> worldName >> "elevationOffset");
|
||||
|
||||
|
@ -6,10 +6,15 @@ PREP(appMarkKeypadEntry);
|
||||
PREP(appMenuButtonConnectRangefinder);
|
||||
PREP(appWaypointsButtonDeleteWP);
|
||||
PREP(appWaypointsButtonSetWP);
|
||||
PREP(canShow);
|
||||
PREP(deviceAddWaypoint);
|
||||
PREP(deviceDeleteWaypoint);
|
||||
PREP(deviceGetWaypoints);
|
||||
PREP(dialogClosedEH);
|
||||
PREP(mapDoubleTapEH);
|
||||
PREP(mapOnDrawEH);
|
||||
PREP(modeMapButtons);
|
||||
PREP(moduleMapFill);
|
||||
PREP(openDisplay);
|
||||
PREP(recieveRangefinderData);
|
||||
PREP(saveCurrentAndSetNewMode);
|
||||
|
@ -7,10 +7,20 @@ class CfgPatches {
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"PabstMirror"};
|
||||
authorUrl = "https://github.com/PabstMirror/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "gui.hpp"
|
||||
|
||||
class ACE_Settings {
|
||||
class GVAR(MapDataAvailable) {
|
||||
value = 2;
|
||||
typeName = "SCALAR";
|
||||
isClientSetable = 0;
|
||||
};
|
||||
};
|
||||
|
@ -20,11 +20,13 @@
|
||||
PARAMS_1(_keypadButton);
|
||||
|
||||
disableSerialization;
|
||||
_display = (uiNamespace getVariable ["testGPS", displayNull]);
|
||||
if (isNull _display) then {
|
||||
_display = (uiNamespace getVariable ["testGPS_T", displayNull]);
|
||||
_display = 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 {};
|
||||
if (isNull _display) exitWith {ERROR("No Display");};
|
||||
|
||||
if (GVAR(currentApplicationPage) != APP_MODE_MARK) exitWith {};
|
||||
|
||||
@ -37,7 +39,7 @@ case ("ok"): {
|
||||
GVAR(newWaypointPosition) = _actualPos;
|
||||
[APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode);
|
||||
} else {
|
||||
GVAR(waypointList) pushBack [_editText, GVAR(newWaypointPosition)];
|
||||
[_editText, GVAR(newWaypointPosition)] call FUNC(deviceAddWaypoint);
|
||||
[APP_MODE_WAYPOINTS] call FUNC(saveCurrentAndSetNewMode);
|
||||
};
|
||||
};
|
||||
|
@ -18,19 +18,20 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
disableSerialization;
|
||||
_display = (uiNamespace getVariable ["testGPS", displayNull]);
|
||||
if (isNull _display) then { _display = (uiNamespace getVariable ["testGPS_T", displayNull]);};
|
||||
if (isNull _display) exitWith {};
|
||||
_display = 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");};
|
||||
|
||||
_wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS);
|
||||
if ((_wpIndex < 0) || (_wpIndex > ((count GVAR(waypointList)) - 1))) exitWith {
|
||||
ERROR("out of bounds wp");
|
||||
};
|
||||
|
||||
//If it's our currentWP then deactivate
|
||||
if (GVAR(currentWaypoint) == _wpIndex) then {GVAR(currentWaypoint) = -1};
|
||||
|
||||
//Delete from list:
|
||||
GVAR(waypointList) deleteAt _wpIndex;
|
||||
[_wpIndex] call FUNC(deviceDeleteWaypoint);
|
||||
//Update list now:
|
||||
[] call FUNC(updateDisplay);
|
||||
|
@ -21,7 +21,10 @@ disableSerialization;
|
||||
_wpButton = _this select 0;
|
||||
_wpListBox = (ctrlParent _wpButton) displayCtrl 144501;
|
||||
_newWpIndex = lbCurSel _wpListBox;
|
||||
if ((_newWpIndex < 0) || (_newWpIndex > ((count GVAR(waypointList)) - 1))) exitWith {
|
||||
_waypoints = [] call FUNC(deviceGetWaypoints);
|
||||
|
||||
|
||||
if ((_newWpIndex < 0) || (_newWpIndex > ((count _waypoints) - 1))) exitWith {
|
||||
GVAR(currentWaypoint) = -1;
|
||||
ERROR("out of bounds wp");
|
||||
};
|
||||
|
24
addons/microdagr/functions/fnc_deviceAddWaypoint.sqf
Normal file
24
addons/microdagr/functions/fnc_deviceAddWaypoint.sqf
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Takes some arguments and returns something or other.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The first argument <STRING>
|
||||
* 1: The second argument <OBJECT>
|
||||
* 2: Third Optional Argument <BOOL><OPTIONAL>
|
||||
*
|
||||
* Return Value:
|
||||
* The return value <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* _bool = ["something", player] call ace_common_fnc_imanexample
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_waypointName,_waypointPosASL);
|
||||
|
||||
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
|
||||
_waypoints pushBack [_waypointName, _waypointPosASL];
|
||||
ace_player setVariable [QGVAR(waypoints), _waypoints];
|
27
addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf
Normal file
27
addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Takes some arguments and returns something or other.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The first argument <STRING>
|
||||
* 1: The second argument <OBJECT>
|
||||
* 2: Third Optional Argument <BOOL><OPTIONAL>
|
||||
*
|
||||
* Return Value:
|
||||
* The return value <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* _bool = ["something", player] call ace_common_fnc_imanexample
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_wpIndex);
|
||||
|
||||
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
|
||||
|
||||
if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");};
|
||||
|
||||
_waypoints deleteAt _wpIndex;
|
||||
ace_player setVariable [QGVAR(waypoints), _waypoints];
|
20
addons/microdagr/functions/fnc_deviceGetWaypoints.sqf
Normal file
20
addons/microdagr/functions/fnc_deviceGetWaypoints.sqf
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Takes some arguments and returns something or other.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The first argument <STRING>
|
||||
* 1: The second argument <OBJECT>
|
||||
* 2: Third Optional Argument <BOOL><OPTIONAL>
|
||||
*
|
||||
* Return Value:
|
||||
* The return value <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* _bool = ["something", player] call ace_common_fnc_imanexample
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
(ace_player getVariable [QGVAR(waypoints), []])
|
@ -18,7 +18,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
systemChat "Debug: dialog closed";
|
||||
if (GVAR(currentShowMode) == 2) then {
|
||||
[-1] call FUNC(saveCurrentAndSetNewMode);;
|
||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
||||
[-1] call FUNC(saveCurrentAndSetNewMode);
|
||||
[DISPLAY_MODE_DISPLAY] call FUNC(openDisplay);
|
||||
};
|
||||
|
@ -20,6 +20,8 @@
|
||||
_theMap = _this select 0;
|
||||
_mapSize = (ctrlPosition _theMap) select 3;
|
||||
|
||||
_waypoints = [] call FUNC(deviceGetWaypoints);
|
||||
|
||||
if (GVAR(currentApplicationPage) == 1) then {
|
||||
_theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS];
|
||||
ctrlMapAnimCommit _theMap;
|
||||
@ -34,7 +36,9 @@ if (GVAR(currentApplicationPage) == 1) then {
|
||||
_targetPos = GVAR(rangeFinderPositionASL);
|
||||
};
|
||||
} else {
|
||||
_targetPos = (GVAR(waypointList) select GVAR(currentWaypoint)) select 1;
|
||||
if (GVAR(currentWaypoint) < (count _waypoints)) then {
|
||||
_targetPos = (_waypoints select GVAR(currentWaypoint)) select 1;
|
||||
};
|
||||
};
|
||||
if ((count _targetPos) == 3) then {
|
||||
_relBearing = [ace_player, _targetPos] call BIS_fnc_relativeDirTo;
|
||||
|
26
addons/microdagr/functions/fnc_moduleMapFill.sqf
Normal file
26
addons/microdagr/functions/fnc_moduleMapFill.sqf
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Takes some arguments and returns something or other.
|
||||
*
|
||||
* Arguments:
|
||||
* 0:logic <OBJECT>
|
||||
* 1: synced units-not used <ARRAY>
|
||||
* 2: Module Activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* The return value <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* _bool = ["something", player] call ace_common_fnc_imanexample
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_logic,_syncedUnits,_activated);
|
||||
|
||||
if (!_activated) exitWith {WARNING("Module Placed but not active");};
|
||||
|
||||
if (isServer) then {
|
||||
[_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule);
|
||||
};
|
@ -17,56 +17,87 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
_this spawn {
|
||||
_swap = if (GVAR(currentShowMode) == DISPLAY_MODE_DISPLAY) then {DISPLAY_MODE_DIALOG} else {DISPLAY_MODE_DISPLAY};
|
||||
DEFAULT_PARAM(0,_newDisplayShowMode,_swap);
|
||||
GVAR(currentShowMode) = _newDisplayShowMode;
|
||||
DEFAULT_PARAM(0,_newDisplayShowMode,-1);
|
||||
_oldShowMode = GVAR(currentShowMode);
|
||||
|
||||
systemChat format ["New ShowMode: %1", GVAR(currentShowMode)];
|
||||
if (_newDisplayShowMode == -1) then {
|
||||
if (_oldShowMode in [DISPLAY_MODE_DISPLAY, DISPLAY_MODE_HIDDEN]) then {_newDisplayShowMode = DISPLAY_MODE_DIALOG};
|
||||
if (_oldShowMode in [DISPLAY_MODE_DIALOG, DISPLAY_MODE_CLOSED]) then {_newDisplayShowMode = DISPLAY_MODE_DISPLAY};
|
||||
};
|
||||
|
||||
disableSerialization;
|
||||
if ((_newDisplayShowMode == DISPLAY_MODE_DISPLAY) && {!([DISPLAY_MODE_DISPLAY] call FUNC(canShow))}) then {_newDisplayShowMode = DISPLAY_MODE_HIDDEN};
|
||||
if ((_newDisplayShowMode == DISPLAY_MODE_DIALOG) && {!([DISPLAY_MODE_DIALOG] call FUNC(canShow))}) then {_newDisplayShowMode = DISPLAY_MODE_HIDDEN};
|
||||
|
||||
//On first-startup
|
||||
if (GVAR(currentApplicationPage) == APP_MODE_NULL) then {
|
||||
GVAR(currentApplicationPage) = APP_MODE_MARK;
|
||||
GVAR(mapPosition) = getPos ace_player;
|
||||
GVAR(currentShowMode) = _newDisplayShowMode;
|
||||
|
||||
disableSerialization;
|
||||
|
||||
//On first-startup
|
||||
if (GVAR(currentApplicationPage) == APP_MODE_NULL) then {
|
||||
GVAR(currentApplicationPage) = APP_MODE_INFO;
|
||||
GVAR(mapPosition) = getPos ace_player;
|
||||
};
|
||||
|
||||
systemChat format ["%1 to %2 from %3", _oldShowMode, GVAR(currentShowMode), _this];
|
||||
|
||||
|
||||
if (GVAR(currentShowMode) in [DISPLAY_MODE_CLOSED, DISPLAY_MODE_HIDDEN]) then {
|
||||
systemChat "Closing";
|
||||
|
||||
//If Dialog is open, back it up before closing:
|
||||
if (dialog && {!isNull (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull])}) then {
|
||||
[-1] call FUNC(saveCurrentAndSetNewMode);
|
||||
closeDialog 0;
|
||||
};
|
||||
|
||||
|
||||
_display = displayNull;
|
||||
if (_newDisplayShowMode == 0) then {
|
||||
systemChat "Closing";
|
||||
if (dialog && {!isNull (uiNamespace getVariable ["testGPS", displayNull])}) then {
|
||||
|
||||
//Close the display:
|
||||
(QGVAR(TheRscTitleDisplay) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
|
||||
} else {
|
||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DISPLAY) then {
|
||||
systemChat "Opening Display";
|
||||
//If Dialog is open, back it up before closing:
|
||||
if (dialog && {!isNull (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull])}) then {
|
||||
[-1] call FUNC(saveCurrentAndSetNewMode);
|
||||
closeDialog 0;
|
||||
};
|
||||
("testGPS_T" call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
|
||||
//Open the display:
|
||||
(QGVAR(TheRscTitleDisplay) call BIS_fnc_rscLayer) cutRsc [QGVAR(TheRscTitleDisplay), "PLAIN", 0, true];
|
||||
} else {
|
||||
if (_newDisplayShowMode == 1) then {
|
||||
systemChat "Opening Display";
|
||||
if (dialog && {!isNull (uiNamespace getVariable ["testGPS", displayNull])}) then {
|
||||
systemChat "backing up";
|
||||
[-1] call FUNC(saveCurrentAndSetNewMode);
|
||||
closeDialog 0;
|
||||
};
|
||||
("testGPS_T" call BIS_fnc_rscLayer) cutRsc ["testGPS_T", "PLAIN", 0, true];
|
||||
_display = (uiNamespace getVariable ["testGPS_T", displayNull]);
|
||||
} else {
|
||||
systemChat "Opening Dialog";
|
||||
("testGPS_T" call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
|
||||
createDialog "testGPS";
|
||||
_display = (uiNamespace getVariable ["testGPS", displayNull]);
|
||||
};
|
||||
};
|
||||
|
||||
[] call FUNC(showApplicationPage);
|
||||
|
||||
waitUntil {
|
||||
if (isNull _display) exitWith {true};
|
||||
[] call FUNC(updateDisplay);
|
||||
GVAR(gpsPositionASL) = getPosAsl player;
|
||||
GVAR(compassDirection) = getDir player;
|
||||
sleep 0.1;
|
||||
false;
|
||||
systemChat "Opening Dialog";
|
||||
//Close the display:
|
||||
(QGVAR(TheRscTitleDisplay) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
|
||||
//Open the dialog:
|
||||
createDialog QGVAR(TheDialog);
|
||||
};
|
||||
};
|
||||
|
||||
[] call FUNC(showApplicationPage);
|
||||
|
||||
if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_MODE_CLOSED}) then {
|
||||
//Start a pfeh to update display and handle hiding display
|
||||
|
||||
[{
|
||||
disableSerialization;
|
||||
PARAMS_2(_args,_pfID);
|
||||
EXPLODE_1_PVT(_args,_player);
|
||||
|
||||
if ((ace_player != _player) || {!("ACE_microDAGR" in (items ace_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then {
|
||||
GVAR(currentShowMode) = DISPLAY_MODE_CLOSED;
|
||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||
} else {
|
||||
GVAR(gpsPositionASL) = getPosAsl player;
|
||||
|
||||
if (GVAR(currentShowMode) == DISPLAY_MODE_HIDDEN) then {
|
||||
if ([DISPLAY_MODE_DISPLAY] call FUNC(canShow)) then {
|
||||
[DISPLAY_MODE_DISPLAY] call FUNC(openDisplay);
|
||||
};
|
||||
} else {
|
||||
if ([GVAR(currentShowMode)] call FUNC(canShow)) then {
|
||||
[] call FUNC(updateDisplay);
|
||||
} else {
|
||||
[DISPLAY_MODE_HIDDEN] call FUNC(openDisplay);
|
||||
};
|
||||
};
|
||||
};
|
||||
}, 0.1, [ace_player]] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
@ -21,9 +21,13 @@ PARAMS_1(_newMode);
|
||||
systemChat format ["Switching App To %1", _newMode];
|
||||
|
||||
disableSerialization;
|
||||
_display = (uiNamespace getVariable ["testGPS", displayNull]);
|
||||
if (isNull _display) then { _display = (uiNamespace getVariable ["testGPS_T", displayNull]);};
|
||||
if (isNull _display) exitWith {};
|
||||
_display = 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 (GVAR(currentApplicationPage) == 2) then {
|
||||
_theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS};
|
||||
@ -32,12 +36,28 @@ if (GVAR(currentApplicationPage) == 2) then {
|
||||
_centerPos = [((_pos select 0) + (_pos select 2) / 2), ((_pos select 1) + (_pos select 3) / 2)];
|
||||
GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos;
|
||||
GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize;
|
||||
|
||||
//Hit button again, toggle map modes:
|
||||
if (_newMode == 2) then {
|
||||
GVAR(mapShowTexture) = !GVAR(mapShowTexture);
|
||||
if (GVAR(mapShowTexture)) then {
|
||||
GVAR(mapShowTexture) = false;
|
||||
} else {
|
||||
if (GVAR(MapDataAvailable) == MAP_DETAIL_SAT) then {
|
||||
GVAR(mapShowTexture) = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Can't switch to map if no map loaded
|
||||
if (_newMode == APP_MODE_MAP) then {
|
||||
if (GVAR(MapDataAvailable) == MAP_DETAIL_NONE) then {
|
||||
_newMode = -1;
|
||||
};
|
||||
};
|
||||
|
||||
if (_newMode != -1) then {
|
||||
GVAR(currentApplicationPage) = _newMode;
|
||||
[] call FUNC(showApplicationPage);
|
||||
};
|
||||
|
||||
|
@ -18,16 +18,18 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
disableSerialization;
|
||||
_display = (uiNamespace getVariable ["testGPS", displayNull]);
|
||||
_isControl = true;
|
||||
|
||||
if (isNull _display) then {
|
||||
_display = (uiNamespace getVariable ["testGPS_T", displayNull]);
|
||||
_isControl = false;
|
||||
_display = 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 {};
|
||||
if (isNull _display) exitWith {ERROR("No Display");};
|
||||
|
||||
//Fade "shell" at night
|
||||
systemChat format ["Showing %1 on %2", GVAR(currentApplicationPage), _display];
|
||||
|
||||
//Fade "shell" at night: TODO: find beter amibent light code
|
||||
_daylight = (1 - cos (daytime * 360/24)) / 2;
|
||||
(_display displayCtrl IDC_MICRODAGRSHELL) ctrlSetTextColor [_daylight, _daylight, _daylight, 1];
|
||||
|
||||
@ -102,6 +104,8 @@ if (GVAR(currentApplicationPage) == APP_MODE_MARK) then {
|
||||
|
||||
//Mode: Waypoints
|
||||
(_display displayCtrl IDC_MODEWAYPOINTS) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_WAYPOINTS);
|
||||
systemChat format ["WP %1 on %2", (GVAR(currentApplicationPage) == APP_MODE_WAYPOINTS), _display];
|
||||
|
||||
|
||||
//Button's pushed:
|
||||
if (GVAR(currentApplicationPage) == 0) then {
|
||||
|
@ -18,18 +18,20 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
disableSerialization;
|
||||
_display = (uiNamespace getVariable ["testGPS", displayNull]);
|
||||
_isControl = true;
|
||||
if (isNull _display) then {
|
||||
_display = (uiNamespace getVariable ["testGPS_T", displayNull]);
|
||||
_isControl = false;
|
||||
_display = 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 {};
|
||||
if (isNull _display) exitWith {ERROR("No Display");};
|
||||
|
||||
(_display displayCtrl IDC_CLOCKTEXT) ctrlSetText ([daytime, "HH:MM"] call bis_fnc_timeToString);
|
||||
|
||||
_waypoints = [] call FUNC(deviceGetWaypoints);
|
||||
|
||||
switch (GVAR(currentApplicationPage)) do {
|
||||
case (0): {
|
||||
case (APP_MODE_INFODISPLAY): {
|
||||
//Easting/Northing:
|
||||
_posString = mapGridPosition ACE_player;
|
||||
_eastingText = "";
|
||||
@ -74,9 +76,9 @@ case (0): {
|
||||
_targetPosLocationASL = GVAR(rangeFinderPositionASL);
|
||||
};
|
||||
} else {
|
||||
if (GVAR(currentWaypoint) > ((count GVAR(waypointList) - 1))) exitWith {ERROR("bounds");};
|
||||
_targetPosName = (GVAR(waypointList) select GVAR(currentWaypoint)) select 0;
|
||||
_targetPosLocationASL = (GVAR(waypointList) select GVAR(currentWaypoint)) select 1;
|
||||
if (GVAR(currentWaypoint) > ((count _waypoints) - 1)) exitWith {ERROR("bounds");};
|
||||
_targetPosName = (_waypoints select GVAR(currentWaypoint)) select 0;
|
||||
_targetPosLocationASL = (_waypoints select GVAR(currentWaypoint)) select 1;
|
||||
};
|
||||
|
||||
if (!(_targetPosLocationASL isEqualTo [])) then {
|
||||
@ -100,7 +102,7 @@ case (0): {
|
||||
|
||||
//bullshit gps accuracy: <t size='1' align='left'>EHE: +03.7</t><t size='1' align='right'>FOM: 1</t><br/><br/>
|
||||
};
|
||||
case (1): {
|
||||
case (APP_MODE_COMPASS): {
|
||||
//Heading:
|
||||
_compassAngleText = [(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber;
|
||||
_compassAngleText = _compassAngleText + "°M"; //degree symbol is in UTF-8
|
||||
@ -126,9 +128,9 @@ case (1): {
|
||||
_targetPosLocationASL = GVAR(rangeFinderPositionASL);
|
||||
};
|
||||
} else {
|
||||
if (GVAR(currentWaypoint) > ((count GVAR(waypointList) - 1))) exitWith {ERROR("bounds");};
|
||||
_targetPosName = (GVAR(waypointList) select GVAR(currentWaypoint)) select 0;
|
||||
_targetPosLocationASL = (GVAR(waypointList) select GVAR(currentWaypoint)) select 1;
|
||||
if (GVAR(currentWaypoint) > ((count _waypoints - 1))) exitWith {ERROR("bounds");};
|
||||
_targetPosName = (_waypoints select GVAR(currentWaypoint)) select 0;
|
||||
_targetPosLocationASL = (_waypoints select GVAR(currentWaypoint)) select 1;
|
||||
};
|
||||
|
||||
_bearing = "---";
|
||||
@ -150,16 +152,16 @@ case (1): {
|
||||
case (APP_MODE_WAYPOINTS): {
|
||||
_wpListBox = _display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS;
|
||||
_currentIndex = lbCurSel _wpListBox;
|
||||
|
||||
|
||||
lbClear _wpListBox;
|
||||
{
|
||||
EXPLODE_2_PVT(_x,_wpName,_wpPos);
|
||||
_wpListBox lbAdd _wpName;
|
||||
_2dDistanceKm = ((GVAR(gpsPositionASL) select [0,2]) distance (_wpPos select [0,2])) / 1000;
|
||||
_wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])];
|
||||
} forEach GVAR(waypointList);
|
||||
} forEach _waypoints;
|
||||
|
||||
_currentIndex = (_currentIndex max 0) min (count GVAR(waypointList));
|
||||
_currentIndex = (_currentIndex max 0) min (count _waypoints);
|
||||
_wpListBox lbSetCurSel _currentIndex;
|
||||
};
|
||||
};
|
||||
|
@ -6,12 +6,12 @@ class RscActiveText;
|
||||
class RscText;
|
||||
class RscPicture;
|
||||
class RscMapControl {
|
||||
class hospital;
|
||||
class church;
|
||||
class lighthouse;
|
||||
class power;
|
||||
class fuelstation;
|
||||
class transmitter;
|
||||
class hospital;
|
||||
class church;
|
||||
class lighthouse;
|
||||
class power;
|
||||
class fuelstation;
|
||||
class transmitter;
|
||||
};
|
||||
class RscMapControlEmpty;
|
||||
class RscControlsGroupNoScrollbars;
|
||||
@ -36,6 +36,7 @@ class GVAR(RscActiveTextPicture): RscActiveText {
|
||||
|
||||
class GVAR(RscText): RscText {
|
||||
font = "EtelkaMonospacePro";
|
||||
//Design note: I think less contrast in font color makes it look more natural and less "eye catching"
|
||||
colorText[] = {0.75,0.75,0.75,1};
|
||||
};
|
||||
|
||||
@ -45,13 +46,13 @@ class GVAR(RscText): RscText {
|
||||
#define W_PART(num) QUOTE((num) * (safeZoneH / 64))
|
||||
#define H_PART(num) QUOTE((num) * (safeZoneH / 36))
|
||||
|
||||
class testGPS {
|
||||
class GVAR(TheDialog) {
|
||||
idd = -1;
|
||||
movingEnable = 1;
|
||||
duration = 9999999;
|
||||
fadein = 0;
|
||||
fadeout = 0;
|
||||
onLoad = "uiNamespace setVariable ['testGPS', _this select 0];"; //@todo cbaify this
|
||||
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(DialogDisplay)),_this select 0)];);
|
||||
onUnload = QUOTE([] call FUNC(dialogClosedEH));
|
||||
|
||||
#include "gui_controls.hpp"
|
||||
@ -70,13 +71,13 @@ class testGPS {
|
||||
#define H_PART(num) QUOTE((num) / 25 * PROFILE_H)
|
||||
|
||||
class RscTitles {
|
||||
class testGPS_T {
|
||||
class GVAR(TheRscTitleDisplay) {
|
||||
idd = -1;
|
||||
movingEnable = 1;
|
||||
duration = 9999999;
|
||||
fadein = 0;
|
||||
fadeout = 0;
|
||||
onLoad = "uiNamespace setVariable ['testGPS_T', _this select 0];"; //@todo cbaify this
|
||||
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(RscTitleDisplay)),_this select 0)];);
|
||||
|
||||
#include "gui_controls.hpp"
|
||||
};
|
||||
|
@ -14,6 +14,10 @@
|
||||
#define DUMMY_POS [-1,-1]
|
||||
#define DUMMY_ZOOM 0.1
|
||||
|
||||
#define MAP_DETAIL_NONE 0
|
||||
#define MAP_DETAIL_TOPOROADS 1
|
||||
#define MAP_DETAIL_SAT 2
|
||||
|
||||
#define APP_MODE_NULL -1
|
||||
#define APP_MODE_INFODISPLAY 0
|
||||
#define APP_MODE_COMPASS 1
|
||||
@ -26,6 +30,7 @@
|
||||
#define DISPLAY_MODE_CLOSED 0
|
||||
#define DISPLAY_MODE_DISPLAY 1
|
||||
#define DISPLAY_MODE_DIALOG 2
|
||||
#define DISPLAY_MODE_HIDDEN 3
|
||||
|
||||
#define IDC_RANGEFINDERCONNECTEDICON 77700
|
||||
#define IDC_CLOCKTEXT 77701
|
||||
|
Loading…
Reference in New Issue
Block a user