2009-08-15 19:42:06 -06:00
|
|
|
|
2010-05-02 16:20:55 -06:00
|
|
|
local myname, ns = ...
|
|
|
|
|
2009-08-15 19:42:06 -06:00
|
|
|
|
2016-09-06 19:59:24 -06:00
|
|
|
local function HasHeirloom(id)
|
|
|
|
return C_Heirloom.IsItemHeirloom(id) and C_Heirloom.PlayerHasHeirloom(id)
|
2009-08-15 19:42:06 -06:00
|
|
|
end
|
|
|
|
|
2015-01-26 02:26:17 -07:00
|
|
|
|
2016-09-06 19:59:24 -06:00
|
|
|
local function IsKnown(link)
|
|
|
|
ns.scantip:SetHyperlink(link)
|
|
|
|
for i=1,ns.scantip:NumLines() do
|
|
|
|
if ns.scantip.L[i] == ITEM_SPELL_KNOWN then return true end
|
2015-01-26 02:26:17 -07:00
|
|
|
end
|
2016-09-06 19:59:24 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
ns.knowns = setmetatable({}, {
|
|
|
|
__index = function(t, i)
|
|
|
|
local id = ns.ids[i]
|
|
|
|
if not id then return end
|
2015-01-26 02:26:17 -07:00
|
|
|
|
2016-09-06 19:59:24 -06:00
|
|
|
if HasHeirloom(id) or IsKnown(i) then
|
2009-08-15 19:42:06 -06:00
|
|
|
t[i] = true
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
2016-09-06 19:59:24 -06:00
|
|
|
})
|