From 4ee7b172d3212d5247fbd4ba9dd47a87aa1465b4 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Wed, 8 Nov 2017 17:50:48 +0100 Subject: [PATCH] Improve fillLeftPanel weapon tab filling --- .../arsenal/functions/fnc_fillLeftPanel.sqf | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/addons/arsenal/functions/fnc_fillLeftPanel.sqf b/addons/arsenal/functions/fnc_fillLeftPanel.sqf index d1c0492091..15fc6ff15b 100644 --- a/addons/arsenal/functions/fnc_fillLeftPanel.sqf +++ b/addons/arsenal/functions/fnc_fillLeftPanel.sqf @@ -39,26 +39,9 @@ switch true do { private _addEmpty = _ctrlPanel lbadd format [" <%1>",localize "str_empty"]; _ctrlPanel lbsetvalue [_addEmpty, -1]; - // Filling - switch (_ctrlIDC) do { - case IDC_buttonPrimaryWeapon : { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } foreach ((GVAR(virtualItems) select 0) select 0); - }; - - case IDC_buttonHandgun : { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } foreach ((GVAR(virtualItems) select 0) select 2); - }; - - case IDC_buttonSecondaryWeapon : { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } foreach ((GVAR(virtualItems) select 0) select 1); - }; - }; + { + ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); + } foreach ((GVAR(virtualItems) select 0) select ([IDC_buttonPrimaryWeapon, IDC_buttonSecondaryWeapon, IDC_buttonHandgun] find _ctrlIDC)); }; case (_ctrlIDC in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBackpack]) : {