From c50af0e264988883748286515218b63adcd0873d Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 16 Jun 2018 19:34:52 +0200 Subject: [PATCH] unusable: clear tooltip color before scanning next --- modules/unusable.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/unusable.lua b/modules/unusable.lua index 7f067566..388c080d 100644 --- a/modules/unusable.lua +++ b/modules/unusable.lua @@ -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