2015-08-06 21:51:17 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Collect treatment actions from medical config
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-07 03:37:41 +00:00
|
|
|
* None
|
2015-08-06 21:51:17 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-07 03:37:41 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ace_medical_menu_fnc_collectActions
|
2015-08-06 21:51:17 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-07 03:37:41 +00:00
|
|
|
private ["_configBasic", "_configAdvanced", "_fnc_compileActionsLevel"];
|
2015-08-06 21:51:17 +00:00
|
|
|
_configBasic = (configFile >> "ACE_Medical_Actions" >> "Basic");
|
|
|
|
_configAdvanced = (configFile >> "ACE_Medical_Actions" >> "Advanced");
|
|
|
|
|
2015-08-07 03:37:41 +00:00
|
|
|
_fnc_compileActionsLevel = {
|
|
|
|
private ["_entryCount", "_actions", "_displayName", "_condition", "_category", "_statement"];
|
|
|
|
params ["_config"];
|
2015-08-06 21:51:17 +00:00
|
|
|
_actions = [];
|
|
|
|
|
2015-08-07 03:37:41 +00:00
|
|
|
{
|
|
|
|
if (isClass _x) then {
|
|
|
|
_displayName = getText (_x >> "displayName");
|
|
|
|
_category = getText (_x >> "category");
|
|
|
|
_condition = format[QUOTE([ARR_4(ACE_player, GVAR(INTERACTION_TARGET), EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart), '%1')] call DEFUNC(medical,canTreatCached)), configName _x];
|
|
|
|
_statement = format[QUOTE([ARR_4(ACE_player, GVAR(INTERACTION_TARGET), EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart), '%1')] call DEFUNC(medical,treatment)), configName _x];
|
|
|
|
_actions pushBack [_displayName, _category, compile _condition, compile _statement];
|
2015-08-06 21:51:17 +00:00
|
|
|
};
|
2015-08-07 03:37:41 +00:00
|
|
|
nil
|
|
|
|
} count _config;
|
|
|
|
|
|
|
|
_actions // return
|
2015-08-06 21:51:17 +00:00
|
|
|
};
|
|
|
|
|
2015-08-07 03:37:41 +00:00
|
|
|
GVAR(actionsBasic) = [_configBasic] call _fnc_compileActionsLevel;
|
|
|
|
GVAR(actionsAdvanced) = [_configAdvanced] call _fnc_compileActionsLevel;
|