Bugfix for ticket 4
Scott Sibley [09-25-10 - 21:04]
diff --git a/Modules/Fade.lua b/Modules/Fade.lua
index 1fe2d76..e1a6fce 100644
--- a/Modules/Fade.lua
+++ b/Modules/Fade.lua
@@ -107,10 +107,10 @@ local updateExistenceFrame = CreateFrame("Frame")
local updateAlphaFrame = CreateFrame("Frame")
local checkExistence = function()
- if not UnitExists("mouseover") then
+ if not UnitExists(StarTip.unit or "mouseover") then
updateExistenceFrame:SetScript("OnUpdate", nil)
local kind
- if GameTooltip:IsOwned(UIParent) then
+ if StarTip.unit == "mousever" then
kind = self.db.profile.units
else
kind = self.db.profile.unitFrames
@@ -141,7 +141,7 @@ local checkTooltipAlpha = function()
end
function mod:OnShow()
- if UnitExists("mouseover") then
+ if UnitExists(StarTip.unit or "mouseover") then
updateExistenceFrame:SetScript("OnUpdate", checkExistence)
else
updateAlphaFrame:SetScript("OnUpdate", checkTooltipAlpha)
diff --git a/StarTip.lua b/StarTip.lua
index 37ee56a..09c40ad 100644
--- a/StarTip.lua
+++ b/StarTip.lua
@@ -636,7 +636,7 @@ end
local hideTimer
local function hideTooltip()
- if StarTip.unit ~= "mouseover" and (GetMouseFocus() == UIParent or GetMouseFocus() == WorldFrame) then GameTooltip:Hide(); StarTip.unit = nil; return end
+ if StarTip.unit ~= "mouseover" and GetMouseFocus() == WorldFrame then StarTip.unit = nil; return end
hideTimer:Start()
end
@@ -654,12 +654,12 @@ function StarTip.OnTooltipSetUnit(...)
hideTimer = hideTimer or LibTimer:New("StarTip.Hide", 100, false, hideTooltip, nil, StarTip.db.profile.errorLevel)
hideTimer:Start()
+
throttleTimer = throttleTimer or LibTimer:New("StarTip.Throttle", StarTip.db.profile.throttleVal, false, endThrottle, nil, StarTip.db.profile.errorLevel)
if GetTime() < lastTime + StarTip.db.profile.throttleVal and UnitIsPlayer("mouseover") and StarTip.db.profile.throttleVal > 0 then
- hideTimer:Start()
throttleTimer:Start();
GameTooltip:Hide()
- return ...
+ return
end
lastTime = GetTime()
@@ -745,6 +745,8 @@ function StarTip:OnTooltipHide(...)
end
self.justHide = nil
self.unit = false
+ if hideTimer then hideTimer:Stop() end
+ if throttleTimer then throttleTimer:Stop() end
return self.hooks[GameTooltip].OnHide(...)
end