예제 #1
0
 private void FilterInventory(MyGuiControlListbox listbox, List<int> itemsIDs, List<ItemCategory> filter, List<int> hideList,
     MyGuiControlCheckbox checkboxAll, MyGuiControlCheckbox checkboxWeapons, MyGuiControlCheckbox checkboxOres,
     MyGuiControlCheckbox checkboxConsumables, MyGuiControlCheckbox checkboxEquipment, MyGuiControlCheckbox checkboxGods)
 {
     if (listbox != null)
     {                
         listbox.RemoveAllItems();
         listbox.ResetScrollbarPosition();
         filter.Clear();
         if (!checkboxAll.Checked) 
         {
             if (checkboxWeapons.Checked) filter.AddRange(MyItemFilterConstants.CategoryAmmo);
             if (checkboxOres.Checked) filter.AddRange(MyItemFilterConstants.Ores);
             if (checkboxConsumables.Checked) filter.AddRange(MyItemFilterConstants.ConsumAndMedical);
             if (checkboxEquipment.Checked) filter.AddRange(MyItemFilterConstants.Devices);
             if (checkboxGods.Checked) filter.AddRange(MyItemFilterConstants.GoodsAndIllegal);
         }
         FillListBoxFromIDs(listbox, itemsIDs, filter, ref hideList);
         AddFreeRowsIfCan(listbox, 1);
     }
 }