comparison Plugins/CraftingAddons/GnomeWorks.lua @ 225:2e4e52a589e5

Added onQueueStart and onQueueEnd events to crafting addon registering. GnomeWorks queue frame should automatically be closed before adding items to the queue and opened afterwards to speed this process up.
author Zerotorescue
date Mon, 07 Feb 2011 15:06:41 +0100
parents 3bec0ea44607
children 7cb41031cae7
comparison
equal deleted inserted replaced
224:f1d08aaafeaa 225:2e4e52a589e5
1 do 1 do
2
3 local function QueueStart()
4 -- If the queue frame is open while queueing, each item takes many seconds to be added,
5 -- closing it resolves this.
6 GnomeWorksQueueFrame:Hide();
7 end
8
9 local function QueueEnd()
10 GnomeWorks:ShowQueueList();
11 end
2 12
3 local function Queue(tradeSkillIndex, amount) 13 local function Queue(tradeSkillIndex, amount)
4 local link = GetTradeSkillRecipeLink(tradeSkillIndex); 14 local link = GetTradeSkillRecipeLink(tradeSkillIndex);
5 local recipeId = tonumber(link:match("|Henchant:([-0-9]+)|h")); 15 local recipeId = tonumber(link:match("enchant:(%d+)"));
6 16 .
7 GnomeWorks:ShowQueueList(); 17 return GnomeWorks:AddToQueue(GnomeWorks.player, GnomeWorks.tradeID, recipeId, amount);
8 return GnomeWorks:AddToQueue(GnomeWorks.player, tradeSkillIndex, recipeId, amount);
9 end 18 end
10 19
11 local function IsEnabled() 20 local function IsEnabled()
12 return (GnomeWorks and GnomeWorks.AddToQueue); 21 return (GnomeWorks and GnomeWorks.AddToQueue);
13 end 22 end
14 23
15 IMRegisterCraftingAddon("GnomeWorks", Queue, IsEnabled); 24 IMRegisterCraftingAddon("GnomeWorks", Queue, IsEnabled, nil, QueueStart, QueueEnd);
16 25
17 end 26 end