From a4e22986e031dbec95c63cce3b7e984862563316 Mon Sep 17 00:00:00 2001 From: ulteq Date: Tue, 7 Apr 2015 20:09:25 +0200 Subject: [PATCH] Integrated the ATragMX into the ace interaction menu --- addons/atragmx/CfgVehicles.hpp | 17 +++++++++-------- addons/atragmx/XEH_postInit.sqf | 2 +- addons/atragmx/XEH_preInit.sqf | 1 + addons/atragmx/functions/fnc_canShow.sqf | 22 ++++++++++++++++++++++ 4 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 addons/atragmx/functions/fnc_canShow.sqf diff --git a/addons/atragmx/CfgVehicles.hpp b/addons/atragmx/CfgVehicles.hpp index fcf0268b5b..4e27f6838e 100644 --- a/addons/atragmx/CfgVehicles.hpp +++ b/addons/atragmx/CfgVehicles.hpp @@ -2,14 +2,15 @@ class CfgVehicles { class Man; class CAManBase: Man { class ACE_SelfActions { - class ACE_OpenATragMX { - displayName = "$STR_ACE_ATragMX_OpenATragMXDialog"; - condition = QUOTE('ACE_ATragMX' in items _player && {!GVAR(ATragMX)}); - statement = QUOTE(call FUNC(create_dialog)); - showDisabled = 0; - priority = 2; - icon = PATHTOF(UI\ATRAG_Icon.paa); - hotkey = "K"; + class ACE_Equipment { + class GVAR(open) { + displayName = "$STR_ACE_ATragMX_OpenATragMXDialog"; + condition = QUOTE(call FUNC(canShow)); + statement = QUOTE(call FUNC(create_dialog)); + showDisabled = 0; + priority = 2; + icon = PATHTOF(UI\ATRAG_Icon.paa); + }; }; }; }; diff --git a/addons/atragmx/XEH_postInit.sqf b/addons/atragmx/XEH_postInit.sqf index 54cc5b1ec5..4d26fcf7a9 100644 --- a/addons/atragmx/XEH_postInit.sqf +++ b/addons/atragmx/XEH_postInit.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -#include "initKeybinds.sqf" +//#include "initKeybinds.sqf" if (count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0) then { GVAR(ATragMX_gunList) = profileNamespace getVariable "ACE_ATragMX_gunList"; diff --git a/addons/atragmx/XEH_preInit.sqf b/addons/atragmx/XEH_preInit.sqf index 7829e7878d..13adcf492c 100644 --- a/addons/atragmx/XEH_preInit.sqf +++ b/addons/atragmx/XEH_preInit.sqf @@ -9,6 +9,7 @@ PREP(calculate_solution); PREP(calculate_target_range_assist); PREP(calculate_target_solution); PREP(calculate_target_speed_assist); +PREP(canShow); PREP(change_gun); PREP(create_dialog); PREP(cycle_range_card_columns); diff --git a/addons/atragmx/functions/fnc_canShow.sqf b/addons/atragmx/functions/fnc_canShow.sqf new file mode 100644 index 0000000000..17298bb425 --- /dev/null +++ b/addons/atragmx/functions/fnc_canShow.sqf @@ -0,0 +1,22 @@ +/* + * Authors: Ruthberg + * Tests if the ATragMX can be shown + * + * Arguments: + * Nothing + * + * Return Value: + * canShow (bool) + * + * Example: + * call ace_atragmx_fnc_canShow + * + * Public: No + */ +#include "script_component.hpp" + +private ["_returnValue"]; + +_returnValue = ("ACE_ATragMX" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)} && {!(underwater ACE_player)}; + +_returnValue