mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Arsenal - Fix closing arsenal when ignoring content (#9651)
* Fix closing arsenal when ignoring content * Update fnc_removeBox.sqf
This commit is contained in:
parent
141410bb47
commit
65c16b6a0a
@ -136,4 +136,6 @@ GVAR(favorites) = nil;
|
||||
GVAR(center) = nil;
|
||||
GVAR(centerNotPlayer) = nil;
|
||||
|
||||
GVAR(ignoredVirtualItems) = nil;
|
||||
|
||||
[QUOTE(ADDON), []] call EFUNC(common,showHud);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user