annotate Plugins/CraftingAddons/Cauldron.lua @ 143:8eb0f5b5a885

Fixed ?fully stocked? tooltip to say it uses the restock target setting rather than the global stock setting. Making sure the inventorium queuer frame is available before hiding it. Fixed an error with queueing items. Skip reasons are now sorted by importance (also by default). Now closing the queue window when you close your profession window.
author Zerotorescue
date Tue, 18 Jan 2011 23:48:16 +0100
parents 3bec0ea44607
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