From de2a89613ce69ce9ff160943ac47a1d1776f31a4 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 11 May 2015 22:22:24 -0500 Subject: [PATCH] ATragMX --- addons/atragmx/initKeybinds.sqf | 19 +++++++++++----- addons/common/stringtable.xml | 6 ++--- addons/kestrel4500/CfgVehicles.hpp | 36 +++++++++++++++--------------- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/addons/atragmx/initKeybinds.sqf b/addons/atragmx/initKeybinds.sqf index 8bc37752f3..64802997d9 100644 --- a/addons/atragmx/initKeybinds.sqf +++ b/addons/atragmx/initKeybinds.sqf @@ -1,11 +1,20 @@ -["ACE3 Equipment", QGVAR(ATragMXDialogKey), localize "STR_ACE_ATragMX_ATragMXDialogKey", -{ +//Add deviceKey entry: +private ["_conditonCode", "_toggleCode", "_closeCode"]; +_conditonCode = { + ("ACE_ATragMX" in (uniformItems ACE_player)) || {"ACE_ATragMX" in (vestItems ACE_player)} +}; +_toggleCode = { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; if (GVAR(active)) exitWith {false}; // Statement [] call FUNC(create_dialog); false -}, -{false}, -[0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) \ No newline at end of file +}; +_closeCode = { + if (dialog && {!isNull (uiNamespace getVariable ["ATragMX_Display", displayNull])}) then { + closeDialog 0; + }; +}; + +[(localize "STR_ACE_ATragMX_Name"), QUOTE(PATHTOF(UI\ATRAG_Icon.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 3b1e5dbc76..0f05274109 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -471,13 +471,13 @@ A banana é uma fruta comestível, botanicamente uma baga, produzida por vários tipos de plantas herbáceas grandes do genero Musa. - Toggle Device + Toggle Handheld Device - Close Device + Close Handheld Device - Cycle Devices + Cycle Handheld Devices \ No newline at end of file diff --git a/addons/kestrel4500/CfgVehicles.hpp b/addons/kestrel4500/CfgVehicles.hpp index 20d8bf5b62..ab7fefa3a5 100644 --- a/addons/kestrel4500/CfgVehicles.hpp +++ b/addons/kestrel4500/CfgVehicles.hpp @@ -10,25 +10,25 @@ class CfgVehicles { 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(Overlay)); - statement = QUOTE(call FUNC(displayKestrel)); - showDisabled = 0; - priority = 0.2; - icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa)); - exceptions[] = {"notOnMap", "isNotInside"}; - }; - class GVAR(hide) { - displayName = "$STR_ACE_Kestrel4500_HideKestrel"; - condition = QUOTE(GVAR(Overlay)); - statement = QUOTE(call FUNC(displayKestrel)); - showDisabled = 0; - priority = 0.3; - icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa)); exceptions[] = {"notOnMap", "isNotInside"}; + class GVAR(show) { + displayName = "$STR_ACE_Kestrel4500_ShowKestrel"; + condition = QUOTE(call FUNC(canShow) && !GVAR(Overlay)); + statement = QUOTE(call FUNC(displayKestrel)); + showDisabled = 0; + priority = 0.2; + icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa)); + exceptions[] = {"notOnMap", "isNotInside"}; + }; + class GVAR(hide) { + displayName = "$STR_ACE_Kestrel4500_HideKestrel"; + condition = QUOTE(GVAR(Overlay)); + statement = QUOTE(call FUNC(displayKestrel)); + showDisabled = 0; + priority = 0.3; + icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa)); + exceptions[] = {"notOnMap", "isNotInside"}; + }; }; }; };