Arsenal - Handle Weapon Items not in Box Virtual Items as Unique (#8375)

* Handle unique items that are also weapon attachments

* only flatten once
This commit is contained in:
GhostIsSpooky 2021-10-07 14:39:55 -03:00 committed by GitHub
parent ce705310e3
commit a95e71fec8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 0 deletions

View File

@ -45,6 +45,10 @@ private _fnc_fill_right_Container = {
private _cacheNamespace = _ctrlPanel;
private _cachedItemInfo = _cacheNamespace getVariable [_configCategory+_className, []];
if (!(_className in GVAR(virtualItemsFlat))) then {
_isUnique = true;
};
// Not in cache. So get info and put into cache
if (_cachedItemInfo isEqualTo []) then {
private _configPath = configFile >> _configCategory >> _className;

View File

@ -107,6 +107,7 @@ GVAR(rightTabLnBFocus) = nil;
GVAR(selectedWeaponType) = nil;
GVAR(virtualItems) = nil;
GVAR(virtualItemsFlat) = nil;
GVAR(currentItems) = nil;
GVAR(currentFace) = nil;
GVAR(currentVoice) = nil;

View File

@ -45,10 +45,12 @@ GVAR(currentBox) = _object;
if (_mode) then {
GVAR(virtualItems) = +(uiNamespace getVariable QGVAR(configItems));
GVAR(virtualItemsFlat) = +(uiNamespace getVariable QGVAR(configItemsFlat));
} else {
GVAR(virtualItems) = +(_object getVariable [QGVAR(virtualItems), [
[[], [], []], [[], [], [], []], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []
]]);
GVAR(virtualItemsFlat) = flatten GVAR(virtualItems);
};
GVAR(center) = _center;

View File

@ -186,4 +186,5 @@ private _cfgMagazines = configFile >> "CfgMagazines";
} foreach configProperties [(configFile >> "CfgMagazineWells"), "isClass _x", true];
uiNamespace setVariable [QGVAR(configItems), _cargo];
uiNamespace setVariable [QGVAR(configItemsFlat), flatten _cargo];
uiNamespace setVariable [QGVAR(magazineGroups), _magazineGroups];