Skip to content

Commit

Permalink
Medical - Add treatment status events (#8385)
Browse files Browse the repository at this point in the history
* Medical: Add item params to ace_treatmentSucceded

* Medical: Add treatment[Started,Failed] events
  • Loading branch information
∂ω∂ authored Sep 3, 2021
1 parent ce91d19 commit f712638
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions addons/medical_treatment/functions/fnc_treatment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 2 additions & 0 deletions addons/medical_treatment/functions/fnc_treatmentFailure.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions addons/medical_treatment/functions/fnc_treatmentSuccess.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
4 changes: 3 additions & 1 deletion docs/wiki/framework/events-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_treatmentSucceded` | [_caller, _target, _selectionName, _className] | Local | Listen | Treatment action is completed (local on the _caller)
|`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
Expand Down

0 comments on commit f712638

Please sign in to comment.