ACE3/addons/inventory/XEH_postInit.sqf

41 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2015-12-11 00:02:15 +00:00
#include "script_component.hpp"
if (!hasInterface) exitWith {};
// If medical_treatment is loaded, get its items
if (["ace_medical_treatment"] call EFUNC(common,isModLoaded)) then {
private _medicalList = +(uiNamespace getVariable [QGVAR(medicalItemList), createHashMap]);
_medicalList merge [uiNamespace getVariable [QEGVAR(medical_treatment,treatmentItems), createHashMap], true];
GVAR(medicalItemList) = compileFinal _medicalList;
} else {
GVAR(medicalItemList) = uiNamespace getVariable [QGVAR(medicalItemList), compileFinal createHashMap];
};
2015-12-11 00:02:15 +00:00
GVAR(customFilters) = [];
GVAR(selectedFilterIndex) = -1;
// Add custom filters
[LLSTRING(Grenades), QFUNC(filterGrenades)] call FUNC(addCustomFilter);
[LLSTRING(Backpacks), QFUNC(filterBackpacks)] call FUNC(addCustomFilter);
[LLSTRING(Uniforms), QFUNC(filterUniforms)] call FUNC(addCustomFilter);
[LLSTRING(Vests), QFUNC(filterVests)] call FUNC(addCustomFilter);
[LLSTRING(Headgear), QFUNC(filterHeadgear)] call FUNC(addCustomFilter);
[LLSTRING(Medical), QFUNC(filterMedical)] call FUNC(addCustomFilter);
2015-12-11 00:02:15 +00:00
// Used for displaying the correct name when opening a subordinate's inventory
GVAR(unit) = ACE_player;
2015-12-11 00:02:15 +00:00
["CAManBase", "InventoryOpened", {
params ["_unit", "_container"];
2015-12-11 12:14:58 +00:00
// GVAR(unit) is ACE_player by default
if (_unit isEqualTo ACE_player) exitWith {};
2015-12-11 12:14:58 +00:00
// If the player is a group leader and opens a subordinate's inventory or has a subordinate open the player's backpack, update name to correct unit
if (leader ACE_player == ACE_player && {(_unit in units ACE_player) || {(objectParent _container) isEqualTo ACE_player}}) then {
GVAR(unit) = _unit;
};
}] call CBA_fnc_addClassEventHandler;