diff core.lua @ 98:b5a55c69ef67

Properly switch between profiles.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Fri, 27 Jul 2012 19:09:29 +0000
parents ba5ff82dcf19
children 966d06c8d9c9
line wrap: on
line diff
--- 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