From bc4d18846e4931beefe4183b816d3d539ec25f88 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Fri, 3 Nov 2017 10:35:24 +0100 Subject: [PATCH 1/9] Cleanup buttonClearAll code --- .../arsenal/functions/fnc_buttonClearAll.sqf | 34 ++++++++++++------- .../arsenal/functions/fnc_onArsenalClose.sqf | 1 - 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/addons/arsenal/functions/fnc_buttonClearAll.sqf b/addons/arsenal/functions/fnc_buttonClearAll.sqf index 148a79520b..f2a0811730 100644 --- a/addons/arsenal/functions/fnc_buttonClearAll.sqf +++ b/addons/arsenal/functions/fnc_buttonClearAll.sqf @@ -24,21 +24,29 @@ private _ctrlList = _display displayCtrl IDC_rightTabContentListnBox; for "_l" from 0 to (lbSize _ctrlList - 1) do { _ctrlList lnbSetText [[_l, 2], str 0]; - _ctrlList lnbsetcolor [[_l, 1], [1, 1, 1, 1]]; - _ctrlList lnbsetcolor [[_l, 2], [1, 1, 1, 1]]; }; -// Fade out button private _removeAllCtrl = _display displayCtrl IDC_buttonRemoveAll; - -if (ctrlFade _removeAllCtrl != 1) then { - _removeAllCtrl ctrlSetFade 1; -}; - -if (ctrlShown _removeAllCtrl) then { - _removeAllCtrl ctrlShow false; -}; +_removeAllCtrl ctrlSetFade 1; _removeAllCtrl ctrlCommit FADE_DELAY; -(_display displayCtrl IDC_loadIndicatorBar) progressSetPosition 0; -(_display displayCtrl IDC_totalWeightText) ctrlSetText (GVAR(center) call EFUNC(movement,getWeight)); // TBL \ No newline at end of file +// Update load bar and weight +private _loadIndicatorBarCtrl = _display displayCtrl IDC_loadIndicatorBar; +_loadIndicatorBarCtrl progressSetPosition 0; +(_display displayCtrl IDC_totalWeightText) ctrlSetText (GVAR(center) call EFUNC(movement,getWeight)); + +// Update right panel colors +private _maxLoad = switch (GVAR(currentLeftPanel)) do { + case IDC_buttonUniform: { + gettext (configfile >> "CfgWeapons" >> uniform GVAR(center) >> "ItemInfo" >> "containerClass") + }; + case IDC_buttonVest: { + gettext (configfile >> "CfgWeapons" >> vest GVAR(center) >> "ItemInfo" >> "containerClass") + }; + case IDC_buttonBackpack: { + backpack GVAR(center) + }; +}; + +private _control = _display displayCtrl IDC_rightTabContentListnBox; +[_control, _maxLoad] call FUNC(updateRightPanel); \ No newline at end of file diff --git a/addons/arsenal/functions/fnc_onArsenalClose.sqf b/addons/arsenal/functions/fnc_onArsenalClose.sqf index 86aca3d4a9..e140872793 100644 --- a/addons/arsenal/functions/fnc_onArsenalClose.sqf +++ b/addons/arsenal/functions/fnc_onArsenalClose.sqf @@ -38,7 +38,6 @@ GVAR(cameraPosition) = nil; GVAR(visionMode) = nil; GVAR(mouseButtonState) = nil; -GVAR(mode) = nil; GVAR(currentLeftPanel) = nil; GVAR(currentRightPanel) = nil; GVAR(leftSearchbarFocus) = nil; From 06a522197f069702b925be4babfd1abd6b977e21 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Fri, 3 Nov 2017 10:49:57 +0100 Subject: [PATCH 2/9] Fix itemInfo behavior when switching between items that don't have logos Fix #23 --- addons/arsenal/functions/fnc_itemInfo.sqf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/arsenal/functions/fnc_itemInfo.sqf b/addons/arsenal/functions/fnc_itemInfo.sqf index e2a5ebaf98..a8c23b2440 100644 --- a/addons/arsenal/functions/fnc_itemInfo.sqf +++ b/addons/arsenal/functions/fnc_itemInfo.sqf @@ -48,8 +48,9 @@ if (isClass _itemCfg) then { _ctrlDLC ctrlsetfade 1; _ctrlDLCBackground ctrlsetfade 1; }; - _ctrlDLC ctrlcommit FADE_DELAY; - _ctrlDLCBackground ctrlcommit FADE_DELAY; + + _ctrlDLC ctrlcommit 0; + _ctrlDLCBackground ctrlcommit 0; } else { _ctrlInfo ctrlSetFade 1; From 04134f35122b9d4dc266f1ede1c402d3d73ac55f Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Fri, 3 Nov 2017 10:53:44 +0100 Subject: [PATCH 3/9] Add copy paste and arrow key support for searchbars Close #22 --- addons/arsenal/functions/fnc_onKeyDown.sqf | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/addons/arsenal/functions/fnc_onKeyDown.sqf b/addons/arsenal/functions/fnc_onKeyDown.sqf index 6bcc622cc4..423ef88581 100644 --- a/addons/arsenal/functions/fnc_onKeyDown.sqf +++ b/addons/arsenal/functions/fnc_onKeyDown.sqf @@ -23,16 +23,12 @@ if (!GVAR(leftSearchbarFocus) && {!GVAR(rightSearchbarFocus)}) then { [_display] call FUNC(buttonHide); }; // Export button - case (_keyPressed == DIK_C): { - if (_ctrlState) then { - [_display] call FUNC(buttonExport); - }; + case (_keyPressed == DIK_C && {_ctrlState}): { + [_display] call FUNC(buttonExport); }; // Import button - case (_keyPressed == DIK_V): { - if (_ctrlState) then { - [_display] call FUNC(buttonImport); - }; + case (_keyPressed == DIK_V && {_ctrlState}): { + [_display] call FUNC(buttonImport); }; // Switch vision mode case (_keyPressed in (actionkeys "nightvision")): { @@ -78,6 +74,15 @@ if (!GVAR(leftSearchbarFocus) && {!GVAR(rightSearchbarFocus)}) then { [_display, _display displayCtrl IDC_rightSearchbar] call FUNC(handleSearchBar); }; }; + case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): { + _return = false; + }; + case (_keyPressed == DIK_C && {_ctrlState}): { + _return = false; + }; + case (_keyPressed == DIK_V && {_ctrlState}): { + _return = false; + }; }; }; From 8e44c3c5f5f397628fe0937dd466ea634e52b39b Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Fri, 3 Nov 2017 11:00:36 +0100 Subject: [PATCH 4/9] Add back newline at EOF for onKeyDown --- addons/arsenal/functions/fnc_onKeyDown.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/arsenal/functions/fnc_onKeyDown.sqf b/addons/arsenal/functions/fnc_onKeyDown.sqf index 423ef88581..d8ebac12c1 100644 --- a/addons/arsenal/functions/fnc_onKeyDown.sqf +++ b/addons/arsenal/functions/fnc_onKeyDown.sqf @@ -102,4 +102,4 @@ if (GVAR(rightTabLnBFocus) && {_keyPressed in [DIK_LEFT, DIK_RIGHT]}) then { [_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo); }; -_return \ No newline at end of file +_return From 4ff26bb5ad31afa7c688592475d56da9eed58cc3 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Fri, 3 Nov 2017 11:05:40 +0100 Subject: [PATCH 5/9] Change default camera setting from non inverted to inverted --- addons/arsenal/XEH_preInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/arsenal/XEH_preInit.sqf b/addons/arsenal/XEH_preInit.sqf index b8d730f31d..5c1116a32a 100644 --- a/addons/arsenal/XEH_preInit.sqf +++ b/addons/arsenal/XEH_preInit.sqf @@ -7,7 +7,7 @@ PREP_RECOMPILE_START; PREP_RECOMPILE_END; // Arsenal -[QGVAR(camInverted), "CHECKBOX", "Invert camera controls", "ACE3 Arsenal", false] call CBA_Settings_fnc_init; // TBL +[QGVAR(camInverted), "CHECKBOX", "Invert camera controls", "ACE3 Arsenal", true] call CBA_Settings_fnc_init; // TBL [QGVAR(canUseCurrentMagTab), "CHECKBOX", "Can use currentMag tab", "ACE3 Arsenal", false] call CBA_Settings_fnc_init; // TBL [QGVAR(enableModIcons), "CHECKBOX", "Enable mod logos", "ACE3 Arsenal", true] call CBA_Settings_fnc_init; // TBL [QGVAR(fontHeight), "SLIDER", "Font height for left and right panels", "ACE3 Arsenal", [1, 10, 4.5, 1]] call CBA_Settings_fnc_init; // TBL From 32b4588ec52a9d965088c6b42246722c8cb54130 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Fri, 3 Nov 2017 11:07:18 +0100 Subject: [PATCH 6/9] Fix import and export "not implemented" message --- addons/arsenal/functions/fnc_buttonExport.sqf | 2 +- addons/arsenal/functions/fnc_buttonImport.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/arsenal/functions/fnc_buttonExport.sqf b/addons/arsenal/functions/fnc_buttonExport.sqf index de36fda592..f90205e03a 100644 --- a/addons/arsenal/functions/fnc_buttonExport.sqf +++ b/addons/arsenal/functions/fnc_buttonExport.sqf @@ -2,4 +2,4 @@ params ["_display"]; -[_display, localize "Not implemented"] call FUNC(message); +[_display, "Not implemented"] call FUNC(message); diff --git a/addons/arsenal/functions/fnc_buttonImport.sqf b/addons/arsenal/functions/fnc_buttonImport.sqf index de36fda592..f90205e03a 100644 --- a/addons/arsenal/functions/fnc_buttonImport.sqf +++ b/addons/arsenal/functions/fnc_buttonImport.sqf @@ -2,4 +2,4 @@ params ["_display"]; -[_display, localize "Not implemented"] call FUNC(message); +[_display, "Not implemented"] call FUNC(message); From ba3f43204f0f20d2b575e64be348ffdf1c606faa Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Fri, 3 Nov 2017 12:01:22 +0100 Subject: [PATCH 7/9] Rename share button to Unshare when loadout selected is shared --- addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf | 1 + addons/arsenal/functions/fnc_onSelChangedLoadouts.sqf | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf index 2bb438b442..e8002abe3a 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf @@ -29,4 +29,5 @@ if (_loadoutIndex > -1) then { [QGVAR(loadoutShared), [_contentPanelCtrl, [_profileName ,_loadoutName , _loadoutData]]] call CBA_fnc_remoteEvent; }; +_control ctrlSetText (["Share", "Unshare"] select ((_contentPanelCtrl lnbText [_contentPanelCursSel, 0]) != "")); // TBL publicVariable QGVAR(sharedLoadoutsVars); diff --git a/addons/arsenal/functions/fnc_onSelChangedLoadouts.sqf b/addons/arsenal/functions/fnc_onSelChangedLoadouts.sqf index 5b77dcd07e..6f03db701f 100644 --- a/addons/arsenal/functions/fnc_onSelChangedLoadouts.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedLoadouts.sqf @@ -17,6 +17,8 @@ if (_curSel == -1) exitWith { _saveButtonCtrl ctrlCommit 0; }; + _shareButtonCtrl ctrlSetText "Share"; // TBL + { _x ctrlEnable false; _x ctrlCommit 0; @@ -33,8 +35,10 @@ switch (GVAR(currentLoadoutsTab)) do { _loadButtonCtrl ctrlEnable true; _loadButtonCtrl ctrlCommit 0; + _shareButtonCtrl ctrlSetText (["Share", "Unshare"] select ((_control lnbText [_curSel, 0]) != "")); // TBL + { - _x ctrlEnable (_curSel >= 0); + _x ctrlEnable true; _x ctrlCommit 0; } foreach [_renameButtonCtrl, _deleteButtonCtrl]; From 0b3c28d407e4758669472d61b9fd7ad6f37034f6 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Fri, 3 Nov 2017 14:01:19 +0100 Subject: [PATCH 8/9] Improve missing items logging, cache verifyLoadout check --- .../functions/fnc_buttonLoadoutsDelete.sqf | 2 +- .../functions/fnc_buttonLoadoutsLoad.sqf | 2 +- .../functions/fnc_buttonLoadoutsRename.sqf | 4 +-- .../functions/fnc_buttonLoadoutsSave.sqf | 2 +- .../functions/fnc_fillLoadoutsList.sqf | 22 +++++++++++-- .../arsenal/functions/fnc_onArsenalClose.sqf | 1 + .../arsenal/functions/fnc_onArsenalOpen.sqf | 1 + .../arsenal/functions/fnc_verifyLoadout.sqf | 31 ++++++++++--------- 8 files changed, 43 insertions(+), 22 deletions(-) diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsDelete.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsDelete.sqf index f366da63b6..edc73d8254 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsDelete.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsDelete.sqf @@ -14,7 +14,7 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { private _data = profileNamespace getVariable [QGVAR(saved_loadouts), []]; _data deleteAt (_data find ((_data select {_x select 0 == _loadoutName}) select 0)); - _contentPanelCtrl setVariable [_loadoutName, nil]; + _contentPanelCtrl setVariable [_loadoutName + QGVAR(currentLoadoutsTab), nil]; _contentPanelCtrl lnbDeleteRow _contentPanelCursSel; _contentPanelCtrl lnbSetCurSelRow (_contentPanelCursSel); diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf index ad0df196fd..133eaec28d 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf @@ -10,7 +10,7 @@ private _curSel = lnbCurSelRow _contentPanelCtrl; private _loadoutName = _contentPanelCtrl lnbText [_curSel, 1]; private _loadout = (GVAR(sharedLoadoutsNamespace) getVariable ((_contentPanelCtrl lnbText [_curSel, 0]) + (_contentPanelCtrl lnbText [_curSel, 1]))) select 2; -GVAR(center) setUnitLoadout [[_contentPanelCtrl getVariable _loadoutName, _loadout] select (GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts), true]; +GVAR(center) setUnitLoadout [[_contentPanelCtrl getVariable _loadoutName + QGVAR(currentLoadoutsTab), _loadout] select (GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts), true]; GVAR(currentItems) = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", [], [], [], [], [], []]; for "_index" from 0 to 15 do { diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf index f0133cc339..93842a3f5c 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf @@ -23,8 +23,8 @@ if (count _similarLoadouts > 0) exitWith { // Update loadout info in profile and list namespaces _data set [_data find ((_data select {_x select 0 == _loadoutName}) select 0), [_editBoxContent, _loadout]]; -_contentPanelCtrl setVariable [_loadoutName, nil]; -_contentPanelCtrl setVariable [_editBoxContent, _loadout]; +_contentPanelCtrl setVariable [_loadoutName + QGVAR(currentLoadoutsTab), nil]; +_contentPanelCtrl setVariable [_editBoxContent + QGVAR(currentLoadoutsTab), _loadout]; _contentPanelCtrl lnbDeleteRow _curSelRow; diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf index a2b53cea34..e6878653bd 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf @@ -113,7 +113,7 @@ switch (GVAR(currentLoadoutsTab)) do { _contentPanelCtrl lnbSetPicture [[_newRow, 8], getText (configFile >> "cfgWeapons" >> (_loadout select 6) >> "picture")]; _contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "cfgGlasses" >> (_loadout select 7) >> "picture")]; - _contentPanelCtrl setVariable [_editBoxContent, _loadout]; + _contentPanelCtrl setVariable [_editBoxContent + QGVAR(currentLoadoutsTab), _loadout]; _contentPanelCtrl lnbSort [1, false]; diff --git a/addons/arsenal/functions/fnc_fillLoadoutsList.sqf b/addons/arsenal/functions/fnc_fillLoadoutsList.sqf index 97bdac1c4d..e0606f2104 100644 --- a/addons/arsenal/functions/fnc_fillLoadoutsList.sqf +++ b/addons/arsenal/functions/fnc_fillLoadoutsList.sqf @@ -17,9 +17,21 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { { _x params ["_loadoutName", "_loadoutData"]; - ([_loadoutData] call FUNC(verifyLoadout)) params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount"]; + if (isNil {_contentListCtrl getVariable _loadoutName}) then { - private _newRow = _contentListCtrl lnbAddRow ["",_loadoutName]; + [_loadoutData] call FUNC(verifyLoadout) + } else { + _contentListCtrl getVariable (_loadoutName + "missingOrNilItemsCount") + } params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount", "_nullItemsList", "_unavailableItemsList"]; + + if (!(isNil "_nullItemsList") && {_nullItemsAmount > 0} || {_unavailableItemsAmount > 0}) then { + + private _printComponent = "ACE_Arsenal - Loadout:"; + private _printNullItemsList = ["Missing items:", str _nullItemsList] joinString " "; + private _printUnavailableItemsList = ["Unavailable items:", str _unavailableItemsList] joinString " "; + + diag_log text (format ["%1%5 %2%5 %3%5 %4", _printComponent, "Name: " + _loadoutName, _printNullItemsList, _printUnavailableItemsList, endl]); + }; if (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts) then { @@ -28,6 +40,8 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { _contentListCtrl lnbSetColumnsPos [0, 0.05, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90]; }; + private _newRow = _contentListCtrl lnbAddRow ["",_loadoutName]; + _contentListCtrl lnbSetPicture [[_newRow, 2], getText (configFile >> "cfgWeapons" >> ((_loadout select 0) select 0) >> "picture")]; _contentListCtrl lnbSetPicture [[_newRow, 3], getText (configFile >> "cfgWeapons" >> ((_loadout select 1) select 0) >> "picture")]; _contentListCtrl lnbSetPicture [[_newRow, 4], getText (configFile >> "cfgWeapons" >> ((_loadout select 2) select 0) >> "picture")]; @@ -47,7 +61,8 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { }; }; - _contentListCtrl setVariable [_loadoutName, _loadout]; + _contentListCtrl setVariable [_loadoutName + QGVAR(currentLoadoutsTab), _loadout]; + _contentListCtrl setVariable [_loadoutName + "missingOrNilItemsCount" + QGVAR(currentLoadoutsTab) , [_nullItemsAmount, _unavailableItemsAmount]]; if ((profileName + _loadoutName) in GVAR(sharedLoadoutsVars)) then { _contentListCtrl lnbSetText [[_newRow, 0], "X"]; @@ -97,4 +112,5 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { publicVariable QGVAR(sharedLoadoutsVars); }; + GVAR(firstRun) = nil; _contentListCtrl lnbSort [1, false]; \ No newline at end of file diff --git a/addons/arsenal/functions/fnc_onArsenalClose.sqf b/addons/arsenal/functions/fnc_onArsenalClose.sqf index e140872793..27ec18089f 100644 --- a/addons/arsenal/functions/fnc_onArsenalClose.sqf +++ b/addons/arsenal/functions/fnc_onArsenalClose.sqf @@ -46,6 +46,7 @@ GVAR(shiftState) = nil; GVAR(leftTabFocus) = nil; GVAR(rightTabFocus) = nil; GVAR(rightTabLnBFocus) = nil; +GVAR(firstRun) = nil; GVAR(selectedWeaponType) = nil; GVAR(virtualItems) = nil; diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index e57ff89c89..afd61f30bb 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -10,6 +10,7 @@ if (isNil QGVAR(center)) then { }; GVAR(mouseButtonState) = [[],[]]; +GVAR(firstRun) = true; if (isNil QGVAR(sharedLoadoutsNamespace)) then { GVAR(sharedLoadoutsNamespace) = true call CBA_fnc_createNamespace; diff --git a/addons/arsenal/functions/fnc_verifyLoadout.sqf b/addons/arsenal/functions/fnc_verifyLoadout.sqf index a7afea1207..0c2119b0cb 100644 --- a/addons/arsenal/functions/fnc_verifyLoadout.sqf +++ b/addons/arsenal/functions/fnc_verifyLoadout.sqf @@ -12,6 +12,8 @@ private _accsArray = GVAR(virtualItems) select 1; private _nullItemsAmount = 0; private _unavailableItemsAmount = 0; +private _nullItemsList = []; +private _unavailableItemsList = []; private _fnc_weaponCheck = { params ["_dataPath"]; @@ -26,13 +28,13 @@ private _fnc_weaponCheck = { if (isClass (_weaponCfg >> _item)) then { if !(CHECK_WEAPON_OR_ACC) then { - TRACE_1("item unavailable", _item); + _unavailableItemsList pushBackUnique _item; _dataPath set [_forEachIndex, ""]; _unavailableItemsAmount = _unavailableItemsAmount + 1; }; } else { - TRACE_1("item null", _item); + _nullItemsList pushBackUnique _item; _dataPath set [_forEachIndex, ""]; _nullItemsAmount = _nullItemsAmount + 1; }; @@ -46,13 +48,13 @@ private _fnc_weaponCheck = { if (isClass (_magCfg >> _mag)) then { if !(_mag in (GVAR(virtualItems) select 2)) then { - TRACE_1("item unavailable", _item); + _unavailableItemsList pushBackUnique _item; _dataPath set [_forEachIndex, []]; _unavailableItemsAmount = _unavailableItemsAmount + 1; }; } else { - TRACE_1("item null", _item); + _nullItemsList pushBackUnique _item; _dataPath set [_forEachIndex, []]; _nullItemsAmount = _nullItemsAmount + 1; }; @@ -83,7 +85,7 @@ for "_dataIndex" from 0 to 9 do { if (isClass (_vehcCfg >> _item) || {isClass (_weaponCfg >> _item)}) then { if !(CHECK_CONTAINER) then { - TRACE_1("item unavailable", _item); + _unavailableItemsList pushBackUnique _item; _loadout set [_dataIndex, []]; _unavailableItemsAmount = _unavailableItemsAmount + 1; } else { @@ -108,7 +110,7 @@ for "_dataIndex" from 0 to 9 do { }; } else { - TRACE_1("item null", _item); + _nullItemsList pushBackUnique _item; ((_loadout select _dataIndex) select 1) set [_currentIndex, []]; _nullItemsAmount = _nullItemsAmount + 1; }; @@ -130,7 +132,7 @@ for "_dataIndex" from 0 to 9 do { }; } else { - TRACE_1("item null", _item); + _nullItemsList pushBackUnique _item; ((_loadout select _dataIndex) select 1) set [_currentIndex, []]; _nullItemsAmount = _nullItemsAmount + 1; }; @@ -141,6 +143,7 @@ for "_dataIndex" from 0 to 9 do { }; } else { + _nullItemsList pushBackUnique _item; _loadout set [_dataIndex, []]; _nullItemsAmount = _nullItemsAmount + 1; }; @@ -156,13 +159,13 @@ for "_dataIndex" from 0 to 9 do { if !(_item in (GVAR(virtualItems) select 3)) then { - TRACE_1("item unavailable", _item); + _unavailableItemsList pushBackUnique _item; _loadout set [_dataIndex, ""]; _unavailableItemsAmount = _unavailableItemsAmount + 1; }; } else { - TRACE_1("item null", _item); + _nullItemsList pushBackUnique _item; _loadout set [_dataIndex, ""]; _nullItemsAmount = _nullItemsAmount + 1; }; @@ -178,13 +181,13 @@ for "_dataIndex" from 0 to 9 do { if !(_item in (GVAR(virtualItems) select 7)) then { - TRACE_1("item unavailable", _item); + _unavailableItemsList pushBackUnique _item; _loadout set [_dataIndex, ""]; _unavailableItemsAmount = _unavailableItemsAmount + 1; }; } else { - TRACE_1("item null", _item); + _nullItemsList pushBackUnique _item; _loadout set [_dataIndex, ""]; _nullItemsAmount = _nullItemsAmount + 1; }; @@ -201,13 +204,13 @@ for "_dataIndex" from 0 to 9 do { if !(CHECK_ASSIGNED_ITEMS) then { - TRACE_1("item unavailable", _item); + _unavailableItemsList pushBackUnique _item; (_loadout select _dataIndex) set [_subIndex, ""]; _unavailableItemsAmount = _unavailableItemsAmount + 1; }; } else { - TRACE_1("item null", _item); + _nullItemsList pushBackUnique _item; (_loadout select _dataIndex) set [_subIndex, ""]; _nullItemsAmount = _nullItemsAmount + 1; }; @@ -217,4 +220,4 @@ for "_dataIndex" from 0 to 9 do { }; }; -[_loadout, _nullItemsAmount, _unavailableItemsAmount] \ No newline at end of file +[_loadout, _nullItemsAmount, _unavailableItemsAmount, _nullItemsList, _unavailableItemsList] From 98bca7544ae0fe3f0a387a1283fd7981cb3d4740 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Fri, 3 Nov 2017 14:08:02 +0100 Subject: [PATCH 9/9] Remove unused var --- addons/arsenal/functions/fnc_fillLoadoutsList.sqf | 2 ++ addons/arsenal/functions/fnc_onArsenalClose.sqf | 1 - addons/arsenal/functions/fnc_onArsenalOpen.sqf | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/arsenal/functions/fnc_fillLoadoutsList.sqf b/addons/arsenal/functions/fnc_fillLoadoutsList.sqf index e0606f2104..f3ebe02bd1 100644 --- a/addons/arsenal/functions/fnc_fillLoadoutsList.sqf +++ b/addons/arsenal/functions/fnc_fillLoadoutsList.sqf @@ -17,6 +17,7 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { { _x params ["_loadoutName", "_loadoutData"]; + // Check if the check was ran already if (isNil {_contentListCtrl getVariable _loadoutName}) then { [_loadoutData] call FUNC(verifyLoadout) @@ -24,6 +25,7 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { _contentListCtrl getVariable (_loadoutName + "missingOrNilItemsCount") } params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount", "_nullItemsList", "_unavailableItemsList"]; + // Log missing / nil items to RPT if (!(isNil "_nullItemsList") && {_nullItemsAmount > 0} || {_unavailableItemsAmount > 0}) then { private _printComponent = "ACE_Arsenal - Loadout:"; diff --git a/addons/arsenal/functions/fnc_onArsenalClose.sqf b/addons/arsenal/functions/fnc_onArsenalClose.sqf index 27ec18089f..e140872793 100644 --- a/addons/arsenal/functions/fnc_onArsenalClose.sqf +++ b/addons/arsenal/functions/fnc_onArsenalClose.sqf @@ -46,7 +46,6 @@ GVAR(shiftState) = nil; GVAR(leftTabFocus) = nil; GVAR(rightTabFocus) = nil; GVAR(rightTabLnBFocus) = nil; -GVAR(firstRun) = nil; GVAR(selectedWeaponType) = nil; GVAR(virtualItems) = nil; diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index afd61f30bb..e57ff89c89 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -10,7 +10,6 @@ if (isNil QGVAR(center)) then { }; GVAR(mouseButtonState) = [[],[]]; -GVAR(firstRun) = true; if (isNil QGVAR(sharedLoadoutsNamespace)) then { GVAR(sharedLoadoutsNamespace) = true call CBA_fnc_createNamespace;