comparison Modules/Tooltip.lua @ 135:a529a4a4ccbe

I removed the persistent queue (Ticket 33) It caused to many bugs and was blocking me from getting other things done. I think its something that will get implemented again once I figure out the best way to do it.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Sat, 02 Oct 2010 11:38:22 -0700
parents 7f81764aa03a
children
comparison
equal deleted inserted replaced
133:5eefa40e2a29 135:a529a4a4ccbe
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")
6 3
7 local function ShowTipWithPricing(tip, link, num) 4 local function ShowTipWithPricing(tip, link, num)
8 if (link == nil) then 5 if (link == nil) then
9 return; 6 return;
10 end
11 if not Crafting then
12 Crafting = ItemAuditor:GetModule("Crafting")
13 end 7 end
14 8
15 -- local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, _, _, _, _, itemVendorPrice = GetItemInfo (link); 9 -- local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, _, _, _, _, itemVendorPrice = GetItemInfo (link);
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?") 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?")
17 11
44 if groupName then 38 if groupName then
45 local threshold = QAAPI:GetGroupConfig(groupName) 39 local threshold = QAAPI:GetGroupConfig(groupName)
46 tip:AddDoubleLine("\124cffffffffIA: QA Threshold: ", ItemAuditor:FormatMoney(threshold)) 40 tip:AddDoubleLine("\124cffffffffIA: QA Threshold: ", ItemAuditor:FormatMoney(threshold))
47 show = true 41 show = true
48 end 42 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 43 end
78 44
79 if show then 45 if show then
80 tip:Show() 46 tip:Show()
81 end 47 end