Also do the red highlight with normal items

This commit is contained in:
tekkub 2011-02-28 03:10:39 -07:00
parent 2a0ac57311
commit 38bc506411
1 changed files with 9 additions and 5 deletions

View File

@ -98,11 +98,15 @@ end
local function SetValue(self, text, icon, link) local function SetValue(self, text, icon, link)
local color = link and GetCurencyCount(link) >= text and "|cffffffff" or "|cffff9999" local color = ""
local id = link and link:match("item:(%d+)")
self.link, self.index, self.itemIndex = nil
if id then self.link = link end
if id and GetItemCount(id) < text or link and not id and GetCurencyCount(link) < text then
color = "|cffff9999"
end
self.text:SetText(color..text) self.text:SetText(color..text)
self.icon:SetTexture(icon) self.icon:SetTexture(icon)
self.link, self.index, self.itemIndex = nil
if link and link:match("^item:%d+") then self.link = link end
self:Show() self:Show()
end end
@ -139,8 +143,8 @@ local function AddAltCurrency(frame, i)
if ns.IHASCAT then itemCount, honorPoints, arenaPoints = honorPoints, 0, 0 end if ns.IHASCAT then itemCount, honorPoints, arenaPoints = honorPoints, 0, 0 end
for j=itemCount,1,-1 do for j=itemCount,1,-1 do
local f = frame:GetAltCurrencyFrame() local f = frame:GetAltCurrencyFrame()
local texture, price, _, name = GetMerchantItemCostItem(i, j) local texture, price, link, name = GetMerchantItemCostItem(i, j)
f:SetValue(price, texture, name) f:SetValue(price, texture, link or name)
f.index, f.itemIndex, f.link = i, j f.index, f.itemIndex, f.link = i, j
lastframe = f.text lastframe = f.text
end end