Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medical - Add self interaction when needed #6912

Merged
merged 3 commits into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);

["ace_interact_menu_newControllableObject", {
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved
params ["_type"]; // string of the object's classname
if (!(_type isKindOf "CaManBase")) exitWith {};
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved
{
_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"];