ACE3/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf

41 lines
994 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: Glowbal
* Grab available treatment options for given category
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
* 2: Category name <STRING>
*
* Return Value:
* Available actions <ARRAY>
*
* Example:
2015-08-07 03:37:41 +00:00
* [ACE_player, poor_dude, "some category"] call ace_medical_menu_fnc_getTreatmentOptions
*
* Public: No
*/
2015-08-07 03:37:41 +00:00
params ["_player", "_target", "_name"];
if (!([ACE_player, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith))) exitWith {[]};
2016-06-13 10:49:35 +00:00
private _actions = if (EGVAR(medical,level) == 2) then {
GVAR(actionsAdvanced);
} else {
GVAR(actionsBasic);
};
2016-06-13 10:49:35 +00:00
private _collectedActions = [];
private _bodyPart = EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart);
{
2015-08-07 03:37:41 +00:00
_x params ["", "_currentCategory", "_currentCondition"];
if (_name == _currentCategory && {call _currentCondition}) then {
_collectedActions pushBack _x;
};
2015-08-07 03:37:41 +00:00
nil
} count _actions;
2016-06-13 10:49:35 +00:00
_collectedActions;