annotate Plugins/CraftingAddons/Cauldron.lua @ 144:12a8ea5af671

Added a ?remove? button to the crafting queue. When removing an item from the queue or when it is finished casting (when using the Inventorium queue processer), items are moved to the ?unqueuables? window. Fixed auction price checking. Now resetting filters before scanning the tradeskill recipes.
author Zerotorescue
date Wed, 19 Jan 2011 23:21: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