Red-out lines for recipes that require a rank we don't have yet
This commit is contained in:
parent
f39146ffb0
commit
ea530ec4da
|
@ -240,6 +240,13 @@ local function Knowable(link)
|
|||
end
|
||||
|
||||
|
||||
local function RecipeNeedsRank(link)
|
||||
local _, _, _, _, _, class = GetItemInfo(link)
|
||||
if class ~= RECIPE then return end
|
||||
return ns.unmet_requirements[link]
|
||||
end
|
||||
|
||||
|
||||
local default_grad = {0,1,0,0.75, 0,1,0,0} -- green
|
||||
local grads = setmetatable({
|
||||
red = {1,0,0,0.75, 1,0,0,0},
|
||||
|
@ -273,6 +280,9 @@ local function ShowMerchantItem(row, i)
|
|||
if ns.knowns[link] then
|
||||
color = quality_colors[0]
|
||||
row.backdrop:Hide()
|
||||
elseif RecipeNeedsRank(link) then
|
||||
row.backdrop:SetGradientAlpha("HORIZONTAL", unpack(grads.red))
|
||||
row.backdrop:Show()
|
||||
else
|
||||
row.backdrop:SetGradientAlpha("HORIZONTAL", unpack(grads[quality]))
|
||||
row.backdrop:Show()
|
||||
|
|
|
@ -26,3 +26,27 @@ ns.knowns = setmetatable({}, {
|
|||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
-- "Requires Previous Rank"
|
||||
local PREV_RANK = TOOLTIP_SUPERCEDING_SPELL_NOT_KNOWN
|
||||
local function NeedsRank(link)
|
||||
ns.scantip:SetHyperlink(link)
|
||||
for i=1,ns.scantip:NumLines() do
|
||||
print(ns.scantip.L[i], ns.scantip.L[i] == PREV_RANK)
|
||||
if ns.scantip.L[i] == PREV_RANK then return true end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
ns.unmet_requirements = setmetatable({}, {
|
||||
__index = function(t, i)
|
||||
local id = ns.ids[i]
|
||||
if not id then return end
|
||||
|
||||
if NeedsRank(i) then
|
||||
t[i] = true
|
||||
return true
|
||||
end
|
||||
end
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue