public bool GetLootRuleInfoFromItemInfo(ItemInfoIdentArgs itemInfoIdentArgs, ItemInfoCallback itemInfoCallback)
		{
			try
			{
				if (uTank2.PluginCore.PC.FLootPluginQueryNeedsID(itemInfoIdentArgs.IdentifiedItem.Id))
				{
					// public delegate void delFLootPluginClassifyCallback(int obj, LootAction result, bool getsuccess);
					//uTank2.PluginCore.delFLootPluginClassifyCallback callback = new uTank2.PluginCore.delFLootPluginClassifyCallback(uTankCallBack);
					//uTank2.PluginCore.PC.FLootPluginClassifyCallback(itemInfoIdentArgs.IdentifiedItem.Id, callback);

					ItemWaitingForCallback itemWaitingForCallback = new ItemWaitingForCallback(itemInfoIdentArgs, itemInfoCallback);
					itemsWaitingForCallback.Add(itemWaitingForCallback);

					uTank2.PluginCore.PC.FLootPluginClassifyCallback(itemInfoIdentArgs.IdentifiedItem.Id, uTankCallBack);
				}
				else
				{
					uTank2.LootPlugins.LootAction result = uTank2.PluginCore.PC.FLootPluginClassifyImmediate(itemInfoIdentArgs.IdentifiedItem.Id);

					itemInfoCallback(itemInfoIdentArgs, !result.IsNoLoot, result.IsSalvage, result.RuleName);
				}
			}
			catch (NullReferenceException) // Virindi tank probably not loaded.
			{
				return false;
			}

			return true;
		}
Пример #2
0
        public bool GetLootRuleInfoFromItemInfo(ItemInfoIdentArgs itemInfoIdentArgs, ItemInfoCallback itemInfoCallback)
        {
            try
            {
                if (uTank2.PluginCore.PC.FLootPluginQueryNeedsID(itemInfoIdentArgs.IdentifiedItem.Id))
                {
                    // public delegate void delFLootPluginClassifyCallback(int obj, LootAction result, bool getsuccess);
                    //uTank2.PluginCore.delFLootPluginClassifyCallback callback = new uTank2.PluginCore.delFLootPluginClassifyCallback(uTankCallBack);
                    //uTank2.PluginCore.PC.FLootPluginClassifyCallback(itemInfoIdentArgs.IdentifiedItem.Id, callback);

                    ItemWaitingForCallback itemWaitingForCallback = new ItemWaitingForCallback(itemInfoIdentArgs, itemInfoCallback);
                    itemsWaitingForCallback.Add(itemWaitingForCallback);

                    uTank2.PluginCore.PC.FLootPluginClassifyCallback(itemInfoIdentArgs.IdentifiedItem.Id, uTankCallBack);
                }
                else
                {
                    uTank2.LootPlugins.LootAction result = uTank2.PluginCore.PC.FLootPluginClassifyImmediate(itemInfoIdentArgs.IdentifiedItem.Id);

                    itemInfoCallback(itemInfoIdentArgs, !result.IsNoLoot, result.IsSalvage, result.RuleName);
                }
            }
            catch (NullReferenceException)             // Virindi tank probably not loaded.
            {
                return(false);
            }

            return(true);
        }
			public ItemWaitingForCallback(ItemInfoIdentArgs itemInfoIdentArgs, ItemInfoCallback itemInfoCallBack)
			{
				ItemInfoIdentArgs = itemInfoIdentArgs;
				ItemInfoCallBack = itemInfoCallBack;
			}
Пример #4
0
 public ItemWaitingForCallback(ItemInfoIdentArgs itemInfoIdentArgs, ItemInfoCallback itemInfoCallBack)
 {
     ItemInfoIdentArgs = itemInfoIdentArgs;
     ItemInfoCallBack  = itemInfoCallBack;
 }