Spell power increase message and animation
Hello,
I created this script for display a message whenever spell power get increased. I'd like to make the animation repeat only once. Are there better methods than the ones I'm using? What about spell power 'ping'? Lua Code:
|
This seems to work. I changed it to initialize on PLAYER_LOGIN and listen for SPELL_POWER_CHANGED. Many character-related data functions don't return meaningful values on load and require initial data from the server. This is what PLAYER_LOGIN signifies. Blizzard's PaperDollFrame reacts to PLAYER_DAMAGE_DONE_MODS along with a handful of others. As these events tend to fire in rapid bursts, Blizzard opts to hand the events off to an OnUpdate script in order to consolidate these bursts into a single update call for performance reasons. This code doesn't do any significant processing, so it isn't really a problem for us.
I utilize the AnimationGroup's OnPlay and OnFinished scripts to trigger show/hide. It may not be necessary. I didn't find documentation on AlphaAnimation:SetChange() existing. It may be a depreciated function. :SetFromAlpha() and :SetToAlpha() work fine. I added a short fade in animation to smooth out the effect. This also uses Blizzard's EventRegistry instead of creating an invisible frame to handle events. This was tested on Wrath Classic, other clients may need further adjustments. Lua Code:
|
All times are GMT -6. The time now is 03:17 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI