Mercurial > wow > itemauditor
comparison Modules/Options.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 | 34daa46b644a |
children | 003de902ae64 |
comparison
equal
deleted
inserted
replaced
37:9bd18fce8498 | 38:e27d13095b49 |
---|---|
154 name = "invested", | 154 name = "invested", |
155 desc = "Shows what you have invested in", | 155 desc = "Shows what you have invested in", |
156 func = "CreateFrames", | 156 func = "CreateFrames", |
157 guiHidden = false, | 157 guiHidden = false, |
158 }, | 158 }, |
159 suspend = { | |
160 type = "toggle", | |
161 name = "suspend", | |
162 desc = "Suspends ItemAuditor", | |
163 get = "IsEnabled", | |
164 set = "SetEnabled", | |
165 guiHidden = true, | |
166 }, | |
159 }, | 167 }, |
160 } | 168 } |
169 | |
170 function addon:SetEnabled(info, enable) | |
171 self.db.profile.addon_enabled = enable | |
172 if enable == self:IsEnabled() then | |
173 -- do nothing | |
174 elseif enable then | |
175 self:Enable() | |
176 self:Print('ItemAuditor is enabled.') | |
177 else | |
178 self:Disable() | |
179 self:Print('ItemAuditor is supended and will not watch for any events. Use "/ia suspend" to turn it back on.') | |
180 end | |
181 end | |
161 | 182 |
162 function addon:RegisterOptions() | 183 function addon:RegisterOptions() |
163 self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("ItemAuditor", "ItemAuditor") | 184 self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("ItemAuditor", "ItemAuditor") |
164 LibStub("AceConfig-3.0"):RegisterOptionsTable("ItemAuditor", options, {"ia"}) | 185 LibStub("AceConfig-3.0"):RegisterOptionsTable("ItemAuditor", options, {"ia"}) |
165 end | 186 end |