2016-09-21 12:36:00 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
|
|
|
* Creates actions for the given treatments and adds them to the interaction menu.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ace_medical_menu_fnc_collectActions3D
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-10-13 07:47:52 +00:00
|
|
|
private _actionsConfig = configFile >> QEGVAR(medical_treatment,actions);
|
2016-09-21 12:36:00 +00:00
|
|
|
private _actionPaths = ["ACE_Head", "ACE_Torso", "ACE_ArmLeft", "ACE_ArmRight", "ACE_LegLeft", "ACE_LegRight"];
|
|
|
|
private _actionPathTexts = [
|
|
|
|
localize ELSTRING(interaction,Head), localize ELSTRING(interaction,Torso),
|
|
|
|
localize ELSTRING(interaction,ArmLeft), localize ELSTRING(interaction,ArmRight),
|
|
|
|
localize ELSTRING(interaction,LegLeft), localize ELSTRING(interaction,LegRight)
|
|
|
|
];
|
|
|
|
private _actionPathPositions = ["spine3", "pilot", "LeftForeArm", "RightForeArm", "LKnee", "RKnee"];
|
|
|
|
|
|
|
|
// - Create treatment actions -------------------------------------------------
|
|
|
|
{
|
|
|
|
private _config = _x;
|
|
|
|
private _actionName = QUOTE(ADDON) + "_" + configName _config;
|
|
|
|
private _displayName = getText (_config >> "displayName");
|
|
|
|
private _icon = switch (getText (_config >> "category")) do {
|
|
|
|
case "bandage": {QPATHTOEF(medical,UI\icons\bandage.paa)};
|
|
|
|
case "medication": {QPATHTOEF(medical,UI\icons\autoInjector.paa)};
|
|
|
|
// Currently category advanced which includes body bag :/
|
|
|
|
// case "iv": {QPATHTOF(UI\icons\iv.paa)};
|
|
|
|
default {""};
|
|
|
|
};
|
|
|
|
|
2016-10-05 22:54:57 +00:00
|
|
|
private _allowedBodyParts = getArray (_config >> "allowedSelections") apply {toLower _x};
|
2016-09-21 12:36:00 +00:00
|
|
|
|
2016-10-05 22:54:57 +00:00
|
|
|
if (_allowedBodyParts isEqualTo ["all"]) then {
|
|
|
|
_allowedBodyParts = ALL_BODY_PARTS apply {toLower _x};
|
2016-09-21 12:36:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
{
|
2016-10-05 22:54:57 +00:00
|
|
|
private _bodyPart = _x;
|
|
|
|
private _actionPath = _actionPaths select (ALL_BODY_PARTS find toLower _bodyPart);
|
2016-09-21 12:36:00 +00:00
|
|
|
|
2017-06-15 19:35:33 +00:00
|
|
|
private _statement = {
|
|
|
|
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
|
|
|
|
[_player, _target, _this select 2 select 0, _this select 2 select 1] call EFUNC(medical_treatment,treatment)
|
|
|
|
};
|
|
|
|
private _condition = {
|
|
|
|
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
|
|
|
|
[_player, _target, _this select 2 select 0, _this select 2 select 1] call EFUNC(medical_treatment,canTreatCached)
|
|
|
|
};
|
2016-09-21 12:36:00 +00:00
|
|
|
private _action = [
|
2016-10-05 22:54:57 +00:00
|
|
|
_actionName, _displayName, _icon, _statement, _condition, {}, [_bodyPart, configName _config], [0, 0, 0], 2, [false, true, false, false, false]
|
2016-09-21 12:36:00 +00:00
|
|
|
] call EFUNC(interact_menu,createAction);
|
2016-10-20 10:43:57 +00:00
|
|
|
|
2016-09-21 15:55:19 +00:00
|
|
|
["CAManBase", 0, [_actionPath], _action, true] call EFUNC(interact_menu,addActionToClass);
|
2017-06-15 19:35:33 +00:00
|
|
|
["CAManBase", 0, ["ACE_MainActions", "ACE_Medical_Radial", _actionPath], _action, true] call EFUNC(interact_menu,addActionToClass);
|
2016-09-21 15:55:19 +00:00
|
|
|
["CAManBase", 1, ["ACE_SelfActions", "Medical", _actionPath], _action, true] call EFUNC(interact_menu,addActionToClass);
|
2016-10-05 22:54:57 +00:00
|
|
|
} forEach _allowedBodyParts;
|
2016-09-21 12:36:00 +00:00
|
|
|
} forEach configProperties [_actionsConfig, "isClass _x"];
|