annotate Plugins/CraftingAddons/Cauldron.lua @ 110:67bd5057ecb7

Implemented vendor restocking with the mover. Comitting so I can always review this working version, but I?ll be disabling all part of it as it is not going to work properly without seriously compromising the code structure. Debug messages are now appended with ?Inventorium? (my MailOpener addon was making stuff difficult). Now properly removing the refill window from the displayed static popup windows list so new popups won?t be aligned at odd locations. Changed ?CreateMoverFrame? to not contain any scenario-specific info. All settings can be set with SetFrameSettings. Items that belong to speciality bags are now put there. Other items now ignore spaciality bags. Implemented test code for mailbox refill support. It has been disabled due to some issues but may be introduced later. The guild withdrawal limit is now taken into consideration. Queue is now reset before scanning again.
author Zerotorescue
date Fri, 14 Jan 2011 23:25:05 +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