Skip to content

Commit

Permalink
Medical - Add self interaction when needed (#6912)
Browse files Browse the repository at this point in the history
* Medical - Add self interaction when needed

* Update addons/medical_gui/XEH_postInit.sqf

Co-Authored-By: PabstMirror <pabstmirror@gmail.com>

* Update addons/medical_gui/XEH_postInit.sqf

Co-Authored-By: PabstMirror <pabstmirror@gmail.com>
  • Loading branch information
PabstMirror authored Apr 1, 2019
1 parent 978049e commit b907c9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions addons/medical_gui/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@ GVAR(pendingReopen) = false;

GVAR(menuPFH) = -1;

GVAR(selfInteractionActions) = [];
[] call FUNC(addTreatmentActions);
[] call FUNC(collectActions);

[QEGVAR(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;
Expand Down
4 changes: 2 additions & 2 deletions addons/medical_gui/functions/fnc_addTreatmentActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* None
*
* Example:
* [] call ace_medical_gui_fnc_addInteractActions
* [] call ace_medical_gui_fnc_addTreatmentActions
*
* Public: No
*/
Expand Down Expand Up @@ -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"];

0 comments on commit b907c9d

Please sign in to comment.