WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Disturbing SPELLS_CHANGED behavior (https://www.wowinterface.com/forums/showthread.php?t=18045)

BDelacroix 09-04-08 06:37 AM

Disturbing SPELLS_CHANGED behavior
 
Yes, another question.

I am reading this about the SPELLS_CHANGED event and find it disturbing (in bold).

Quote:

arg1
nil when the char learns stuff. Also when changing weapons and shapeshifting. In addition it seems to be called on regular intervals for no apparent reason.
Is this indeed the case? It would be nice to have a way to detect only in cases where the player learns a new spell. No biggie, I've worked around it as well.

Seerah 09-04-08 09:44 AM

You could see how LearningAid does it: http://www.wowinterface.com/download...arningAid.html

BDelacroix 09-04-08 04:21 PM

I've already have a work around but thanks. Maybe I'll look to see if its better.

Kith 09-04-08 07:09 PM

Thanks for posting this, i've never given things a long enough time to know that this event was firing 'randomly' so I would have missed this; my func that fires on the event isn't particuarly bulky but still any extra cpu usage is bad when unneeded.

LBXZero 09-05-08 04:50 AM

SPELLS_CHANGED is fired whenever UpdateSpells() is called, which is only used in the Spell Book frame. By my search of all files in FrameXML folder, the only frame that uses SPELLS_CHANGED is the spell book.

For the Spell Book, the SPELLS_CHANGED event causes the 12 buttons in the frame to update images and labels according to the current page. The buttons unregister the event when the spell book is closed. I believe SPELLS_CHANGED was tagged along with various other events and conditions so that the Spell Book will properly update if something occurred that would cause a glitch for the buttons if not updated.

Seeing this, it seems kind of wasteful on performance, but I know the spell book frame was not made for processing efficiency but easier coding. This is not an issue because the spell book should only be open to place spells in the action bar or inserted into macros.


All times are GMT -6. The time now is 08:12 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI