From 9e05354d0dd27516835a643e4ba44aefc2a50ca0 Mon Sep 17 00:00:00 2001 From: Scott Sibley Date: Wed, 27 Oct 2010 20:32:26 +0000 Subject: [PATCH] Hook GameTooltip:GetUnit() so later addons have something to go by. --- StarTip.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/StarTip.lua b/StarTip.lua index 3090126..dc6033c 100644 --- a/StarTip.lua +++ b/StarTip.lua @@ -488,8 +488,7 @@ function StarTip:OnEnable() self:RawHook(GameTooltip, "FadeOut", "GameTooltipFadeOut", true) self:RawHook(GameTooltip, "Hide", "GameTooltipHide", true) self:RawHook(GameTooltip, "Show", "GameTooltipShow", true) - self:SecureHook(GameTooltip, "AddDoubleLine", self.GameTooltipAddLine) - self:SecureHook(GameTooltip, "AddLine", self.GameTooltipAddLine) + self:RawHook(GameTooltip, "GetUnit", "GameTooltipGetUnit", true) for k,v in self:IterateModules() do if (self.db.profile.modules[k] == nil and not v.defaultOff) or self.db.profile.modules[k] then @@ -796,6 +795,15 @@ function StarTip:GameTooltipShow(...) end end +function StarTip:GameTooltipGetUnit() + if StarTip.unit and UnitExists(StarTip.unit) then + local name = UnitName(StarTip.unit) + return name, StarTip.unit + end + return self.hooks[GameTooltip].GetUnit(GameTooltip) +end + + function StarTip.OnTooltipShow(...) if not StarTip.justShow then -- 1.7.9.5