Пример #1
0
 public void AddGlobalItem(string name, GlobalItem globalItem)
 {
     globalItem.mod         = this;
     globalItem.Name        = name;
     this.globalItems[name] = globalItem;
     ItemLoader.globalItems.Add(globalItem);
 }
Пример #2
0
        private void AutoloadGlobalItem(Type type)
        {
            GlobalItem globalItem = (GlobalItem)Activator.CreateInstance(type);

            globalItem.mod = this;
            string name = type.Name;

            if (globalItem.Autoload(ref name))
            {
                AddGlobalItem(name, globalItem);
            }
        }
Пример #3
0
        public void AddGlobalItem(string name, GlobalItem globalItem)
        {
            Type type = globalItem.GetType();

            if (type.GetMethod("UpdateAccessory", new Type[] { typeof(Item), typeof(Player) }) != null)
            {
                throw new Exception("Item " + name + " uses an old UpdateAccessory hook");
            }
            globalItem.mod         = this;
            globalItem.Name        = name;
            this.globalItems[name] = globalItem;
            ItemLoader.globalItems.Add(globalItem);
        }
Пример #4
0
 public void AddGlobalItem(string name, GlobalItem globalItem)
 {
     globalItem.mod = this;
     globalItem.Name = name;
     this.globalItems[name] = globalItem;
     ItemLoader.globalItems.Add(globalItem);
 }
Пример #5
0
 internal void Unload()
 {
     recipes.Clear();
     items.Clear();
     globalItem = null;
 }
Пример #6
-1
 public void SetGlobalItem(GlobalItem globalItem)
 {
     globalItem.mod = this;
     this.globalItem = globalItem;
 }
Пример #7
-1
 //I'm not sure why I have this
 internal void Unload()
 {
     recipes.Clear();
     items.Clear();
     globalItem = null;
     dusts.Clear();
     tiles.Clear();
     globalNPC = null;
 }
Пример #8
-2
		public void AddGlobalItem(string name, GlobalItem globalItem)
		{
			Type colorClass = typeof(Microsoft.Xna.Framework.Color);
			Type floatClass = typeof(float);
			Type floatRefClass = floatClass.MakeByRefType();
			if (globalItem.GetType().GetMethod("PreDrawInWorld", new Type[] {
				typeof(Item), typeof(SpriteBatch), colorClass, colorClass, floatRefClass, floatRefClass
				}) != null)
			{
				throw new OldHookException("GlobalItem.PreDrawInWorld");
			}
			if (globalItem.GetType().GetMethod("PostDrawInWorld", new Type[] {
				typeof(Item), typeof(SpriteBatch), colorClass, colorClass, floatClass, floatClass
				}) != null)
			{
				throw new OldHookException("GlobalItem.PostDrawInWorld");
			}
			Type type = globalItem.GetType();
			globalItem.mod = this;
			globalItem.Name = name;
			this.globalItems[name] = globalItem;
			ItemLoader.globalItems.Add(globalItem);
		}