DestroyTotem() is now protected
chiel opened this issue ยท 4 comments
Hello,
Was playing around with the totem element yesterday on my shaman and it all worked well, until I tried clicking the icon. Blizzard made DestroyTotem() protected so that can no longer be used.
I did some googling and I think there's a workaround with faking a rightbutton mouse click on the corresponding TotemFrame icon. I had to go to bed so that's all I have for now but I might have some time to look into it a bit more tonight.
The call to DestroyTotem should just be removed from oUF, as the function can only be called from Blizzard code. The only way for addons to destroy totems is by using a secure actionbutton with a macrotext attribute that /clicks the appropriate Blizzard totem button. However, since oUF hides the Blizzard totem buttons and unregisters all events from them, they never get updated with the necessary values for this to work.
Also, using secure buttons for temporary things like totem timers is problematic, as most layouts will likely wish to hide them when no totem is active, and implementing this securely -- if it's even possible, and I'm not sure it is -- is more work than should need to be done in a layout.
Probably best just to drop this feature entirely, or petition Blizzard to make DestroyTotem callable by addons but require a hardware event.
Pretty sure I'm the reason it's protected anyway, for writing TotemicDestruction...
Yeah I did some reading about it back then and it was to do with arena macros or so, as far as I could tell. I don't really mind too much.
Just means we have to make the buttons secure to have them work like normal.
I'll take a look at it later and push a patch for haste.