Quantcast
WoWInterface - View Single Post - Hiding buffs/debuffs on target/focus frame
View Single Post
07-30-18, 04:37 PM   #13
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 403
You shouldn't mess with UIParent's OnUpdate script like Ammako pointed out. Try this:
Code:
TargetFrame:UnregisterEvent("UNIT_AURA")
FocusFrame:UnregisterEvent("UNIT_AURA")

hooksecurefunc("TargetFrame_UpdateAuras", function(frame)
    if frame ~= TargetFrame and frame ~= FocusFrame then return end

    local frameName = frame:GetName()

    for index = 1, MAX_TARGET_BUFFS do
        local buff = _G[frameName .. "Buff" .. index]
        if buff then
            buff:Hide()
        end
    end

    for index = 1, MAX_TARGET_DEBUFFS do
        local debuff = _G[frameName .. "Debuff" .. index]
        if debuff then
            debuff:Hide()
        end
    end
end)
  Reply With Quote