ascott18 / TellMeWhen

TellMeWhen is a combat tracking AddOn for World of Warcraft Retail and Classic
https://wow.curseforge.com/projects/tellmewhen
GNU General Public License v3.0
80 stars 11 forks source link

For Evoker: Track the current empower level of the spell #2021

Open Betaskill opened 1 year ago

Betaskill commented 1 year ago

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like

First of all thanks for the great addon and the time that is used for making it happen.

I would like to have a condition (or icon) where you can track the current empower level of the spell that is casting, with: make the icon visible if you are, like, at level 2 of the spell. So with the new class Evoker, like for example, the ppl are able to see it via a dogtag like "stacks" at which level their spell is at the moment or whatever they wanna use that information for.

Describe alternatives you've considered No that I can think of.

Is something like this possible?

Greetings

ascott18 commented 1 year ago

Added in b30b8cb

ascott18 commented 1 year ago

Blizzard... please...

Turns out UnitChannelInfo() returns nil when in the final stage of an empowered cast. I.. just... what...? So @arieh my clean solution doesn't work...

ascott18 commented 1 year ago

Logged https://github.com/Stanzilla/WoWUIBugs/issues/355

arieh commented 1 year ago

They really made such a bad implementation our of this new feature it's crazy.

EKE00372 commented 1 year ago

temp slove

local TMW = TMW
local CNDT = TMW.CNDT
local Env = CNDT.Env
local L = TMW.L

local DogTag = LibStub("LibDogTag-3.0")
local cache = {}
local GetEmpowerStageForCurrent = function()
    local unit = "player"
    local name, _, _, start, _, _, _, _, _, numStages = UnitChannelInfo(unit);
    if not numStages or numStages == 0 then
        if cache[unit] then
            if numStages == 0 then return 0 end
            needClear = false
            for i = #cache[unit], 1,-1 do

                if TMW.time > cache[unit][i] then

                    if i < #cache[unit] then
                        return #cache[unit] - 1
                    else
                        needClear = true
                        break  
                    end
                end
            end
            if needClear then cache[unit] = nil end
        end
        return 0
    end

    if not cache[unit]  then
        cache[unit] = {}
        local stageEnd = start
        for i = 1, numStages,1 do
            local duration = GetUnitEmpowerStageDuration(unit, i-1)
            stageEnd = stageEnd + duration
            cache[unit][i] = stageEnd/1000
        end
        cache[unit][numStages+1] = (stageEnd + GetUnitEmpowerHoldAtMaxTime(unit))/1000
    end
    for i = #cache[unit], 1,-1 do
        if TMW.time > cache[unit][i] then
            return i
        end

    end
    return 0

end

if DogTag.Tags.Unit.EmpowerStage then return end
DogTag:AddTag("Unit","EmpowerStage",{
        code = GetEmpowerStageForCurrent,
        arg = {
            'icon','string','@req', 
        },
        ret = "number",
        events =  "Update;UNIT_SPELLCAST_EMPOWER_START#player;UNIT_SPELLCAST_EMPOWER_UPDATE#player;UNIT_SPELLCAST_EMPOWER_STOP#player",
        noDoc = true,

})
ascott18 commented 1 year ago

Still broken in 10.0.5

ascott18 commented 11 months ago

Still broken in 10.1.5

Jack-Pettersson commented 6 months ago

Still broken in 10.2

Somebodyy commented 2 months ago

Has this been resolved yet?