예제 #1
0
 private void _Initialize(ITMPluginManager mgr, string path)
 {
     this.itemDictionary = new ItemDictionary(path, (Item)mgr.Offsets.ItemID);
     this.setRegistry    = new SetRegistry();
     this.setRegistry.Register(new PartyhatSet());
     this.setRegistry.Register(new HalloweenMaskSet());
     this.setRegistry.Register(new BronzeLgSet());
     this.setRegistry.Register(new IronLgSet());
     this.setRegistry.Register(new SteelLgSet());
     this.setRegistry.Register(new BlackLgSet());
     this.setRegistry.Register(new MithrilLgSet());
     this.setRegistry.Register(new AdamantLgSet());
     this.setRegistry.Register(new RuneArmourLgSet());
     this.setRegistry.Register(new DragonArmourLgSet());
     this.setRegistry.Register(new GildedArmourLgSet());
 }
예제 #2
0
        public ItemDictionary(string modPath, Item offset)
        {
            ItemDictionary.Instance = this;
            _dictionary             = new Dictionary <string, Item>(StringComparer.OrdinalIgnoreCase);

            var itemDataPath = Path.Combine(new[] { FileSystem.RootPath, modPath, "ItemData.xml" });

            try
            {
                var itemData = Utils.Deserialize1 <ModItemDataXML[]>(itemDataPath);
                foreach (ModItemDataXML item in itemData)
                {
                    Item im;
                    if (!Enum.TryParse <Item>(item.ItemID, out im))
                    {
                        _dictionary.Add(item.ItemID, offset++);
                    }
                }
                Logger.Log($"Loaded {_dictionary.Keys.Count} items from {itemDataPath}");
            } catch (Exception e)
            {
                Logger.LogErr($"Failed to load items from {itemDataPath}\n{e}");
            }
        }