annotate CraftingAddons/Cauldron.lua @ 81:58617c7827fa

Item refilling should now be working. Probably very slow if your bags, bank or guild bank is filled with over 200 unique items or so (needs some real testing, but know that it is a known (possible) issue).
author Zerotorescue
date Thu, 06 Jan 2011 01:01:25 +0100
parents 2127ab01ed4a
children
rev   line source
Zerotorescue@65 1 do
Zerotorescue@65 2
Zerotorescue@65 3 local function Queue(tradeSkillIndex, amount)
Zerotorescue@75 4 local tradeskillName, currentLevel, maxLevel = GetTradeSkillLine();
Zerotorescue@75 5
Zerotorescue@75 6 local link = GetTradeSkillItemLink(tradeSkillIndex);
Zerotorescue@75 7 local itemName = link and link:match("%[([^%[%]]*)%]");
Zerotorescue@75 8
Zerotorescue@75 9 if not itemName then
Zerotorescue@75 10 return;
Zerotorescue@75 11 end
Zerotorescue@75 12
Zerotorescue@75 13 local skillInfo = Cauldron:GetSkillInfo(tradeskillName, itemName);
Zerotorescue@75 14
Zerotorescue@65 15 CauldronQueue:AddItem(Cauldron.db.realm.userdata[Cauldron.vars.playername].queue, skillInfo, amount);
Zerotorescue@65 16
Zerotorescue@65 17 Cauldron:UpdateQueue();
Zerotorescue@65 18
Zerotorescue@65 19 -- update the shopping list
Zerotorescue@65 20 Cauldron:UpdateShoppingListFromQueue();
Zerotorescue@65 21
Zerotorescue@75 22 Cauldron:UpdateButtons();
Zerotorescue@75 23
Zerotorescue@65 24 return;
Zerotorescue@65 25 end
Zerotorescue@65 26
Zerotorescue@65 27 local function IsEnabled()
Zerotorescue@65 28 return (Cauldron and CauldronQueue and CauldronQueue.AddItem);
Zerotorescue@65 29 end
Zerotorescue@65 30
Zerotorescue@65 31 local function OnSelect()
Zerotorescue@65 32 local addonName = "|r|cfffed000Cauldron|r|cffff6600";
Zerotorescue@65 33
Zerotorescue@65 34 print("|cffff6600" .. addonName .. " has not yet been tested. Please report any of your experiences.|r");
Zerotorescue@65 35 end
Zerotorescue@65 36
Zerotorescue@65 37 IMRegisterCraftingAddon("Cauldron", Queue, IsEnabled, OnSelect);
Zerotorescue@65 38
Zerotorescue@65 39 end