View Single Post
01-17-15, 02:52 AM   #26
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If your main saved variable is already a table, you can just use a sub-table in it instead of adding a second saved variable; eg. in Grid I do something like this:

Code:
Grid.db.profile = {
     -- bunch of settings here
     minimap = {},
}

LibDBIcon:Register("Grid", GRID_LDB_OBJECT, Grid.db.profile.minimap)
This is also an example of where the :Refresh method is useful -- when the user switches their profile, I need to call :Register with a reference to the "minimap" sub-table in the new profile table.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote