2019-07-03 14:59:28 +00:00
|
|
|
private _categoryArray = [ELSTRING(medical,Category), "STR_TEAM_SWITCH_AI"];
|
|
|
|
|
2018-08-06 16:08:43 +00:00
|
|
|
[
|
2019-07-03 14:59:28 +00:00
|
|
|
QGVAR(enabledFor), "LIST",
|
2018-08-06 16:08:43 +00:00
|
|
|
[LLSTRING(enableFor_title), LLSTRING(enableFor_desc)],
|
2019-07-03 14:59:28 +00:00
|
|
|
_categoryArray,
|
2018-08-06 16:08:43 +00:00
|
|
|
[
|
|
|
|
[0, 1, 2],
|
|
|
|
[LELSTRING(Common,Disabled), LLSTRING(enabledFor_OnlyServerAndHC), LELSTRING(Common,Enabled)],
|
|
|
|
2
|
|
|
|
],
|
2019-07-03 14:59:28 +00:00
|
|
|
true, // isGlobal
|
|
|
|
{[QGVAR(enabledFor), _this] call EFUNC(common,cbaSettings_settingChanged)},
|
|
|
|
true // Needs mission restart
|
2021-02-18 18:58:26 +00:00
|
|
|
] call CBA_fnc_addSetting;
|
2023-09-06 16:37:26 +00:00
|
|
|
|
|
|
|
[
|
2023-10-04 18:19:10 +00:00
|
|
|
QGVAR(requireItems), "LIST",
|
2023-09-06 16:37:26 +00:00
|
|
|
[LSTRING(requireItems_title), LSTRING(requireItems_desc)],
|
|
|
|
_categoryArray,
|
2023-10-04 18:19:10 +00:00
|
|
|
[
|
|
|
|
[0, 1, 2],
|
|
|
|
[LELSTRING(Common,Disabled), LELSTRING(Common,Enabled), format ["%1 - %2", LELSTRING(Common,Enabled), LLSTRING(requireItems_autoReplaceItems)]],
|
|
|
|
0
|
|
|
|
],
|
2023-09-06 16:37:26 +00:00
|
|
|
true, // isGlobal
|
2023-10-04 18:19:10 +00:00
|
|
|
{
|
|
|
|
if (GVAR(requireItems) != 2) exitWith {};
|
|
|
|
["CAManBase", "initPost", {
|
|
|
|
[{
|
|
|
|
params ["_unit"];
|
|
|
|
if ((!local _unit) || {!alive _unit} || {isPlayer _unit}) exitWith {};
|
|
|
|
TRACE_2("replacing medical items on AI",_unit,typeOf _unit);
|
|
|
|
[_unit] call EFUNC(common,replaceRegisteredItems);
|
|
|
|
}, _this] call CBA_fnc_execNextFrame; // need to delay a frame before modifying items in a backpack
|
|
|
|
}, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler;
|
|
|
|
},
|
2023-09-06 16:37:26 +00:00
|
|
|
true // Needs mission restart
|
|
|
|
] call CBA_fnc_addSetting;
|