diff --git a/addons/atragmx/initKeybinds.sqf b/addons/atragmx/initKeybinds.sqf index 17e7ff0fcb..ddba0f12ea 100644 --- a/addons/atragmx/initKeybinds.sqf +++ b/addons/atragmx/initKeybinds.sqf @@ -17,23 +17,20 @@ //Add deviceKey entry: private ["_conditonCode", "_toggleCode", "_closeCode"]; _conditonCode = { - ("ACE_ATragMX" in (uniformItems ACE_player)) || {"ACE_ATragMX" in (vestItems ACE_player)} + [] call FUNC(can_show); }; _toggleCode = { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {}; if (GVAR(active)) exitWith { closeDialog 0; - false }; // Statement [] call FUNC(create_dialog); - false }; _closeCode = { - if (dialog && {!isNull (uiNamespace getVariable ["ATragMX_Display", displayNull])}) then { + if (GVAR(active)) exitWith { closeDialog 0; }; }; - -[(localize "STR_ACE_ATragMX_Name"), QUOTE(PATHTOF(UI\ATRAG_Icon.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); +[(localize LSTRING(Name)), QUOTE(PATHTOF(UI\ATRAG_Icon.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); diff --git a/addons/kestrel4500/initKeybinds.sqf b/addons/kestrel4500/initKeybinds.sqf index 0877196013..b4f1ce3998 100644 --- a/addons/kestrel4500/initKeybinds.sqf +++ b/addons/kestrel4500/initKeybinds.sqf @@ -25,6 +25,7 @@ {false}, [0, [true, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) + //Add deviceKey entry: private ["_conditonCode", "_toggleCode", "_closeCode"]; _conditonCode = { @@ -32,7 +33,7 @@ _conditonCode = { }; _toggleCode = { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {}; // Statement if (!GVAR(Overlay)) then { @@ -44,9 +45,6 @@ _toggleCode = { }; }; _closeCode = { - // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; - // Statement if (GVAR(Overlay)) then { //If dispaly is open, close it: @@ -57,7 +55,5 @@ _closeCode = { GVAR(Kestrel4500) = false; closeDialog 0; }; - false }; - -[(localize "STR_ACE_Kestrel_Name"), QUOTE(PATHTOF(UI\Kestrel4500.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); +[(localize LSTRING(Name)), QUOTE(PATHTOF(UI\Kestrel4500.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); diff --git a/addons/microdagr/CfgVehicles.hpp b/addons/microdagr/CfgVehicles.hpp index 69c5aac317..d70dcc8c6f 100644 --- a/addons/microdagr/CfgVehicles.hpp +++ b/addons/microdagr/CfgVehicles.hpp @@ -3,22 +3,18 @@ class CfgVehicles { class CAManBase: Man { class ACE_SelfActions { class ACE_Equipment { - class GVAR(show) { - //Opens the mini map - displayName = CSTRING(show); - condition = QUOTE([DISPLAY_MODE_DIALOG] call FUNC(canShow)); - statement = QUOTE([DISPLAY_MODE_DISPLAY] call FUNC(openDisplay)); - showDisabled = 0; - priority = 0.2; + class GVAR(configure) { + //Opens the dialog + displayName = CSTRING(configure); + condition = QUOTE(([DISPLAY_MODE_DIALOG] call FUNC(canShow)) && {GVAR(currentShowMode) != DISPLAY_MODE_DIALOG}); + statement = QUOTE([DISPLAY_MODE_DIALOG] call FUNC(openDisplay)); icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); exceptions[] = {"notOnMap", "isNotInside"}; - class GVAR(configure) { - //Opens the dialog - displayName = CSTRING(configure); - condition = QUOTE(([DISPLAY_MODE_DIALOG] call FUNC(canShow)) && {GVAR(currentShowMode) != DISPLAY_MODE_DIALOG}); - statement = QUOTE([DISPLAY_MODE_DIALOG] call FUNC(openDisplay)); - showDisabled = 0; - priority = 0.1; + class GVAR(show) { + //Opens the mini map + displayName = CSTRING(show); + condition = QUOTE(([DISPLAY_MODE_DISPLAY] call FUNC(canShow)) && {GVAR(currentShowMode) != DISPLAY_MODE_DISPLAY}); + statement = QUOTE([DISPLAY_MODE_DISPLAY] call FUNC(openDisplay)); icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); exceptions[] = {"notOnMap", "isNotInside"}; }; @@ -26,8 +22,6 @@ class CfgVehicles { displayName = CSTRING(closeUnit); condition = QUOTE(GVAR(currentShowMode) != DISPLAY_MODE_CLOSED); statement = QUOTE([DISPLAY_MODE_CLOSED] call FUNC(openDisplay)); - showDisabled = 0; - priority = 0.3; icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); exceptions[] = {"notOnMap", "isNotInside"}; }; diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index 0569256df3..736403cb5f 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -6,19 +6,18 @@ if (!hasInterface) exitWith {}; //Add deviceKey entry: private ["_conditonCode", "_toggleCode", "_closeCode"]; _conditonCode = { - ("ACE_microDAGR" in (items ace_player)) + ("ACE_microDAGR" in (items ACE_player)) }; _toggleCode = { - if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {}; [] call FUNC(openDisplay); //toggle display mode - true }; _closeCode = { - if (GVAR(currentShowMode) == DISPLAY_MODE_CLOSED) exitWith {false}; + if (GVAR(currentShowMode) == DISPLAY_MODE_CLOSED) exitWith {}; [DISPLAY_MODE_CLOSED] call FUNC(openDisplay); - true }; -[(localize "STR_ACE_microdagr_itemName"), QUOTE(PATHTOF(images\microDAGR_item.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); +[(localize LSTRING(itemName)), QUOTE(PATHTOF(images\microDAGR_item.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); + //Add Eventhandler: ["RangerfinderData", {_this call FUNC(recieveRangefinderData)}] call EFUNC(common,addEventHandler);