Grey out known heirlooms on 6.1
This commit is contained in:
parent
340a2b2667
commit
7a9f2e658b
|
@ -246,13 +246,22 @@ local function ShowMerchantItem(row, i)
|
||||||
local link = GetMerchantItemLink(i)
|
local link = GetMerchantItemLink(i)
|
||||||
local color = quality_colors.default
|
local color = quality_colors.default
|
||||||
row.backdrop:Hide()
|
row.backdrop:Hide()
|
||||||
|
|
||||||
|
if not isUsable then
|
||||||
|
row.backdrop:SetGradientAlpha("HORIZONTAL", unpack(grads.red))
|
||||||
|
row.backdrop:Show()
|
||||||
|
end
|
||||||
|
|
||||||
if link then
|
if link then
|
||||||
local name, link2, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(link)
|
local name, link2, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(link)
|
||||||
|
local id = ns.ids[link]
|
||||||
|
local is_heirloom = ns.is_six_one and C_Heirloom.IsItemHeirloom(id)
|
||||||
color = quality_colors[quality]
|
color = quality_colors[quality]
|
||||||
|
|
||||||
if class == RECIPE or texture:lower():match(GARRISON_ICON) then
|
if is_heirloom or class == RECIPE or texture:lower():match(GARRISON_ICON) then
|
||||||
if ns.knowns[link] then
|
if ns.knowns[link] then
|
||||||
color = quality_colors[0]
|
color = quality_colors[0]
|
||||||
|
row.backdrop:Hide()
|
||||||
else
|
else
|
||||||
row.backdrop:SetGradientAlpha("HORIZONTAL", unpack(grads[quality]))
|
row.backdrop:SetGradientAlpha("HORIZONTAL", unpack(grads[quality]))
|
||||||
row.backdrop:Show()
|
row.backdrop:Show()
|
||||||
|
@ -260,11 +269,6 @@ local function ShowMerchantItem(row, i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not isUsable then
|
|
||||||
row.backdrop:SetGradientAlpha("HORIZONTAL", unpack(grads.red))
|
|
||||||
row.backdrop:Show()
|
|
||||||
end
|
|
||||||
|
|
||||||
row.icon:SetTexture(itemTexture)
|
row.icon:SetTexture(itemTexture)
|
||||||
row.ItemName:SetText((numAvailable > -1 and ("["..numAvailable.."] ") or "").. color.. (name or "<Loading item data>").. (itemStackCount > 1 and ("|r x"..itemStackCount) or ""))
|
row.ItemName:SetText((numAvailable > -1 and ("["..numAvailable.."] ") or "").. color.. (name or "<Loading item data>").. (itemStackCount > 1 and ("|r x"..itemStackCount) or ""))
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
## X-LoadOn-Merchant: true
|
## X-LoadOn-Merchant: true
|
||||||
## X-LoadOn-InterfaceOptions: GnomishVendorShrinker
|
## X-LoadOn-InterfaceOptions: GnomishVendorShrinker
|
||||||
|
|
||||||
|
externals\itemid.lua
|
||||||
|
externals\ptr.lua
|
||||||
|
|
||||||
tekFunks\gsc.lua
|
tekFunks\gsc.lua
|
||||||
tekKonfig\tekKonfig.xml
|
tekKonfig\tekKonfig.xml
|
||||||
LibItemSearch-1.0.lua
|
LibItemSearch-1.0.lua
|
||||||
|
|
|
@ -11,6 +11,16 @@ for i=1,40 do
|
||||||
end
|
end
|
||||||
|
|
||||||
ns.knowns = setmetatable({}, {__index = function(t, i)
|
ns.knowns = setmetatable({}, {__index = function(t, i)
|
||||||
|
if ns.is_six_one then
|
||||||
|
local id = ns.ids[i]
|
||||||
|
if not id then return end
|
||||||
|
|
||||||
|
if C_Heirloom.IsItemHeirloom(id) and C_Heirloom.PlayerHasHeirloom(id) then
|
||||||
|
t[i] = true
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
tip:ClearLines()
|
tip:ClearLines()
|
||||||
if not tip:IsOwned(WorldFrame) then tip:SetOwner(WorldFrame, "ANCHOR_NONE") end
|
if not tip:IsOwned(WorldFrame) then tip:SetOwner(WorldFrame, "ANCHOR_NONE") end
|
||||||
tip:SetHyperlink(i)
|
tip:SetHyperlink(i)
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
itemid.lua
|
||||||
|
ptr.lua
|
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
local myname, ns = ...
|
||||||
|
|
||||||
|
|
||||||
|
-- Creates a memoizing table that converts an itemlink string into an itemID int
|
||||||
|
ns.ids = setmetatable({}, {
|
||||||
|
__index = function(t,i)
|
||||||
|
if type(i) == "number" then
|
||||||
|
t[i] = i
|
||||||
|
return i
|
||||||
|
elseif type(i) ~= "string" then
|
||||||
|
t[i] = false
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local id = tonumber(i:match("item:(%d+)"))
|
||||||
|
t[i] = id
|
||||||
|
return id
|
||||||
|
end,
|
||||||
|
})
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
local myname, ns = ...
|
||||||
|
|
||||||
|
ns.is_six_one = GetBuildInfo() == "6.1.0"
|
Loading…
Reference in New Issue