UPDATE!
Okay so after debugging this for days now I've finally figure out the problem. Somehow Ace3's OnInitialize function does not work as expected. The official docs show this:
Lua Code:
AceDBExample = LibStub("AceAddon-3.0"):NewAddon("AceDBExample")
function AceDBExample:OnInitialize()
self.db = LibStub("AceDB-3.0"):New("AceDBExampleDB")
end
"AceDBExampleDB" is the saved var from the .toc file. I've done the same with my "gempDB" but I finally found out that it's nil at this point of the loading process.
I hacked together this quick fix:
Lua Code:
function G.ace:OnInitialize()
local frame = CreateFrame("FRAME", "SavedVarsFrame");
frame:RegisterEvent("ADDON_LOADED")
frame:SetScript("OnEvent", function(self, event, arg1)
if arg1 == "gempUI" then
self:UnregisterEvent("ADDON_LOADED")
G.ace.db = LibStub("AceDB-3.0"):New("gempDB", defaults, true)
options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(G.ace.db)
end
end)
[..]
and VOILA my config now saves correctly after reloading. The only Idea I have is that AceDB listens to the wrong ADDON_LOADED event? But I'm assuming the first argument of :NewAddon dictates the addon name, and that's what I have.
Lua Code:
G.ace = LibStub("AceAddon-3.0"):NewAddon("gempUI", "AceConsole-3.0", "AceEvent-3.0")
So. Anyone an Idea what's going on? Should I maybe open an issue on their wowace page?