View Single Post
08-29-13, 05:45 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Why do you need to pass the db into the get/set functions? It's not like the path to the db (for AceAddon/AceDB) changes during gameplay; it's always located at MyAddon.db.profile, so just use that in your functions.

Also, the functions Vrul posted will only work if your options table structure matches your db table structure exactly.

Finally, AceConfig doesn't limit you to one setter function per options table. Rather than trying to shoehorn every possible scenario into one function, you are probably better off writing more specific functions tailored for each option group, or even each individual option.
__________________
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