public static void Window(int windowID)
        {
            ItemWhitelistObject whitelistToEdit = Cheats.Items.editingaip ? G.Settings.MiscOptions.AIPWhitelist : G.Settings.MiscOptions.ESPWhitelist;
            string s = Cheats.Items.editingaip ? "Pickup" : "Display";

            whitelistToEdit.filterItems = GUILayout.Toggle(whitelistToEdit.filterItems, "Filter Item Whitelist");
            if (whitelistToEdit.filterItems)
            {
                GUILayout.Space(3);
                GUILayout.BeginVertical(style: "SelectedButtonDropdown");
                whitelistToEdit.allowGun         = GUILayout.Toggle(whitelistToEdit.allowGun, s + " Guns");
                whitelistToEdit.allowMelee       = GUILayout.Toggle(whitelistToEdit.allowMelee, s + " Melees");
                whitelistToEdit.allowBackpack    = GUILayout.Toggle(whitelistToEdit.allowBackpack, s + " Backpacks");
                whitelistToEdit.allowClothing    = GUILayout.Toggle(whitelistToEdit.allowClothing, s + " Clothing");
                whitelistToEdit.allowFuel        = GUILayout.Toggle(whitelistToEdit.allowFuel, s + " Fuel");
                whitelistToEdit.allowFoodWater   = GUILayout.Toggle(whitelistToEdit.allowFoodWater, s + " Food/Water");
                whitelistToEdit.allowAmmo        = GUILayout.Toggle(whitelistToEdit.allowAmmo, s + " Ammo");
                whitelistToEdit.allowMedical     = GUILayout.Toggle(whitelistToEdit.allowMedical, s + " Medical");
                whitelistToEdit.allowThrowable   = GUILayout.Toggle(whitelistToEdit.allowThrowable, s + " Throwables");
                whitelistToEdit.allowAttachments = GUILayout.Toggle(whitelistToEdit.allowAttachments, s + " Attachments");
                GUILayout.EndVertical();
            }
            if (GUILayout.Button("Close Window"))
            {
                WhitelistMenuOpen = !WhitelistMenuOpen;
            }
            GUI.DragWindow();
        }
Ejemplo n.º 2
0
 public static bool IsItemWhitelisted(InteractableItem item, ItemWhitelistObject itemWhitelistObject)
 {
     if (itemWhitelistObject.filterItems)
     {
         if (itemWhitelistObject.allowGun && item.asset is ItemGunAsset)
         {
             return(true);
         }
         else if (itemWhitelistObject.allowBackpack && item.asset is ItemBackpackAsset)
         {
             return(true);
         }
         else if (itemWhitelistObject.allowAmmo && (item.asset is ItemMagazineAsset || item.asset is ItemCaliberAsset))
         {
             return(true);
         }
         else if (itemWhitelistObject.allowAttachments && (item.asset is ItemBarrelAsset || item.asset is ItemOpticAsset))
         {
             return(true);
         }
         else if (itemWhitelistObject.allowClothing && item.asset is ItemClothingAsset)
         {
             return(true);
         }
         else if (itemWhitelistObject.allowFuel && item.asset is ItemFuelAsset)
         {
             return(true);
         }
         else if (itemWhitelistObject.allowMedical && item.asset is ItemMedicalAsset)
         {
             return(true);
         }
         else if (itemWhitelistObject.allowMelee && item.asset is ItemMeleeAsset)
         {
             return(true);
         }
         else if (itemWhitelistObject.allowThrowable && item.asset is ItemThrowableAsset)
         {
             return(true);
         }
         else if (itemWhitelistObject.allowFoodWater && (item.asset is ItemFoodAsset || item.asset is ItemWaterAsset))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(true);
     }
 }