Esempio n. 1
0
 public void Init()
 {
     NGuiInvGridCreativeMenu cm = new NGuiInvGridCreativeMenu ();
     foreach (ItemStack invF in cm.GetAllItems()) {
         ItemClass ib = ItemClass.list [invF.itemValue.type];
         string name = ib.GetItemName ();
         if (name != null && name.Length > 0) {
             if (!items.ContainsKey (name)) {
                 items.Add (name, invF.itemValue);
             } else {
                 //Log.Out ("Item \"" + name + "\" already in list!");
             }
         }
     }
     foreach (ItemStack invF in cm.GetAllBlocks()) {
         ItemClass ib = ItemClass.list [invF.itemValue.type];
         string name = ib.GetItemName ();
         if (name != null && name.Length > 0) {
             if (!items.ContainsKey (name)) {
                 items.Add (name, invF.itemValue);
             } else {
                 //Log.Out ("Item \"" + name + "\" already in list!");
             }
         }
     }
 }
        public void Execute2()
        {
            NGuiInvGridCreativeMenu cm = new NGuiInvGridCreativeMenu();
            //SdtdConsole.Instance.Output ("##Liste des objets disponibles##");
            List <string> itemsListKFP = new List <string> ()
            {
            };

            foreach (ItemStack invF in cm.GetAllItems())
            {
                ItemClass ib          = ItemClass.list [invF.itemValue.type];
                string    name        = ib.GetItemName();
                int       stackNumber = ib.Stacknumber.Value;
                if (name != null && name.Length > 0)
                {
                    itemsListKFP.Add(name + "\t" + stackNumber.ToString());
                }
            }
            foreach (ItemStack invF in cm.GetAllBlocks())
            {
                ItemClass ib          = ItemClass.list [invF.itemValue.type];
                string    name        = ib.GetItemName();
                int       stackNumber = ib.Stacknumber.Value;
                if (name != null && name.Length > 0)
                {
                    itemsListKFP.Add(name + "\t" + stackNumber.ToString());
                }
            }
            try {
                itemsListKFP.Sort();
                int    num       = 0;
                string itemsList = string.Empty;
                for (int i = 0; i < itemsListKFP.Count; i++)
                {
                    if (itemsListKFP[i] != null)
                    {
                        itemsList += itemsListKFP[i] + "\n";
                        num++;
                    }
                }
                string       exportPath = Utils.GetGameDir("ItemsInfos");
                StreamWriter sw         = new StreamWriter(exportPath + "/itemsList.txt");
                sw.Write(itemsList);
                sw.Close();
                itemsList = null;
                SdtdConsole.Instance.Output("Items List saved to file successfully..");
            } catch (Exception arg) {
                Log.Out("Error in ListItems.Run.listAll: " + arg);
            }
        }
        public void Execute2()
        {
            NGuiInvGridCreativeMenu cm = new NGuiInvGridCreativeMenu ();
            //SdtdConsole.Instance.Output ("##Liste des objets disponibles##");
            List<string> itemsListKFP = new List<string> () { };

            foreach (ItemStack invF in cm.GetAllItems()) {
                ItemClass ib = ItemClass.list [invF.itemValue.type];
                string name = ib.GetItemName ();
                int stackNumber = ib.Stacknumber.Value ;
                if (name != null && name.Length > 0) {
                    itemsListKFP.Add(name + "\t" + stackNumber.ToString());
                }
            }
            foreach (ItemStack invF in cm.GetAllBlocks()) {
                ItemClass ib = ItemClass.list [invF.itemValue.type];
                string name = ib.GetItemName ();
                int stackNumber = ib.Stacknumber.Value ;
                if (name != null && name.Length > 0) {
                    itemsListKFP.Add(name + "\t" + stackNumber.ToString());
                }
            }
            try {
                itemsListKFP.Sort();
                int num = 0;
                string itemsList = string.Empty;
                for (int i = 0; i < itemsListKFP.Count; i ++) {
                    if( itemsListKFP[i] != null)	{
                        itemsList += itemsListKFP[i] + "\n";
                        num++;
                    }
                }
                string exportPath = Utils.GetGameDir ("ItemsInfos");
                StreamWriter sw = new StreamWriter(exportPath  + "/itemsList.txt");
                sw.Write(itemsList);
                sw.Close();
                itemsList = null;
                SdtdConsole.Instance.Output  ("Items List saved to file successfully..");
            } catch (Exception arg) {
                    Log.Out("Error in ListItems.Run.listAll: " + arg);
                }
        }
Esempio n. 4
0
        public void Refresh()
        {
            NGuiInvGridCreativeMenu cm = new NGuiInvGridCreativeMenu();

            foreach (ItemStack invF in cm.GetAllItems())
            {
                ItemClass ib = ItemClass.list [invF.itemValue.type];

                string name = ib.GetItemName();
                if (name != null && name.Length > 0)
                {
                    if (!items.ContainsKey(name))
                    {
                        items.Add(name, invF.itemValue);
                    }
                    else
                    {
                        //Log.Out ("Item \"" + name + "\" already in list!");
                    }
                }
            }

            foreach (ItemStack invF in cm.GetAllBlocks())
            {
                ItemClass ib   = ItemClass.list [invF.itemValue.type];
                string    name = ib.GetItemName();
                if (name != null && name.Length > 0)
                {
                    if (!items.ContainsKey(name))
                    {
                        items.Add(name, invF.itemValue);
                    }
                    else
                    {
                        //Log.Out ("Item \"" + name + "\" already in list!");
                    }
                }
            }

            //Log.Out (items.Count + " items loaded");
        }
 public static void LoadGameItems()
 {
     NGuiInvGridCreativeMenu _menu = new NGuiInvGridCreativeMenu();
     foreach (ItemStack _itemStack in _menu.GetAllItems())
     {
         ItemClass _itemClass = ItemClass.list[_itemStack.itemValue.type];
         string name = _itemClass.GetItemName();
         if (name != null && name.Length > 0 && !Dict.ContainsKey(name))
         {
             Dict.Add(name, _itemStack.itemValue);
         }
     }
     foreach (ItemStack _itemStack in _menu.GetAllBlocks())
     {
         ItemClass _itemClass = ItemClass.list[_itemStack.itemValue.type];
         string name = _itemClass.GetItemName();
         if (name != null && name.Length > 0 && !Dict.ContainsKey(name))
         {
             Dict.Add(name, _itemStack.itemValue);
         }
     }
 }
Esempio n. 6
0
        public static void LoadGameItems()
        {
            NGuiInvGridCreativeMenu _menu = new NGuiInvGridCreativeMenu();

            foreach (ItemStack _itemStack in _menu.GetAllItems())
            {
                ItemClass _itemClass = ItemClass.list[_itemStack.itemValue.type];
                string    name       = _itemClass.GetItemName();
                if (name != null && name.Length > 0 && !Dict.ContainsKey(name))
                {
                    Dict.Add(name, _itemStack.itemValue);
                }
            }
            foreach (ItemStack _itemStack in _menu.GetAllBlocks())
            {
                ItemClass _itemClass = ItemClass.list[_itemStack.itemValue.type];
                string    name       = _itemClass.GetItemName();
                if (name != null && name.Length > 0 && !Dict.ContainsKey(name))
                {
                    Dict.Add(name, _itemStack.itemValue);
                }
            }
        }