0
@@ -12,7 +12,7 @@ local frame
0
for i,t in pairs(CUTS) do for _,id in pairs(t) do GameTooltip:SetHyperlink("item:"..id) end end
0
-local
cutframes, knowncombines, frame = {}, {}
0
+local
rawframes, cutframes, knowncombines, frame = {}, {}, {}
0
function Panda:CreateCutGreenBluePanel()
0
local function SetupFrame(f, id, secure)
0
local name, link, _, _, _, _, _, _, _, texture = GetItemInfo(id)
0
@@ -33,6 +33,10 @@ function Panda:CreateCutGreenBluePanel()
0
local price = Panda:GetAHBuyout(id)
0
text:SetText(GS(price))
0
+ local count = f:CreateFontString(nil, "ARTWORK", "NumberFontNormalSmall")
0
+ count:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", -2, 2)
0
if secure and self.canJC then
0
f:SetAlpha(knowncombines[f.name] and 1 or 0.25)
0
f:SetAttribute("type", "macro")
0
@@ -55,6 +59,7 @@ function Panda:CreateCutGreenBluePanel()
0
lastframe = SetupFrame(f, rawid)
0
for j,id in ipairs(CUTS[rawid]) do
0
local f = CreateFrame("CheckButton", nil, frame, "SecureActionButtonTemplate")
0
@@ -73,6 +78,7 @@ function Panda:CreateCutGreenBluePanel()
0
lastframe = SetupFrame(f, rawid)
0
for j,id in ipairs(CUTS[rawid]) do
0
local f = CreateFrame("CheckButton", nil, frame, "SecureActionButtonTemplate")
0
@@ -108,7 +114,16 @@ function Panda:CreateCutGreenBluePanel()
0
b:SetAttribute("macrotext", "/run CloseTradeSkill()\n/cast Jewelcrafting\n/run CloseTradeSkill()")
0
- frame:SetScript("OnShow", function() OpenBackpack() end)
0
+ frame:SetScript("OnShow", function()
0
+ self:RegisterEvent("BAG_UPDATE", "GemCutBagUpdate")
0
+ self:GemCutBagUpdate()
0
+ frame:SetScript("OnHide", function() self:UnregisterEvent("BAG_UPDATE") end)
0
+ self:RegisterEvent("BAG_UPDATE", "GemCutBagUpdate")
0
+ self:GemCutBagUpdate()
0
self.CreateCutGreenBluePanel = nil -- Don't need this function anymore!
0
@@ -122,3 +137,16 @@ function Panda:TRADE_SKILL_SHOW()
0
for id,f in pairs(cutframes) do f:SetAlpha((not self.canJC or knowncombines[f.name]) and 1 or 0.25) end
0
+function Panda:GemCutBagUpdate()
0
+ for id,f in pairs(cutframes) do
0
+ local count = GetItemCount(id)
0
+ f.count:SetText(count > 0 and count or "")
0
+ for id,f in pairs(rawframes) do
0
+ local count = GetItemCount(id)
0
+ f.count:SetText(count > 0 and count or "")
Comments
No one has commented yet.