BigDebuffs

BigDebuffs

20M Downloads

Request to add a raid frame debuff extension

kmenethil opened this issue ยท 0 comments

commented

I want you to add an extension of the debuff of the raid frame.
If there are more debuffs, please add the function to extend up.
Send an addon. Add me up, please.

local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_LOGIN")
frame:SetScript("OnEvent", function()
hooksecurefunc("CompactUnitFrame_UpdateAuras", function(unitFrame)
local frameName = unitFrame:GetName()

    if not frameName or not frameName:match("^Compact") then
        return
    end

    CompactUnitFrame_SetMaxDebuffs(unitFrame, 12)

    for i = 4, 12 do
        if not unitFrame.debuffFrames[i] then
            unitFrame.debuffFrames[i] = CreateFrame("Button", frameName.."Debuff"..i, unitFrame, "CompactDebuffTemplate")
            unitFrame.debuffFrames[i].baseSize = 22
        end

        local firstDebuffFrame = unitFrame.debuffFrames[1]

        local width = firstDebuffFrame:GetWidth()
        if width then
            unitFrame.debuffFrames[i]:SetSize(width, width)
            unitFrame.debuffFrames[i]:ClearAllPoints()

            if i > 6 then
                unitFrame.debuffFrames[i]:SetPoint("BOTTOMRIGHT", unitFrame.debuffFrames[i-3], "TOPRIGHT", 0, 0)
            else
                unitFrame.debuffFrames[i]:SetPoint("TOPRIGHT", firstDebuffFrame, "TOPRIGHT", -(width * (i - 3)), 0)
            end
        end
    end
end)

end)