Arsenal - Fix closing arsenal when ignoring content (#9651)

* Fix closing arsenal when ignoring content

* Update fnc_removeBox.sqf
This commit is contained in:
johnb432 2023-11-17 00:54:52 +01:00 committed by GitHub
parent 141410bb47
commit 65c16b6a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View File

@ -136,4 +136,6 @@ GVAR(favorites) = nil;
GVAR(center) = nil;
GVAR(centerNotPlayer) = nil;
GVAR(ignoredVirtualItems) = nil;
[QUOTE(ADDON), []] call EFUNC(common,showHud);

View File

@ -52,6 +52,8 @@ if (_mode) then {
// Add all the items from the game that the arsenal has detected
GVAR(virtualItems) = +(uiNamespace getVariable QGVAR(configItems));
GVAR(virtualItemsFlat) = +(uiNamespace getVariable QGVAR(configItemsFlat));
GVAR(ignoredVirtualItems) = true;
} else {
// Add only specified items to the arsenal
private _virtualItems = _object getVariable QGVAR(virtualItems);

View File

@ -42,7 +42,8 @@ if (is3DEN) then {
_animate = true; // CBA frame functions are disabled during preInit
};
if (isNil "_virtualItems") exitWith {
// Do not close an arsenal if it was opened with ignoring the existing content (see FUNC(openBox))
if (isNil "_virtualItems" && {isNil QGVAR(ignoredVirtualItems)}) exitWith {
[LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText);
// Delay a frame in case this is running on display open
[{(findDisplay IDD_ace_arsenal) closeDisplay 0}] call CBA_fnc_execNextFrame;

View File

@ -41,8 +41,8 @@ if (_global && {isMultiplayer} && {!isNil "_id"}) then {
[QGVAR(boxRemoved), _object] call CBA_fnc_localEvent;
};
// If the arsenal is already open, close arsenal display
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object}) then {
// If the arsenal is already open and not ignoring content (see FUNC(openBox)), close arsenal display
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object} && {isNil QGVAR(ignoredVirtualItems)}) then {
[LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText);
// Delay a frame in case this is running on display open
[{(findDisplay IDD_ace_arsenal) closeDisplay 0}] call CBA_fnc_execNextFrame;