Okay, this is the barest minimum I needed to get it to work. The fading code used is simply due to its simplicity. I am personally using animation fading in my big project so I'll leave any changes you require up to you.
<YourAddonName>.TOC Code:
## Interface: 80000 <YourAddOnName>.lua Lua Code:
|
Thank you! I will get it a combing.
|
Line 4:
addonData will never be empty or nil (unless there is serious issue with the WoW client, in which case you have greater worries than just your addon) This -is- what you want to do when initializing your saved variables table, however. If it already exists, you don't want to overwrite it with an empty table. This also means that you have to wait until your addon's variables load (or later) to see if they exist yet and to do something with them if they do. Lua Code:
(PS - If you want to do something only when the player logs in and not whenever they see a loading screen, there are 2 ways to do that.
|
Someone mentioned that PLAYER_ENTERING_WORLD now returns two args that show if its a login or sth else.
|
Thanks for your insight Seerah,
Quote:
Quote:
Your placement of SavedVariable setting up may well be a better place if, the saved variable file contains a nil table, which would then overwrite the initialised table at the start of the file then it would cause a problem. However, the only time I think it would be nil is when you are first creating the addon with that particular table and testing the settings back and forth. Simply deleting the wtf will fix that problem and your users shouldn't ever have the problem. I would suppose individual projects would have their own way of dealing with this and similar scenarios. But definitely a good thing to point out the other way of setting them up. Quote:
|
All times are GMT -6. The time now is 08:48 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI