From 10104c0e5f78a0a46bb29eb5379102fbaa329667 Mon Sep 17 00:00:00 2001 From: Scott Sibley Date: Mon, 25 Jul 2011 22:05:44 -0500 Subject: [PATCH] Bug fix... Maybe. When mousing away from a unit frame, and passing over a world unit, then mousing over other frames, sometimes StarTip.tooltipMain would stay shown. Ugly fix. --- Modules/Fade/Fade.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Modules/Fade/Fade.lua b/Modules/Fade/Fade.lua index 0246442..02a0882 100644 --- a/Modules/Fade/Fade.lua +++ b/Modules/Fade/Fade.lua @@ -71,6 +71,7 @@ local options = { function mod:OnInitialize() self.db = StarTip.db:RegisterNamespace(self:GetName(), defaults) StarTip:SetOptionsDisabled(options, true) + self:SecureHook("GameTooltip_SetDefaultAnchor") end function mod:OnEnable() @@ -85,15 +86,21 @@ function mod:GetOptions() return options end +function mod:GameTooltip_SetDefaultAnchor(this, owner) + if owner ~= UIParent and mod.isUnit then -- This is terrible. Fixes a bug, but it likely introduces another bug related to passing over unit frames. Didn't seem to bother anything in a BG test. + StarTip.tooltipMain:Hide() + end +end + -- CowTip's solution below local updateExistenceFrame = CreateFrame("Frame") local updateAlphaFrame = CreateFrame("Frame") local checkExistence = function() - if not UnitExists(StarTip.unit or "mouseover") and mod.isUnit then + if not UnitExists(StarTip.unit) and mod.isUnit then updateExistenceFrame:SetScript("OnUpdate", nil) local kind - if StarTip.unit == "mousever" then + if GameTooltip:GetOwner() == UIParent then kind = self.db.profile.units else kind = self.db.profile.unitFrames @@ -201,7 +208,7 @@ end function mod:SetItem() self.isUnit = false - updateExistenceFrame:SetScript("OnUpdate", checkExistence) + updateExistenceFrame:SetScript("OnUpdate", nil) end function mod:SetSpell() -- 1.7.9.5