From dac3056a9ab8165ec0e9e903d7308912056990ed Mon Sep 17 00:00:00 2001 From: tsar bimbo Date: Mon, 16 Aug 2021 20:24:00 +0000 Subject: [PATCH 1/2] Medical: Add item params to ace_treatmentSucceded --- addons/medical_treatment/functions/fnc_treatmentSuccess.sqf | 4 ++-- docs/wiki/framework/events-framework.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf b/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf index 07dd5261b3e..06ad566d5cf 100644 --- a/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf @@ -19,7 +19,7 @@ */ params ["_args"]; -_args params ["_medic", "_patient", "_bodyPart", "_classname"]; +_args params ["_medic", "_patient", "_bodyPart", "_classname", "_itemUser", "_usedItem"]; // Switch medic to end animation immediately private _endInAnim = _medic getVariable QGVAR(endInAnim); @@ -48,4 +48,4 @@ _args call _callbackSuccess; _args call FUNC(createLitter); // Emit local event for medical API -["ace_treatmentSucceded", [_medic, _patient, _bodyPart, _classname]] call CBA_fnc_localEvent; +["ace_treatmentSucceded", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem]] call CBA_fnc_localEvent; diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md index 3fd2e797ce8..c65041943f4 100644 --- a/docs/wiki/framework/events-framework.md +++ b/docs/wiki/framework/events-framework.md @@ -37,7 +37,7 @@ The vehicle events will also have the following local variables available `_gunn |----------|---------|---------|---------|---------|---------| |`ace_unconscious` | [_unit, _state(BOOL)] | Global | Listen | Unit's unconscious state changed |`ace_placedInBodyBag` | [_target, _bodyBag] | Global | Listen | Target placed into a bodybag Note: (Target will soon be deleted) -|`ace_treatmentSucceded` | [_caller, _target, _selectionName, _className] | Local | Listen | Treatment action is completed (local on the _caller) +|`ace_treatmentSucceded` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action is completed (local on the _caller) ### 2.3 Interaction Menu (`ace_interact_menu`) MenuType: 0 = Interaction, 1 = Self Interaction From 1eae77db1abb8e0ff7cd1750a5eb1dea2914bfa4 Mon Sep 17 00:00:00 2001 From: tsar bimbo Date: Mon, 16 Aug 2021 20:24:00 +0000 Subject: [PATCH 2/2] Medical: Add treatment[Started,Failed] events --- addons/medical_treatment/functions/fnc_treatment.sqf | 2 ++ addons/medical_treatment/functions/fnc_treatmentFailure.sqf | 2 ++ docs/wiki/framework/events-framework.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/addons/medical_treatment/functions/fnc_treatment.sqf b/addons/medical_treatment/functions/fnc_treatment.sqf index 01d3cabc8dd..b99e703f226 100644 --- a/addons/medical_treatment/functions/fnc_treatment.sqf +++ b/addons/medical_treatment/functions/fnc_treatment.sqf @@ -147,6 +147,8 @@ if (_callbackProgress isEqualTo {}) then { [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem] call _callbackStart; +["ace_treatmentStarted", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem]] call CBA_fnc_localEvent; + [ _treatmentTime, [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem], diff --git a/addons/medical_treatment/functions/fnc_treatmentFailure.sqf b/addons/medical_treatment/functions/fnc_treatmentFailure.sqf index f59331fc770..3519c3fba02 100644 --- a/addons/medical_treatment/functions/fnc_treatmentFailure.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentFailure.sqf @@ -48,3 +48,5 @@ if (!isNil QEGVAR(advanced_fatigue,setAnimExclusions)) then { GET_FUNCTION(_callbackFailure,configFile >> QGVAR(actions) >> _classname >> "callbackFailure"); _args call _callbackFailure; + +["ace_treatmentFailed", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem]] call CBA_fnc_localEvent; diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md index c65041943f4..52379b77ca0 100644 --- a/docs/wiki/framework/events-framework.md +++ b/docs/wiki/framework/events-framework.md @@ -37,7 +37,9 @@ The vehicle events will also have the following local variables available `_gunn |----------|---------|---------|---------|---------|---------| |`ace_unconscious` | [_unit, _state(BOOL)] | Global | Listen | Unit's unconscious state changed |`ace_placedInBodyBag` | [_target, _bodyBag] | Global | Listen | Target placed into a bodybag Note: (Target will soon be deleted) +|`ace_treatmentStarted` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action is completed (local on the _caller) |`ace_treatmentSucceded` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action is completed (local on the _caller) +|`ace_treatmentFailed` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action is completed (local on the _caller) ### 2.3 Interaction Menu (`ace_interact_menu`) MenuType: 0 = Interaction, 1 = Self Interaction