Quantcast

Add support for buff/debuff on raid frames

James Whitehead II [11-22-10 - 10:05]
Add support for buff/debuff on raid frames
Filename
BlizzardFrames.lua
diff --git a/BlizzardFrames.lua b/BlizzardFrames.lua
index ca35488..531e249 100644
--- a/BlizzardFrames.lua
+++ b/BlizzardFrames.lua
@@ -10,7 +10,7 @@
 -------------------------------------------------------------------------]]--

 local addonName, addon = ...
-local L = addon.L
+local L = addon.L

 --[[---------------------------------------------------------------------------
 --  Options panel definition
@@ -47,7 +47,7 @@ end

 function panel:CreateOptions()
     panel.initialized = true
-
+
     local bits = {}
     self.intro = make_label("Intro", "GameFontHighlightSmall")
     self.intro:SetText(L["These options control whether or not Clique automatically registers certain Blizzard-created frames for binding. Changes made to these settings will not take effect until the user interface is reloaded."])
@@ -129,7 +129,7 @@ end
 InterfaceOptions_AddCategory(panel, addon.optpanels.ABOUT)

 --[[---------------------------------------------------------------------------
---  Blizzard Frame integration code
+--  Blizzard Frame integration code
 ---------------------------------------------------------------------------]]--
 local function enable(frame)
     if type(frame) == "string" then
@@ -151,6 +151,16 @@ function addon:Enable_BlizzCompactUnitFrames()
     end

     hooksecurefunc("CompactUnitFrame_SetUpFrame", function(frame, ...)
+        local name = frame and frame.GetName and frame:GetName()
+        for i = 1, 3 do
+            local buff = _G[name .. "Buff" .. i]
+            local debuff = _G[name .. "Debuff" .. i]
+            local dispel = _G[name .. "DispelDebuff" .. i]
+
+            if buff then enable(buff) end
+            if debuff then enable(debuff) end
+            if dispel then enable(dispel) end
+        end
         enable(frame)
     end)
 end
@@ -216,48 +226,63 @@ function addon:Enable_BlizzCompactParty()
     end

     local frames = {
-        --"CompactPartyFrameMemberSelf",
-        --"CompactPartyFrameMemberSelfBuff1",
-        --"CompactPartyFrameMemberSelfBuff2",
-        --"CompactPartyFrameMemberSelfBuff3",
-        --"CompactPartyFrameMemberSelfDebuff1",
-        --"CompactPartyFrameMemberSelfDebuff2",
-        --"CompactPartyFrameMemberSelfDebuff3",
-        "CompactPartyFrameMember1",
-        "CompactPartyFrameMember1Buff1",
-        "CompactPartyFrameMember1Buff2",
-        "CompactPartyFrameMember1Buff3",
-        "CompactPartyFrameMember1Debuff1",
-        "CompactPartyFrameMember1Debuff2",
-        "CompactPartyFrameMember1Debuff3",
-        "CompactPartyFrameMember2",
-        "CompactPartyFrameMember2Buff1",
-        "CompactPartyFrameMember2Buff2",
-        "CompactPartyFrameMember2Buff3",
-        "CompactPartyFrameMember2Debuff1",
-        "CompactPartyFrameMember2Debuff2",
-        "CompactPartyFrameMember2Debuff3",
-        "CompactPartyFrameMember3",
-        "CompactPartyFrameMember3Buff1",
-        "CompactPartyFrameMember3Buff2",
-        "CompactPartyFrameMember3Buff3",
-        "CompactPartyFrameMember3Debuff1",
-        "CompactPartyFrameMember3Debuff2",
-        "CompactPartyFrameMember3Debuff3",
-        "CompactPartyFrameMember4",
-        "CompactPartyFrameMember4Buff1",
-        "CompactPartyFrameMember4Buff2",
-        "CompactPartyFrameMember4Buff3",
-        "CompactPartyFrameMember4Debuff1",
-        "CompactPartyFrameMember4Debuff2",
-        "CompactPartyFrameMember4Debuff3",
-        "CompactPartyFrameMember5",
-        "CompactPartyFrameMember5Buff1",
-        "CompactPartyFrameMember5Buff2",
-        "CompactPartyFrameMember5Buff3",
-        "CompactPartyFrameMember5Debuff1",
-        "CompactPartyFrameMember5Debuff2",
-        "CompactPartyFrameMember5Debuff3",
+        --"CompactPartyFrameMemberSelf",
+        --"CompactPartyFrameMemberSelfBuff1",
+        --"CompactPartyFrameMemberSelfBuff2",
+        --"CompactPartyFrameMemberSelfBuff3",
+        --"CompactPartyFrameMemberSelfDebuff1",
+        --"CompactPartyFrameMemberSelfDebuff2",
+        --"CompactPartyFrameMemberSelfDebuff3",
+        "CompactPartyFrameMember1",
+        "CompactPartyFrameMember1Buff1",
+        "CompactPartyFrameMember1Buff2",
+        "CompactPartyFrameMember1Buff3",
+        "CompactPartyFrameMember1Debuff1",
+        "CompactPartyFrameMember1Debuff2",
+        "CompactPartyFrameMember1Debuff3",
+        "CompactPartyFrameMember1DispelDebuff1",
+        "CompactPartyFrameMember1DispelDebuff2",
+        "CompactPartyFrameMember1DispelDebuff2",
+        "CompactPartyFrameMember2",
+        "CompactPartyFrameMember2Buff1",
+        "CompactPartyFrameMember2Buff2",
+        "CompactPartyFrameMember2Buff3",
+        "CompactPartyFrameMember2Debuff1",
+        "CompactPartyFrameMember2Debuff2",
+        "CompactPartyFrameMember2Debuff3",
+        "CompactPartyFrameMember2DispelDebuff1",
+        "CompactPartyFrameMember2DispelDebuff2",
+        "CompactPartyFrameMember2DispelDebuff2",
+        "CompactPartyFrameMember3",
+        "CompactPartyFrameMember3Buff1",
+        "CompactPartyFrameMember3Buff2",
+        "CompactPartyFrameMember3Buff3",
+        "CompactPartyFrameMember3Debuff1",
+        "CompactPartyFrameMember3Debuff2",
+        "CompactPartyFrameMember3Debuff3",
+        "CompactPartyFrameMember3DispelDebuff1",
+        "CompactPartyFrameMember3DispelDebuff2",
+        "CompactPartyFrameMember3DispelDebuff2",
+        "CompactPartyFrameMember4",
+        "CompactPartyFrameMember4Buff1",
+        "CompactPartyFrameMember4Buff2",
+        "CompactPartyFrameMember4Buff3",
+        "CompactPartyFrameMember4Debuff1",
+        "CompactPartyFrameMember4Debuff2",
+        "CompactPartyFrameMember4Debuff3",
+        "CompactPartyFrameMember4DispelDebuff1",
+        "CompactPartyFrameMember4DispelDebuff2",
+        "CompactPartyFrameMember4DispelDebuff2",
+        "CompactPartyFrameMember5",
+        "CompactPartyFrameMember5Buff1",
+        "CompactPartyFrameMember5Buff2",
+        "CompactPartyFrameMember5Buff3",
+        "CompactPartyFrameMember5Debuff1",
+        "CompactPartyFrameMember5Debuff2",
+        "CompactPartyFrameMember5Debuff3",
+        "CompactPartyFrameMember5DispelDebuff1",
+        "CompactPartyFrameMember5DispelDebuff2",
+        "CompactPartyFrameMember5DispelDebuff2",
         "CompactPartyFramePet1",
         "CompactPartyFramePet2",
         "CompactPartyFramePet3",