Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Tracking Totems #4

Open
Technojo01 opened this issue Nov 6, 2017 · 5 comments
Open

Tracking Totems #4

Technojo01 opened this issue Nov 6, 2017 · 5 comments

Comments

@Technojo01
Copy link

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
Copy link
Owner

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

@Technojo01
Copy link
Author

Technojo01 commented Nov 6, 2017

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
Copy link
Author

Technojo01 commented Nov 6, 2017

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
Copy link
Owner

lithammer commented Nov 15, 2017

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
Copy link
Author

Good stuff, tyvm !!

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

No branches or pull requests

2 participants