public
Description: WoW Addon - Prospecting and Disenchanting Aide
Homepage: http://www.tekkub.net
Clone URL: git://github.com/tekkub/panda.git
Click here to lend your support to: panda and make a donation at www.pledgie.com !
Added click-prospecting and prospect counts to the prospecting panel
tekkub (author)
Sat Jan 12 14:38:57 -0800 2008
commit  6f1bbc23ef2feef8d5c114eb955d91bb55a3be10
tree    dcdf2767162eba809fc9cece62c26ed71dd74f16
parent  a62d5795320435610d3489fb2af9ecc165981f98
...
216
217
218
219
 
220
221
222
223
 
224
225
226
...
216
217
218
 
219
220
221
222
 
223
224
225
226
0
@@ -216,11 +216,11 @@ function Panda:CreateDisenchantingPanel()
0
   end
0
 
0
   self:RegisterEvent("BAG_UPDATE", "DisenchantBagUpdate")
0
- self:DisenchantBagUpdate(self)
0
+ self:DisenchantBagUpdate()
0
 
0
   frame:SetScript("OnShow", function()
0
     self:RegisterEvent("BAG_UPDATE", "DisenchantBagUpdate")
0
- self:DisenchantBagUpdate(self)
0
+ self:DisenchantBagUpdate()
0
   end)
0
   frame:SetScript("OnHide", function() self:UnregisterEvent("BAG_UPDATE") end)
0
 
...
23
24
25
26
 
27
28
29
30
31
 
...
23
24
25
 
26
27
28
29
30
31
32
0
@@ -23,9 +23,10 @@ function Panda:Enable()
0
   repeat
0
     spellname = GetSpellName(i, BOOKTYPE_SPELL)
0
     if spellname == "Disenchant" then self.canDisenchant = true end
0
- if spellname == "Prospect" then self.canProspect = true end
0
+ if spellname == "Prospecting" then self.canProspect = true end
0
     i = i + 1
0
   until (self.canDisenchant and self.canProspect) or not spellname
0
 
0
   self:RegisterEvent("ADDON_LOADED")
0
 end
0
+
...
12
13
14
 
15
16
 
17
18
19
...
55
56
57
58
59
60
61
...
63
64
65
66
67
 
 
68
69
70
71
 
 
 
 
72
 
73
74
75
...
114
115
116
117
118
 
 
119
120
121
122
123
124
 
 
 
 
 
125
126
127
128
129
 
 
 
 
 
 
 
...
12
13
14
15
16
 
17
18
19
20
...
56
57
58
 
59
60
61
...
63
64
65
 
 
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
...
119
120
121
 
 
122
123
124
 
 
 
 
 
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
0
@@ -12,8 +12,9 @@ local function cfs(frame, a1, a2, a3, ...)
0
 end
0
 
0
 
0
+local frame
0
 function Panda:CreateProspectingPanel()
0
- local frame = CreateFrame("Frame", nil, UIParent)
0
+ frame = CreateFrame("Frame", nil, UIParent)
0
 --~   frame:SetWidth(630)
0
 --~   frame:SetHeight(305)
0
 --~   frame:SetPoint("TOPLEFT", 190, -103)
0
@@ -55,7 +56,6 @@ function Panda:CreateProspectingPanel()
0
     f:SetWidth(BUTTON_WIDTH)
0
     f:SetScript("OnEnter", ShowItemDetails)
0
     f:SetScript("OnLeave", HideItemDetails)
0
- if self.canDisenchant then f:SetAttribute("type", "macro") end
0
 
0
     f.icon = f:CreateTexture(nil, "ARTWORK")
0
     f.icon:SetPoint("TOPLEFT")
0
@@ -63,13 +63,18 @@ function Panda:CreateProspectingPanel()
0
     f.icon:SetHeight(ICONSIZE)
0
 
0
     f.name = cfs(f, nil, "ARTWORK", "GameFontHighlightSmall", "TOPLEFT", f.icon, "TOPRIGHT", 5, 0)
0
- f.type = cfs(f, nil, "ARTWORK", "GameFontHighlightSmall", "TOPLEFT", f.icon, "TOPRIGHT", 5, -12)
0
- f.bind = cfs(f, nil, "ARTWORK", "GameFontHighlightSmall", "TOPRIGHT", f, "TOPRIGHT", -5, -12)
0
+ f.count = cfs(f, nil, "ARTWORK", "GameFontHighlightSmall", "TOPLEFT", f.icon, "TOPRIGHT", 5, -12)
0
+--~ f.bind = cfs(f, nil, "ARTWORK", "GameFontHighlightSmall", "TOPRIGHT", f, "TOPRIGHT", -5, -12)
0
 
0
     local name, _, _, itemLevel, _, itemType, itemSubType, _, _, texture = GetItemInfo(id)
0
     f.name:SetText(name)
0
     f.icon:SetTexture(texture)
0
+ if self.canProspect and name then
0
+ f:SetAttribute("type", "macro")
0
+ f:SetAttribute("macrotext", "/cast Prospecting\n/use ".. name)
0
+ end
0
 
0
+ f.id = id
0
     frame.lines[i] = f
0
   end
0
 
0
@@ -114,16 +119,23 @@ function Panda:CreateProspectingPanel()
0
 --~     frame.blues[i]:SetText(link)
0
 --~   end
0
 
0
---~ self:RegisterEvent("BAG_UPDATE", "DisenchantBagUpdate")
0
---~ self:DisenchantBagUpdate(self)
0
+ self:RegisterEvent("BAG_UPDATE", "ProspectingBagUpdate")
0
+ self:ProspectingBagUpdate()
0
 
0
---~ frame:SetScript("OnShow", function()
0
---~ self:RegisterEvent("BAG_UPDATE", "DisenchantBagUpdate")
0
---~ self:DisenchantBagUpdate(self)
0
---~ end)
0
---~ frame:SetScript("OnHide", function() self:UnregisterEvent("BAG_UPDATE") end)
0
+ frame:SetScript("OnShow", function()
0
+ self:RegisterEvent("BAG_UPDATE", "ProspectingBagUpdate")
0
+ self:ProspectingBagUpdate()
0
+ end)
0
+ frame:SetScript("OnHide", function() self:UnregisterEvent("BAG_UPDATE") end)
0
 
0
   return frame
0
 end
0
 
0
 
0
+function Panda:ProspectingBagUpdate()
0
+ if not frame then return end
0
+
0
+ for i,f in pairs(frame.lines) do
0
+ f.count:SetText(((GetItemCount(f.id) or 0)/5).." prospects")
0
+ end
0
+end

Comments

    No one has commented yet.