comparison Modules/Tooltip.lua @ 128:451d8a19edea

Ticket 33 - Implemented a persistent queue. This allows the crafting queue to be seen even if your tradeskills aren't open and allows you to mix all of your tradeskills into a single queue.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Thu, 02 Sep 2010 23:59:09 -0700
parents 79dc87430cb3
children 7f81764aa03a
comparison
equal deleted inserted replaced
127:4f26dc55455d 128:451d8a19edea
1 local ItemAuditor = select(2, ...) 1 local ItemAuditor = select(2, ...)
2 local Tooltip = ItemAuditor:NewModule("Tooltip") 2 local Tooltip = ItemAuditor:NewModule("Tooltip")
3
4 local Crafting
5 local Utils = ItemAuditor:GetModule("Utils")
3 6
4 local function ShowTipWithPricing(tip, link, num) 7 local function ShowTipWithPricing(tip, link, num)
5 if (link == nil) then 8 if (link == nil) then
6 return; 9 return;
10 end
11 if not Crafting then
12 Crafting = ItemAuditor:GetModule("Crafting")
7 end 13 end
8 14
9 -- local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, _, _, _, _, itemVendorPrice = GetItemInfo (link); 15 -- local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, _, _, _, _, itemVendorPrice = GetItemInfo (link);
10 -- local _, _, Color, Ltype, Id, Enchant, Gem1, Gem2, Gem3, Gem4, Suffix, Unique, LinkLvl, Name = string.find(link, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?") 16 -- local _, _, Color, Ltype, Id, Enchant, Gem1, Gem2, Gem3, Gem4, Suffix, Unique, LinkLvl, Name = string.find(link, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
11 17
39 local threshold = QAAPI:GetGroupConfig(groupName) 45 local threshold = QAAPI:GetGroupConfig(groupName)
40 tip:AddDoubleLine("\124cffffffffIA: QA Threshold: ", ItemAuditor:FormatMoney(threshold)) 46 tip:AddDoubleLine("\124cffffffffIA: QA Threshold: ", ItemAuditor:FormatMoney(threshold))
41 show = true 47 show = true
42 end 48 end
43 end 49 end
50
51
52 shoppingList = Crafting.GetShoppingList(Utils.GetItemID(link))
53 if shoppingList then
54 tip:AddDoubleLine("\124cffffffffIA Queue", "\124cffffffffhave/total")
55 for character, recipes in pairs(shoppingList.characters) do
56 local count = 0
57 local need = 0
58 local color = '\124cff00ff00' -- green
59 for link, data in pairs(recipes) do
60 need = need + data.need
61 count = count + data.count
62 end
63 if need > 0 then
64 color = '\124cffff0000' -- red
65 end
66 tip:AddDoubleLine("\124cffffffff"..character, format("%s%s/%s", color, count-need, count))
67 if true then -- show details
68 for link, data in pairs(recipes) do
69 if data.need > 0 then
70 tip:AddDoubleLine("\124cffffffff"..link, format("\124cffffffff%s/%s", data.count-data.need, data.count))
71 end
72 end
73 end
74
75 end
76 show = true
77 end
44 78
45 if show then 79 if show then
46 tip:Show() 80 tip:Show()
47 end 81 end
48 end 82 end