diff --git a/addons/microdagr/CfgVehicles.hpp b/addons/microdagr/CfgVehicles.hpp
new file mode 100644
index 0000000000..7b2dcd132f
--- /dev/null
+++ b/addons/microdagr/CfgVehicles.hpp
@@ -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.
Source: microDAGR.pbo";
+ };
+ };
+};
diff --git a/addons/microdagr/CfgWeapons.hpp b/addons/microdagr/CfgWeapons.hpp
index 524082c7df..73615ea6b6 100644
--- a/addons/microdagr/CfgWeapons.hpp
+++ b/addons/microdagr/CfgWeapons.hpp
@@ -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;
};
diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf
index cb4b39c151..4e22ce90b0 100644
--- a/addons/microdagr/XEH_clientInit.sqf
+++ b/addons/microdagr/XEH_clientInit.sqf
@@ -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");
diff --git a/addons/microdagr/XEH_preInit.sqf b/addons/microdagr/XEH_preInit.sqf
index 9f4c068566..9cd95f7602 100644
--- a/addons/microdagr/XEH_preInit.sqf
+++ b/addons/microdagr/XEH_preInit.sqf
@@ -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);
diff --git a/addons/microdagr/config.cpp b/addons/microdagr/config.cpp
index c7b685bc0f..39380d7a2e 100644
--- a/addons/microdagr/config.cpp
+++ b/addons/microdagr/config.cpp
@@ -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;
+ };
+};
diff --git a/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf b/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf
index 3df54aa780..8adeecf200 100644
--- a/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf
+++ b/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf
@@ -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);
};
};
diff --git a/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf b/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf
index bac1ae1a1a..ab24630d81 100644
--- a/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf
+++ b/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf
@@ -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);
diff --git a/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf b/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf
index 17e9562eff..b322c4f7f8 100644
--- a/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf
+++ b/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf
@@ -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");
};
diff --git a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf
new file mode 100644
index 0000000000..3548c521fd
--- /dev/null
+++ b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf
@@ -0,0 +1,24 @@
+/*
+ * Author: PabstMirror
+ * Takes some arguments and returns something or other.
+ *
+ * Arguments:
+ * 0: The first argument
+ * 1: The second argument