View Single Post
04-13-24, 08:19 AM   #22
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,950
Look at what I changed in the files, they were copies of what you posted. So, you should see what I changed and why I changed it because of the notes I put in there.

If it doesn't work after you have added what you think is all that needs to be added, check again in case you missed something. Even doing something in the wrong order can affect the output. Names of frames and tables can affect things as well.

I have set the files up so that they are separate files talking to each other. You can add another file that does the main stuff in the addon and have the settings panel talk to it.

For example:

QuestCompletionFrame.lua
SettingsPanel.lua
MinimapButton.lua

QuestCompletionFrame.lua could hold all your quest completion code and not talk to the settings or the minimap button.

SettingsPanel needs to know about the QuestCompletionFrame as you have it showing and hiding the frame when the check boxes are clicked.

MinimapButton.lua needs to know about the SettingsPanel to open it up and show the controls.


Now, the question is, if you were going to use the SavedVariablesTable for session to session access to the settings. Then you can either have that set up in its own file and loaded before QuestCompletionFrame or you can have QuestCompletionFrame set those variables up, the game handles loading and saving them when you log in and out. All you have to do is make sure that it exists.

For example:
If you had a SavedVariablesTable called .. ZTVCurrentSettings then you would do this to initialise it, ready for use.
ZTVCurrentSettings = ZTVCurrentSettings or {}
This makes sure that any existing values are kept, or it creates a new table because there are no existing values.
You can use this at the top of the file that first needs access to it.

In either case it needs to be sorted out before you get and set them in SettingsPanel or use them in QuestCompletionFrame. Like I said, order is everything.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote