0
@@ -12,8 +12,9 @@ local function cfs(frame, a1, a2, a3, ...)
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
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
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
local name, _, _, itemLevel, _, itemType, itemSubType, _, _, texture = GetItemInfo(id)
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
@@ -114,16 +119,23 @@ function Panda:CreateProspectingPanel()
0
--~ frame.blues[i]:SetText(link)
0
---~ self:RegisterEvent("BAG_UPDATE", "DisenchantBagUpdate")
0
---~ self:DisenchantBagUpdate(self)
0
+ self:RegisterEvent("BAG_UPDATE", "ProspectingBagUpdate")
0
+ self:ProspectingBagUpdate()
0
---~ frame:SetScript("OnShow", function()
0
---~ self:RegisterEvent("BAG_UPDATE", "DisenchantBagUpdate")
0
---~ self:DisenchantBagUpdate(self)
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
+ frame:SetScript("OnHide", function() self:UnregisterEvent("BAG_UPDATE") end)
0
+function Panda:ProspectingBagUpdate()
0
+ if not frame then return end
0
+ for i,f in pairs(frame.lines) do
0
+ f.count:SetText(((GetItemCount(f.id) or 0)/5).." prospects")
Comments
No one has commented yet.