changeset 13:be6c10697c59

tooltips on my debuffs too
author Chris Mellon <arkanes@gmai.com>
date Wed, 13 Oct 2010 11:29:56 -0500
parents 5f07c89cb6af
children 1cee96433b0f
files KBF.lua
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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