diff Modules/Events.lua @ 38:e27d13095b49

Added the ability to suspend and resume ItemAuditor (Ticket #8). To access this feature use "/ia suspend".
author Asa Ayers <Asa.Ayers@Gmail.com>
date Sun, 18 Jul 2010 22:46:35 -0700
parents f5d384fe7e4a
children 003de902ae64
line wrap: on
line diff
--- a/Modules/Events.lua	Sun Jul 18 21:32:15 2010 -0700
+++ b/Modules/Events.lua	Sun Jul 18 22:46:35 2010 -0700
@@ -3,13 +3,19 @@
 
 local utils = addonTable.utils
 
-function addon:PLAYER_ENTERING_WORLD()
+function addon:OnEnable()
 	self:RegisterEvent("MAIL_SHOW")
 	self:RegisterEvent("UNIT_SPELLCAST_START")
 	addon:UpdateCurrentInventory()
 	self:WatchBags()
 	
-	-- addon:ConvertItems()
+	self:SetEnabled(nil, self.db.profile.addon_enabled)
+end
+
+function addon:OnDisable()
+	self:UnwatchBags()
+	self:UnregisterAllEvents()
+	addon:HideAllFrames()
 end
  
  function addon:MAIL_SHOW()