Differentiate fresh login and UI reload?
Hello,
I would like to apply a setting saved in saved variable file only on fresh log in, and not on interface reload. I'm using PLAYER_LOGIN event to initialize my addons, but this event is also fired when interface is reloaded. So, is there a way to differentiate a fresh login from an interface reload? |
https://wow.gamepedia.com/PLAYER_ENTERING_WORLD
This event gives you this info PLAYER_ENTERING_WORLD: isInitialLogin, isReloadingUi |
Great!
Thank you Rilgamon for your quick answer :) |
The savedvariables become available on the respective ADDON_LOADED event, that is when addons usually initialize and setup them. ADDON_LOADED also fires on /reload
I don't see the specific use case for only applying a setting on a fresh login, since addons generally shouldn't really care whether some setting is applied on only login vs login and /reload |
Quote:
I then use this variable later, on PLAYER_LOGIN event. |
https://wow.gamepedia.com/AddOn_load...during_loading
You might notice that the info is not available because of the order of events. (Some time ago I noticed the order changed, but never looked at it again. So not sure if the order is still the same) |
The thing that I have noticed as different between the startup/ReloadUI in Retail/Classic, is in Retail normal startup there is SPELLS_CHANGED that fires between ADDON_LOADED and PLAYER_LOGIN. There is another that fires after QUEST_LOG_UPDATE which makes it interesting if you are looking for SPELLS_CHANGED to trigger logic.
|
All times are GMT -6. The time now is 01:56 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI