From 91e58c7a100f73f2c14efbf3cd845a3540d72ecd Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 31 Mar 2019 11:03:45 -0500 Subject: [PATCH 1/3] Medical - Add self interaction when needed --- addons/medical_gui/XEH_postInit.sqf | 10 ++++++++++ .../medical_gui/functions/fnc_addTreatmentActions.sqf | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/medical_gui/XEH_postInit.sqf b/addons/medical_gui/XEH_postInit.sqf index 8b17c090b2f..b8652461255 100644 --- a/addons/medical_gui/XEH_postInit.sqf +++ b/addons/medical_gui/XEH_postInit.sqf @@ -12,9 +12,19 @@ GVAR(pendingReopen) = false; GVAR(menuPFH) = -1; +GVAR(selfInteractionActions) = []; [] call FUNC(addTreatmentActions); [] call FUNC(collectActions); +["ace_interact_menu_newControllableObject", { + params ["_type"]; // string of the object's classname + if (!(_type isKindOf "CaManBase")) exitWith {}; + { + _x set [0, _type]; + _x call EFUNC(interact_menu,addActionToClass); + } forEach GVAR(selfInteractionActions); +}] call CBA_fnc_addEventHandler; + ["ace_treatmentSucceded", { if (GVAR(openAfterTreatment) && {GVAR(pendingReopen)}) then { GVAR(pendingReopen) = false; diff --git a/addons/medical_gui/functions/fnc_addTreatmentActions.sqf b/addons/medical_gui/functions/fnc_addTreatmentActions.sqf index 79dde30136e..541c308ff0a 100644 --- a/addons/medical_gui/functions/fnc_addTreatmentActions.sqf +++ b/addons/medical_gui/functions/fnc_addTreatmentActions.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [] call ace_medical_gui_fnc_addInteractActions + * [] call ace_medical_gui_fnc_addTreatmentActions * * Public: No */ @@ -60,6 +60,6 @@ private _fnc_condition = { ["CAManBase", 0, [_actionPath], _action, true] call EFUNC(interact_menu,addActionToClass); ["CAManBase", 0, ["ACE_MainActions", "ACE_Medical_Radial", _actionPath], _action, true] call EFUNC(interact_menu,addActionToClass); - ["CAManBase", 1, ["ACE_SelfActions", "ACE_Medical", _actionPath], _action, true] call EFUNC(interact_menu,addActionToClass); + GVAR(selfInteractionActions) pushBack ["", 1, ["ACE_SelfActions", "ACE_Medical", _actionPath], _action]; } forEach _allowedBodyParts; } forEach configProperties [_actionsConfig, "isClass _x"]; From 2e647dd084921f3bf463c380642d0ca899093cdf Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Sun, 31 Mar 2019 13:31:02 -0500 Subject: [PATCH 2/3] Update addons/medical_gui/XEH_postInit.sqf Co-Authored-By: PabstMirror --- addons/medical_gui/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_gui/XEH_postInit.sqf b/addons/medical_gui/XEH_postInit.sqf index b8652461255..4ac9b2fb5eb 100644 --- a/addons/medical_gui/XEH_postInit.sqf +++ b/addons/medical_gui/XEH_postInit.sqf @@ -18,7 +18,7 @@ GVAR(selfInteractionActions) = []; ["ace_interact_menu_newControllableObject", { params ["_type"]; // string of the object's classname - if (!(_type isKindOf "CaManBase")) exitWith {}; + if (!(_type isKindOf "CAManBase")) exitWith {}; { _x set [0, _type]; _x call EFUNC(interact_menu,addActionToClass); From b9f5ef7ec8dc648ab59b6cdb1c0e5be92028cb63 Mon Sep 17 00:00:00 2001 From: mharis001 <34453221+mharis001@users.noreply.github.com> Date: Sun, 31 Mar 2019 16:16:28 -0500 Subject: [PATCH 3/3] Update addons/medical_gui/XEH_postInit.sqf Co-Authored-By: PabstMirror --- addons/medical_gui/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_gui/XEH_postInit.sqf b/addons/medical_gui/XEH_postInit.sqf index 4ac9b2fb5eb..c6dd4e27221 100644 --- a/addons/medical_gui/XEH_postInit.sqf +++ b/addons/medical_gui/XEH_postInit.sqf @@ -16,7 +16,7 @@ GVAR(selfInteractionActions) = []; [] call FUNC(addTreatmentActions); [] call FUNC(collectActions); -["ace_interact_menu_newControllableObject", { +[QEGVAR(interact_menu,newControllableObject), { params ["_type"]; // string of the object's classname if (!(_type isKindOf "CAManBase")) exitWith {}; {