diff --git a/addons/kestrel4500/CfgVehicles.hpp b/addons/kestrel4500/CfgVehicles.hpp
index 5f43200eea..0c10a21f61 100644
--- a/addons/kestrel4500/CfgVehicles.hpp
+++ b/addons/kestrel4500/CfgVehicles.hpp
@@ -2,14 +2,34 @@ class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_SelfActions {
- class ACE_OpenKestrel4500 {
- displayName = "$STR_ACE_Kestrel4500_OpenKestrelDialog";
- condition = QUOTE('ACE_Kestrel4500' in items _player && {!GVAR(Kestrel4500)});
- statement = QUOTE(call FUNC(createKestrelDialog));
- showDisabled = 0;
- priority = 2;
- icon = PATHTOF(UI\Kestrel4500_Icon.paa);
- hotkey = "K";
+ class ACE_Equipment {
+ class GVAR(open) {
+ displayName = "$STR_ACE_Kestrel4500_OpenKestrel";
+ condition = QUOTE(call FUNC(canShow) && !GVAR(Kestrel4500));
+ statement = QUOTE(call FUNC(createKestrelDialog));
+ showDisabled = 0;
+ priority = 0.1;
+ icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa));
+ exceptions[] = {"notOnMap"};
+ };
+ class GVAR(show) {
+ displayName = "$STR_ACE_Kestrel4500_ShowKestrel";
+ condition = QUOTE(call FUNC(canShow) && !GVAR(Kestrel4500_Overlay));
+ statement = QUOTE(call FUNC(displayKestrel));
+ showDisabled = 0;
+ priority = 0.2;
+ icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa));
+ exceptions[] = {"notOnMap"};
+ };
+ class GVAR(hide) {
+ displayName = "$STR_ACE_Kestrel4500_HideKestrel";
+ condition = QUOTE(GVAR(Kestrel4500_Overlay));
+ statement = QUOTE(call FUNC(displayKestrel));
+ showDisabled = 0;
+ priority = 0.3;
+ icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa));
+ exceptions[] = {"notOnMap"};
+ };
};
};
};
diff --git a/addons/kestrel4500/XEH_postInit.sqf b/addons/kestrel4500/XEH_postInit.sqf
index a80521a572..3ca65035d3 100644
--- a/addons/kestrel4500/XEH_postInit.sqf
+++ b/addons/kestrel4500/XEH_postInit.sqf
@@ -1,6 +1,6 @@
#include "script_component.hpp"
-#include "initKeybinds.sqf"
+//#include "initKeybinds.sqf"
GVAR(Kestrel4500_Menus) = ["Direction", "Wind SPD m/s", "CROSSWIND m/s", "HEADWIND m/s", "TEMP °C", "HUMIDITY %", "BARO hPA", "ALTITUDE m", "User Screen 1", "User Screen 2"];
diff --git a/addons/kestrel4500/XEH_preInit.sqf b/addons/kestrel4500/XEH_preInit.sqf
index 16365e9020..b1a6bca0e5 100644
--- a/addons/kestrel4500/XEH_preInit.sqf
+++ b/addons/kestrel4500/XEH_preInit.sqf
@@ -3,6 +3,7 @@
ADDON = false;
PREP(buttonPressed);
+PREP(canShow);
PREP(collectData);
PREP(createKestrelDialog);
PREP(displayKestrel);
diff --git a/addons/kestrel4500/functions/fnc_canShow.sqf b/addons/kestrel4500/functions/fnc_canShow.sqf
new file mode 100644
index 0000000000..7c2a37560d
--- /dev/null
+++ b/addons/kestrel4500/functions/fnc_canShow.sqf
@@ -0,0 +1,22 @@
+/*
+ * Authors: Ruthberg
+ * Tests if the Kestrel 4500 can be shown
+ *
+ * Arguments:
+ * Nothing
+ *
+ * Return Value:
+ * canShow (bool)
+ *
+ * Example:
+ * [mode] call ace_kestrel4500_fnc_canShow
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+private ["_returnValue"];
+
+_returnValue = ("ACE_Kestrel4500" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)} && {!(underwater ACE_player)};
+
+_returnValue
diff --git a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf
index 77243a2f11..d38af7b558 100644
--- a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf
+++ b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf
@@ -26,6 +26,7 @@ createDialog 'Kestrel4500_Display';
[{
if (!dialog || !GVAR(Kestrel4500)) exitWith {
+ GVAR(Kestrel4500) = false;
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
diff --git a/addons/kestrel4500/stringtable.xml b/addons/kestrel4500/stringtable.xml
index 65625fdf9b..500321e5e4 100644
--- a/addons/kestrel4500/stringtable.xml
+++ b/addons/kestrel4500/stringtable.xml
@@ -16,9 +16,15 @@
Kestrel 4500 Pocket Weather Tracker
-
+
Open Kestrel 4500
+
+ Show Kestrel 4500
+
+
+ Hide Kestrel 4500
+
Open Kestrel 4500