2015-12-11 00:02:15 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
|
|
|
GVAR(customFilters) = [];
|
|
|
|
GVAR(selectedFilterIndex) = -1;
|
|
|
|
|
|
|
|
["inventoryDisplayLoaded", {_this call FUNC(inventoryDisplayLoaded)}] call EFUNC(common,addEventHandler);
|
|
|
|
|
|
|
|
// add custom filters
|
|
|
|
|
2015-12-11 12:14:58 +00:00
|
|
|
// generate list of grenades
|
|
|
|
GVAR(Grenades_ItemList) = [];
|
2015-12-11 00:02:15 +00:00
|
|
|
|
2015-12-11 12:14:58 +00:00
|
|
|
{
|
|
|
|
GVAR(Grenades_ItemList) append getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines");
|
|
|
|
false
|
|
|
|
} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
|
2015-12-11 00:02:15 +00:00
|
|
|
|
2015-12-11 12:14:58 +00:00
|
|
|
// make list case insensitive
|
|
|
|
GVAR(Grenades_ItemList) = [GVAR(Grenades_ItemList), {toLower _this}] call EFUNC(common,map);
|
2015-12-11 00:02:15 +00:00
|
|
|
|
2015-12-11 12:14:58 +00:00
|
|
|
// filter duplicates
|
|
|
|
GVAR(Grenades_ItemList) = GVAR(Grenades_ItemList) arrayIntersect GVAR(Grenades_ItemList);
|
2015-12-11 00:02:15 +00:00
|
|
|
|
2015-12-11 12:14:58 +00:00
|
|
|
[localize LSTRING(Grenades), QFUNC(filterGrenades)] call FUNC(addCustomFilter);
|
|
|
|
|
|
|
|
[localize LSTRING(Backpacks), QFUNC(filterBackpacks)] call FUNC(addCustomFilter);
|
|
|
|
[localize LSTRING(Uniforms), QFUNC(filterUniforms)] call FUNC(addCustomFilter);
|
2015-12-11 00:02:15 +00:00
|
|
|
[localize LSTRING(Vests), QFUNC(filterVests)] call FUNC(addCustomFilter);
|
2015-12-11 12:14:58 +00:00
|
|
|
[localize LSTRING(Headgear), QFUNC(filterHeadgear)] call FUNC(addCustomFilter);
|
|
|
|
|
|
|
|
// generate list of medical items
|
|
|
|
GVAR(Medical_ItemList) = [];
|
|
|
|
|
|
|
|
{
|
|
|
|
GVAR(Medical_ItemList) append getArray (_x >> "items");
|
|
|
|
false
|
|
|
|
} count (
|
|
|
|
("true" configClasses (configFile >> QEGVAR(Medical,Actions) >> "Basic")) +
|
|
|
|
("true" configClasses (configFile >> QEGVAR(Medical,Actions) >> "Advanced"))
|
|
|
|
);
|
|
|
|
|
|
|
|
// make list case insensitive
|
|
|
|
GVAR(Medical_ItemList) = [GVAR(Medical_ItemList), {if (_this isEqualType "") then {toLower _this}}] call EFUNC(common,map);
|
|
|
|
|
|
|
|
// filter duplicates
|
|
|
|
GVAR(Medical_ItemList) = GVAR(Medical_ItemList) arrayIntersect GVAR(Medical_ItemList);
|
|
|
|
|
|
|
|
[localize LSTRING(Medical), QFUNC(filterMedical)] call FUNC(addCustomFilter);
|