unusable: clear tooltip color before scanning next

This commit is contained in:
shagu
2018-06-16 19:34:52 +02:00
parent 79072ec75d
commit c50af0e264
+9 -2
View File
@@ -1,6 +1,7 @@
pfUI:RegisterModule("unusable", function ()
pfUI.unusable = CreateFrame("Frame", "pfUnusable", UIParent)
pfUI.unusable.tooltip = CreateFrame("GameTooltip", "pfUnusableTooltip", UIParent, "GameTooltipTemplate")
pfUI.unusable.tooltip:SetOwner(UIParent, "ANCHOR_NONE")
pfUI.unusable:RegisterEvent("MAIL_INBOX_UPDATE")
pfUI.unusable:RegisterEvent("PLAYER_LEVEL_UP")
@@ -56,11 +57,17 @@ pfUI:RegisterModule("unusable", function ()
local name, itemLink, _, minLevel = GetItemInfo(item)
if minLevel and minLevel > UnitLevel("player") then
return false
return false
end
end
for id = 0, 8 do
for _, v in pairs({"TextRight", "TextLeft"}) do
local widget = _G["pfUnusableTooltip"..v..id]
if widget then widget:SetTextColor(1,1,1,1) end
end
end
self.tooltip:SetOwner(UIParent, "ANCHOR_NONE")
if bag == -1 then
self.tooltip:SetInventoryItem("player", slot + 39)
elseif bag == "MailBox" then