2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-07-15 10:23:26 +00:00
|
|
|
/*
|
2019-03-24 22:17:48 +00:00
|
|
|
* Author: Glowbal, mharis001
|
|
|
|
* Collect treatment actions for medical menu from config.
|
|
|
|
* Adds dragging actions if it exists.
|
2016-07-15 10:23:26 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2020-04-25 06:41:45 +00:00
|
|
|
* [] call ace_medical_gui_fnc_collectActions
|
2016-07-15 10:23:26 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2016-10-13 07:47:52 +00:00
|
|
|
GVAR(actions) = [];
|
2016-07-15 10:23:26 +00:00
|
|
|
|
2016-10-13 07:47:52 +00:00
|
|
|
{
|
2019-03-24 22:17:48 +00:00
|
|
|
private _configName = configName _x;
|
|
|
|
private _displayName = getText (_x >> "displayName");
|
|
|
|
private _category = getText (_x >> "category");
|
|
|
|
private _condition = compile format [QUOTE([ARR_4(ACE_player, GVAR(target), %1 select GVAR(selectedBodyPart), '%2')] call DEFUNC(medical_treatment,canTreatCached)), ALL_BODY_PARTS, _configName];
|
|
|
|
private _statement = compile format [QUOTE([ARR_4(ACE_player, GVAR(target), %1 select GVAR(selectedBodyPart), '%2')] call DEFUNC(medical_treatment,treatment)), ALL_BODY_PARTS, _configName];
|
|
|
|
|
|
|
|
GVAR(actions) pushBack [_displayName, _category, _condition, _statement];
|
|
|
|
} forEach configProperties [configFile >> QEGVAR(medical_treatment,actions), "isClass _x"];
|
|
|
|
|
2016-07-15 10:23:26 +00:00
|
|
|
|
2016-10-13 07:47:52 +00:00
|
|
|
if ("ace_dragging" call EFUNC(common,isModLoaded)) then {
|
2019-03-24 22:17:48 +00:00
|
|
|
GVAR(actions) pushBack [
|
|
|
|
localize ELSTRING(dragging,Drag), "drag",
|
|
|
|
{ACE_player != GVAR(target) && {[ACE_player, GVAR(target)] call EFUNC(dragging,canDrag)}},
|
|
|
|
{
|
|
|
|
GVAR(pendingReopen) = false;
|
|
|
|
[ACE_player, GVAR(target)] call EFUNC(dragging,startDrag);
|
|
|
|
}
|
|
|
|
];
|
2016-07-15 10:23:26 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
GVAR(actions) pushBack [
|
|
|
|
localize ELSTRING(dragging,Carry), "drag",
|
|
|
|
{ACE_player != GVAR(target) && {[ACE_player, GVAR(target)] call EFUNC(dragging,canCarry)}},
|
|
|
|
{
|
|
|
|
GVAR(pendingReopen) = false;
|
|
|
|
[ACE_player, GVAR(target)] call EFUNC(dragging,startCarry);
|
|
|
|
}
|
|
|
|
];
|
2016-07-15 10:23:26 +00:00
|
|
|
};
|