lithammer / nSpellTracker

Simple buff, debuff and cooldown tracking based on rFilter3 by Zork
1 stars 2 forks source link

Tracking Totems #4

Open Technojo01 opened 7 years ago

Technojo01 commented 7 years ago

Hello! I hope you don't mind me using this addon since I am running with NeavUI and this is a perfect match for style. Anyways, I was looking to track my totems' cooldown. Is it possible? If yes, I would be grateful if you could give me an example! Thanks.

lithammer commented 7 years ago

Of course not! 🙂 I published it here after all. I will dust off my shaman when I get some time over.

Technojo01 commented 7 years ago

Cool! Hopefully, there is a way to make this possible since I think you need to use GetTotemInfo API to get totems' info...

Update : I was able to get the totem cooldown with this :

-- Healing Stream Totem addon:Cooldown(5394, { spec = restoration, position = {'CENTER', 'UIParent', 'CENTER', 100, -42}, verifySpell = true, isMine = true, hideOutOfCombat = false })

but what I am looking for is the duration of the effect (healing), like a buff. Maybe I'm just not using the right spell ID...

Technojo01 commented 7 years ago

I think this is the spell effect ID that I need to track : 52042 but still not able to make it appear as a buff or cooldown...

lithammer commented 6 years ago

So it seems like you managed to get the cooldown working, good. So the actual healing timer is a bit trickier since there's no actual buff (at least not that I could find). Which means I had to hook into GetTotemInfo() like you mentioned. I managed to get something working at least:

addon:Buff(5394, {
    spec = restoration,
    position = {'CENTER', 'UIParent', 'CENTER', -210, -52},
    PostUpdateHook = function(self)
        local haveTotem, name, startTime, duration, icon = GetTotemInfo(1)
        if haveTotem and name == 'Healing Stream Totem' then
            local timeLeft = Round(startTime + duration - GetTime())
            if timeLeft > 0 then
                self.Icon:SetAlpha(1)
                self.Icon.Duration:SetText(timeLeft)
            end
        end
    end
})

I didn't test it for very long, so there might bugs or other oddities. But give it a try!

Technojo01 commented 6 years ago

Good stuff, tyvm !!