Mercurial > wow > mailopener
diff Modules/BeanCounterSupport.lua @ 122:6a51405c7733
Hopefully fixed hooking errors (I can?t reproduce them, but this should still solve it).
| author | Zerotorescue |
|---|---|
| date | Sat, 16 Oct 2010 14:44:48 +0200 |
| parents | f01e0184a275 |
| children |
line wrap: on
line diff
--- a/Modules/BeanCounterSupport.lua Wed Oct 13 15:41:22 2010 +0200 +++ b/Modules/BeanCounterSupport.lua Sat Oct 16 14:44:48 2010 +0200 @@ -45,8 +45,10 @@ refMonitoredFrame = InboxCloseButton; - -- Hook the OnHide of refMonitoredFrame indicating BeanCounter has started - self:HookScript(refMonitoredFrame, "OnHide", "BeanCounterActivated"); + if not self:IsHooked(refMonitoredFrame, "OnHide") then + -- Hook the OnHide of refMonitoredFrame indicating BeanCounter has started + self:HookScript(refMonitoredFrame, "OnHide", "BeanCounterActivated"); + end end function mod:MAIL_CLOSED() @@ -75,8 +77,10 @@ -- Unhook the current hook (and reapply it after the OnShow was triggered) self:Unhook(refMonitoredFrame, "OnHide"); - -- Hook the OnShow of refMonitoredFrame indicating BeanCounter is finished - self:HookScript(refMonitoredFrame, "OnShow", "BeanCounterDeactivated"); + if not self:IsHooked(refMonitoredFrame, "OnShow") then + -- Hook the OnShow of refMonitoredFrame indicating BeanCounter is finished + self:HookScript(refMonitoredFrame, "OnShow", "BeanCounterDeactivated"); + end MailAddonBusy = MailAddonName; end @@ -92,8 +96,10 @@ -- Unhook the current hook (and reapply it after the OnHide was triggered) self:Unhook(refMonitoredFrame, "OnShow"); - -- Hook the OnHide of the refMonitoredFrame again which is trigged when BeanCounter starts - self:HookScript(refMonitoredFrame, "OnHide", "BeanCounterActivated"); + if not self:IsHooked(refMonitoredFrame, "OnHide") then + -- Hook the OnHide of the refMonitoredFrame again which is trigged when BeanCounter starts + self:HookScript(refMonitoredFrame, "OnHide", "BeanCounterActivated"); + end if MailAddonBusy == MailAddonName then MailAddonBusy = nil;
