Fixes a bug where the add-on looks at the wrong line in the tooltip for the text "Already known", so it did not properly dim selections that you already know.
The previous patch looked at line 5, instead of the original 3. I found out that the Stormwind Cooking Recipe vendor has the text on line 4, so I rewrote the fix to scan each line of the tooltip. This is that rewrite of the fix.
Just extract the VendorBuy.lua file from the zip file, then copy it over the existing VendorBuy.lua file (mine was located in "C:\Users\Public\Games\World of Warcraft\Interface\AddOns\VendorBuy").
---
Using the Dalaran Jewelcrafter vendor Timothy Jones, Vendor Buy does not work, and recipes that I already known are not dimmed.
If I modify the following code, starting at line 174...
Code:
if(itemType=="Recipe")then
VendorBuyTooltip:ClearLines();
VendorBuyTooltip:SetHyperlink(GetMerchantItemLink(index));
local a,b,c = _G["VendorBuyTooltipTextLeft3"]:GetTextColor();
local text = _G["VendorBuyTooltipTextLeft3"]:GetText();
if ((text=="Already known")and((a>b)and(b==c))) then
item:SetAlpha(0.5);
end
end
to this...
Code:
if(itemType=="Recipe")then
VendorBuyTooltip:ClearLines();
VendorBuyTooltip:SetHyperlink(GetMerchantItemLink(index));
-- Below code is a fix for 'Already known' appearing on different lines, depending on which vendor
for i = 1, VendorBuyTooltip:NumLines() do
local text = _G["VendorBuyTooltipTextLeft"..i]:GetText();
if(text)then
local a,b,c = _G["VendorBuyTooltipTextLeft"..i]:GetTextColor();
if ((text=="Already known")and((a>b)and(b==c))) then
item:SetAlpha(0.5);
end
end
end
-- Above code is a fix for 'Already known' appearing on different lines, depending on which vendor
end
it works fine. Seems the "Already known" text appears on different lines in a tooltip, depending on which vendor displays the tooltip.
For example, the Dalaran JC vendor the 'Already known' text shows on line 5, and the Stormwind Cooking Vendor line 4.