# HG changeset patch # User Farmbuyer of US-Kilrogg # Date 1343416169 0 # Node ID b5a55c69ef67b8ceb8d72b21c0f5506f0e459e65 # Parent ba5ff82dcf199d3f68020cc758f0af5c6ca46628 Properly switch between profiles. diff -r ba5ff82dcf19 -r b5a55c69ef67 core.lua --- a/core.lua Fri Jul 27 10:23:12 2012 +0000 +++ b/core.lua Fri Jul 27 19:09:29 2012 +0000 @@ -698,6 +698,10 @@ ------ Ace3 framework stuff +function addon:DBProfileRefresh() + opts = self.db.profile +end + function addon:OnInitialize() if self.author_debug then _G.OL = self @@ -728,7 +732,10 @@ end self.db = _G.LibStub("AceDB-3.0"):New("OuroLootOptsDB", { profile = option_defaults } , --[[Default=]]true) - opts = self.db.profile + self.db.RegisterCallback (self, "OnProfileChanged", "DBProfileRefresh") + self.db.RegisterCallback (self, "OnProfileCopied", "DBProfileRefresh") + self.db.RegisterCallback (self, "OnProfileReset", "DBProfileRefresh") + self:DBProfileRefresh() --[[ local stored_datarev = opts.datarev or 14 diff -r ba5ff82dcf19 -r b5a55c69ef67 gui.lua --- a/gui.lua Fri Jul 27 10:23:12 2012 +0000 +++ b/gui.lua Fri Jul 27 19:09:29 2012 +0000 @@ -1904,6 +1904,7 @@ tabs_OnGroupSelected_func = function (tabs,event,group) tabs_OnGroupSelected_func_args[1] = tabs tabs_OnGroupSelected_func_args[3] = group + gui.opts = addon.db.profile hide_noobtips_frame() tabs:ReleaseChildren() local spec = tabs:GetUserData("special buttons group") diff -r ba5ff82dcf19 -r b5a55c69ef67 options.lua --- a/options.lua Fri Jul 27 10:23:12 2012 +0000 +++ b/options.lua Fri Jul 27 19:09:29 2012 +0000 @@ -703,6 +703,7 @@ -- Clicking an entry on the left tree column. local opt_OnGroupSelected_func = function (treeg,event,category) + opts = addon.db.profile local catfuncs = controls[category] if not catfuncs then addon:horrible_horrible_error(("Category '%s' has no handler function!"):format(category:gsub('\001','_'))) @@ -730,8 +731,6 @@ -- Clicking the Options tab as a whole (tabs_OnGroupSelected["opt"]). local tabs_OGS = function (container, specials) - opts = gui.opts - container:SetLayout("Fill") local left = AceGUI:Create("TreeGroup") left:SetStatusTable(status_for_select)