// Token: 0x0600006E RID: 110 RVA: 0x00005AB4 File Offset: 0x00003CB4
 public static void DrawFilterTab(ItemOptionList OptionList)
 {
     System.Action two = null;
     System.Action tri = null;
     System.Action one = null;
     Prefab.SectionTabButton("ФИЛЬТР ПРЕДМЕТОВ", delegate
     {
         Prefab.Toggle("Оружие", ref OptionList.ItemfilterGun, 17);
         Prefab.Toggle("Боеприпасы", ref OptionList.ItemfilterAmmo, 17);
         Prefab.Toggle("Медикаменты", ref OptionList.ItemfilterMedical, 17);
         Prefab.Toggle("Рюкзаки", ref OptionList.ItemfilterBackpack, 17);
         Prefab.Toggle("Charges", ref OptionList.ItemfilterCharges, 17);
         Prefab.Toggle("Топливо", ref OptionList.ItemfilterFuel, 17);
         Prefab.Toggle("Одежда", ref OptionList.ItemfilterClothing, 17);
         Prefab.Toggle("Провизия", ref OptionList.ItemfilterFoodAndWater, 17);
         Prefab.Toggle("Настройка фильтра", ref OptionList.ItemfilterCustom, 17);
         bool itemfilterCustom = OptionList.ItemfilterCustom;
         bool flag             = itemfilterCustom;
         if (flag)
         {
             GUILayout.Space(5f);
             string text = "Кастомизация фильтра";
             System.Action code;
             bool flag2 = (code = one) == null;
             if (flag2)
             {
                 code = (one = delegate()
                 {
                     GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>());
                     GUILayout.Space(55f);
                     OptionList.searchstring = Prefab.TextField(OptionList.searchstring, "Поиск:", 200);
                     GUILayout.Space(5f);
                     bool flag3 = Prefab.Button("Обновить", 276f, 25f, Array.Empty <GUILayoutOption>());
                     bool flag4 = flag3;
                     if (flag4)
                     {
                         ItemsComponent.RefreshItems();
                     }
                     GUILayout.FlexibleSpace();
                     GUILayout.EndHorizontal();
                     Rect area = new Rect(70f, 50f, 540f, 190f);
                     string title = "Добавить";
                     ItemOptionList optionList = OptionList;
                     System.Action code2;
                     bool flag5 = (code2 = two) == null;
                     if (flag5)
                     {
                         code2 = (two = delegate()
                         {
                             GUILayout.Space(5f);
                             for (int i = 0; i < ItemsComponent.items.Count; i++)
                             {
                                 ItemAsset itemAsset = ItemsComponent.items[i];
                                 bool flag7 = false;
                                 bool flag8 = itemAsset.itemName.ToLower().Contains(OptionList.searchstring.ToLower());
                                 bool flag9 = flag8;
                                 if (flag9)
                                 {
                                     flag7 = true;
                                 }
                                 bool flag10 = OptionList.searchstring.Length < 2;
                                 bool flag11 = flag10;
                                 if (flag11)
                                 {
                                     flag7 = false;
                                 }
                                 bool flag12 = OptionList.AddedItems.Contains(itemAsset.id);
                                 bool flag13 = flag12;
                                 if (flag13)
                                 {
                                     flag7 = false;
                                 }
                                 bool flag14 = flag7;
                                 bool flag15 = flag14;
                                 if (flag15)
                                 {
                                     ItemUtilities.DrawItemButton(itemAsset, OptionList.AddedItems);
                                 }
                             }
                             GUILayout.Space(2f);
                         });
                     }
                     Prefab.ScrollView(area, title, ref optionList.additemscroll, code2, 20, Array.Empty <GUILayoutOption>());
                     Rect area2 = new Rect(70f, 245f, 540f, 191f);
                     string title2 = "Удалить";
                     ItemOptionList optionList2 = OptionList;
                     System.Action code3;
                     bool flag6 = (code3 = tri) == null;
                     if (flag6)
                     {
                         code3 = (tri = delegate()
                         {
                             GUILayout.Space(5f);
                             for (int i = 0; i < ItemsComponent.items.Count; i++)
                             {
                                 ItemAsset itemAsset = ItemsComponent.items[i];
                                 bool flag7 = false;
                                 bool flag8 = itemAsset.itemName.ToLower().Contains(OptionList.searchstring.ToLower());
                                 bool flag9 = flag8;
                                 if (flag9)
                                 {
                                     flag7 = true;
                                 }
                                 bool flag10 = !OptionList.AddedItems.Contains(itemAsset.id);
                                 bool flag11 = flag10;
                                 if (flag11)
                                 {
                                     flag7 = false;
                                 }
                                 bool flag12 = flag7;
                                 bool flag13 = flag12;
                                 if (flag13)
                                 {
                                     ItemUtilities.DrawItemButton(itemAsset, OptionList.AddedItems);
                                 }
                             }
                             GUILayout.Space(2f);
                         });
                     }
                     Prefab.ScrollView(area2, title2, ref optionList2.removeitemscroll, code3, 20, Array.Empty <GUILayoutOption>());
                 });
             }
             Prefab.SectionTabButton(text, code, 0f, 20);
         }
     }, 0f, 20);
 }
Beispiel #2
0
        public static void DrawFilterTab(ItemOptionList OptionList)
        {
            Prefab.SectionTabButton("ITEM FILTER", () =>
            {
                Prefab.Toggle("Guns", ref OptionList.ItemfilterGun);
                Prefab.Toggle("Ammo", ref OptionList.ItemfilterAmmo);
                Prefab.Toggle("Medical", ref OptionList.ItemfilterMedical);
                Prefab.Toggle("Backpacks", ref OptionList.ItemfilterBackpack);
                Prefab.Toggle("Charges", ref OptionList.ItemfilterCharges);
                Prefab.Toggle("Fuel", ref OptionList.ItemfilterFuel);
                Prefab.Toggle("Clothing", ref OptionList.ItemfilterClothing);
                Prefab.Toggle("Food and Water", ref OptionList.ItemfilterFoodAndWater);
                Prefab.Toggle("Enable Custom Filter", ref OptionList.ItemfilterCustom);
                if (OptionList.ItemfilterCustom)
                {
                    GUILayout.Space(5);
                    Prefab.SectionTabButton("CUSTOM FILTER", () =>
                    {
                        GUILayout.BeginHorizontal();
                        GUILayout.Space(55);
                        OptionList.searchstring = Prefab.TextField(OptionList.searchstring, "Search:", 200);
                        GUILayout.Space(5);

                        if (Prefab.Button("Refresh", 276))
                        {
                            ItemsComponent.RefreshItems();
                        }

                        GUILayout.FlexibleSpace();
                        GUILayout.EndHorizontal();
                        Prefab.ScrollView(new Rect(70, 0 + 50, 620 - 70 - 10, 190), "Add", ref OptionList.additemscroll, () =>
                        {
                            GUILayout.Space(5);
                            for (var i = 0; i < ItemsComponent.items.Count; i++)
                            {
                                ItemAsset asset = ItemsComponent.items[i];
                                bool isShown    = false;

                                if (asset.itemName.ToLower().Contains(OptionList.searchstring.ToLower()))
                                {
                                    isShown = true;
                                }
                                if (OptionList.searchstring.Length < 2)
                                {
                                    isShown = false;
                                }
                                if (OptionList.AddedItems.Contains(asset.id))
                                {
                                    isShown = false;
                                }

                                if (isShown)
                                {
                                    DrawItemButton(asset, OptionList.AddedItems);
                                }
                            }
                            GUILayout.Space(2);
                        });
                        Prefab.ScrollView(new Rect(70, 200 + 5 + 40, 620 - 70 - 10, 191), "Remove", ref OptionList.removeitemscroll, () =>
                        {
                            GUILayout.Space(5);
                            for (var i = 0; i < ItemsComponent.items.Count; i++)
                            {
                                ItemAsset asset = ItemsComponent.items[i];
                                bool isShown    = false;

                                if (asset.itemName.ToLower().Contains(OptionList.searchstring.ToLower()))
                                {
                                    isShown = true;
                                }
                                if (!OptionList.AddedItems.Contains(asset.id))
                                {
                                    isShown = false;
                                }

                                if (isShown)
                                {
                                    DrawItemButton(asset, OptionList.AddedItems);
                                }
                            }
                            GUILayout.Space(2);
                        });
                    });
                }
            });
        }