Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mage Barier Fix(UnitBuff function deprecation) #119

Open
BerkOzdilek opened this issue Aug 25, 2024 · 0 comments
Open

Mage Barier Fix(UnitBuff function deprecation) #119

BerkOzdilek opened this issue Aug 25, 2024 · 0 comments

Comments

@BerkOzdilek
Copy link

BerkOzdilek commented Aug 25, 2024

Hey, first of all thanks for sharing your WA, really appreciated. I fixed some of the issues caused by the latest WoW API changes and wanted to share with you so that you can update if you wish. I cant open a PR so intead Im posting it here.

With 11.0.2, some of the WoW APIs are deprecated(here). UnitBuff function which was deprecated and replaced by C_UnitAuras.GetBuffDataByIndex function. This is used by the all of the mage barriers weak auras to show how many absorb left. (I find it super cool)
I replaced that function with the new one according to this doc

Sharing the new custom text function below

function()
    local abbr = ' '
    
    for i =1, 40 do
        local aura= C_UnitAuras.GetBuffDataByIndex("player",i)
        if aura and aura.spellId == 235450
        then
            local absb = aura.points[1]
            absb = absb / 1000
            abbr = string.format("%.1fk", absb)
        end
    end
    
    return abbr
end

The main diference is:
C_UnitAuras.GetBuffDataByIndex function returns a AuraData object. The points field is an array and consist the absorb amount as the first element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant