# HG changeset patch # User Chris Mellon # Date 1286987396 18000 # Node ID be6c10697c5969d5ca7793cf560918a66fd8cbbe # Parent 5f07c89cb6af559498903a3a4712ea3259baa428 tooltips on my debuffs too diff -r 5f07c89cb6af -r be6c10697c59 KBF.lua --- a/KBF.lua Wed Oct 13 11:11:13 2010 -0500 +++ b/KBF.lua Wed Oct 13 11:29:56 2010 -0500 @@ -82,12 +82,20 @@ -- position it under all the buffs, with a half-bar spacing frame:SetPoint("TOP", self.anchor, "BOTTOM", 0, (buffCount * -16) - 8) frame:Show() + frame:SetID(idx) + frame.filter = "HARMFUL" + frame.unit = unit + frame:SetScript("OnEnter", function() kbf:OnEnter(frame) end) + frame:SetScript("OnLeave", function() GameTooltip:Hide() end) buffCount = buffCount + 1 else -- not dirty, so no frame means we're done if not frame then break end end self:UpdateBarExpirationTime(frame) + if ( GameTooltip:IsOwned(frame) ) then + GameTooltip:SetUnitAura(unit, idx, "HARMFUL"); + end end self.dirty = nil end @@ -162,10 +170,11 @@ function KBF:OnEnter(button, motion) -- this is for the secure buttons, so use the attributes -- I'd like a better place to position this but it's funky for right now, handle it later + local unit = button.unit or button:GetAttribute("unit") + local filter = button.filter or button:GetAttribute("filter") GameTooltip:SetOwner(button, "ANCHOR_BOTTOMLEFT"); - GameTooltip:SetFrameLevel(button:GetFrameLevel() + 2); - GameTooltip:SetUnitAura(button:GetAttribute("unit"), button:GetID(), button:GetAttribute("filter")); - + GameTooltip:SetFrameLevel(button:GetFrameLevel() + 2); + GameTooltip:SetUnitAura(unit, button:GetID(), filter); end -- creates a icon + statusbar bar