Please don't quote an entire 100+ line post, especially if it's the last post in the thread.
Originally Posted by cokedrivers
How would you use these defaults in your addon would it be MyAddonDB.x ?
|
Yes. The defaults are just that -- default values. They should only be used to initialize the db table; you should never be referring to values in the defaults table or applying them to things in your addon. If you're currently doing this with AceDB:
Code:
local defaults = {
global = {
point = "TOP",
x = 0,
y = -100,
}
}
local db = LibStub("AceDB-3.0"):New("MyAddonDB", defaults, true)
local cfg = db.global
SomeFrame:SetPoint(cfg.point, cfg.x, cfg.y)
Then using the method in my last post you would do this instead:
Code:
local defaults = {
point = "TOP",
x = 0,
y = -100,
}
MyAddonDB = copyDefaults(defaults, MyAddonDB)
local cfg = MyAddonDB
SomeFrame:SetPoint(cfg.point, cfg.x, cfg.y)
However, if you want to offer profile support, I'd suggest you just continue using AceDB.
Also, this thread is very old. I suggest you check this more current one instead:
http://forums.wowace.com/showthread.php?t=21864