Mercurial > wow > mailopener
changeset 176:14096395dd93
This htgtags file is annoying
| author | Zachary Kotlarek <zach@kotlarek.com> |
|---|---|
| date | Sun, 10 Mar 2013 16:09:57 -0700 |
| parents | 463e29ca6b08 (diff) ebe4c62ce1bb (current diff) |
| children | 82f9ed7a8cce |
| files | .hgtags |
| diffstat | 9 files changed, 468 insertions(+), 344 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Sun Mar 10 23:09:32 2013 +0000 +++ b/.hgtags Sun Mar 10 16:09:57 2013 -0700 @@ -31,6 +31,25 @@ 312827521e2cfae1c25c9c08fbf127553bd7e168 v1.2.2-BETA cb50f0ccaf3c78fe301dbe4a84c0ac3d6e8adebb v1.2.2 2dacc2e5aafb47f5b1c132fa5b62085e6a489725 v1.2.3 +71e2a651d66782fec829c4282273748f11161562 v1.2.4-BETA +6426c0245657a61eb1607e941d3b79f47769b721 v1.2.4 +13243f627bf48e7def71d733e7e7a8dd6814de81 v1.2.5 +9c8c876dea8e23bbac1d3e39892929982a7e513f v1.2.6 +6e4283f99b7ec372f7449b3c880c95c0480e1582 v1.2.7 +ba697df5c2af088906267ee2e5cfcb74441036c6 v1.2.8 +bb67ce70dba75bb3a84326a7fa7981d969a39d34 v1.2.9 +5f6ab99106d13c7eabc20ce34fb041848691a8f6 v1.2.10-BETA +29bb72842d637fd83c5b726b04a783f697901012 v1.2.11 +4bc1352956308d57e1ca3a474503f1b30d917bcf v1.2.12 +69e0548081498b2b590124bb392fb9446d0b32ca v1.2.13 +9cc5f612c1f15d3af0c87bd7b9d3942a34201460 v1.2.14-BETA +03c293aee2e20d75a50e863b01d57267288619cf v1.2.14 +eb5dae17994efe27584b12ff7e46c840151c483e v1.2.15 +eb5dae17994efe27584b12ff7e46c840151c483e v1.2.15 +0000000000000000000000000000000000000000 v1.2.15 +0000000000000000000000000000000000000000 v1.2.15 +57f3b638af3901bddd7631c27f07371f6ef06cd1 v1.2.15 +624a9d9a59314db0ea30f6a9197dbaeb877fde0c v1.2.16 362c47facc5a0e2a4044d5bdfab1583a014dbd99 v1.3.0-beta 38dddadc7b0d4da14a2c3810775d0224ce19b1a1 v1.3.1-beta 74407c4a8c975db187157f7e9204f44dfd37ceb4 v1.3.2-beta
--- a/Changelog.txt Sun Mar 10 23:09:32 2013 +0000 +++ b/Changelog.txt Sun Mar 10 16:09:57 2013 -0700 @@ -1,95 +1,158 @@ -v1.2.3 Zerotorescue Mon, 27 Sep 2010 09:00:00 +0200 rev 103 +v1.2.16 Zerotorescue Mon, 19 Dec 2011 13:30:00 +0200 - M enUS is default locale again, this should solve the errors with any non-English clients (please consider translating at http://wow.curseforge.com/addons/mailopener/localization/ ). + * The mailbox will still be automatically refreshed while automatic mail opening is disabled. + +v1.2.15 Zerotorescue Wed, 30 Nov 2011 23:00:00 +0200 -v1.2.2 Zerotorescue Sun, 26 Sep 2010 15:30:00 +0200 rev 99 + * TradeSkillMaster's Open All button should now be hidden so the text doesn't overlap the MailOpener button's text. + * Updated TOC to make the addon 4.3 compatible. + +v1.2.14 Zerotorescue Wed, 29 Jun 2011 10:30:00 +0200 - A Added new module: Indicator. This module will show / hide the mail icon based on the amount of mail still waiting for you at the server. + * Fixed the auction house mail filters. -v1.2.1 Zerotorescue Fri, 24 Sep 2010 22:30:00 +0200 rev 94 +v1.2.13 Zerotorescue Tue, 28 Jun 2011 22:00:00 +0200 - M Added AceLocale library. Oops, I forgot it because other addons usually provided it. + * Fixed an error with the OpenAll module caused by patch 4.2. + * Addon should no longer be marked as out-of-date for the duration of this patch. + +v1.2.12 Zerotorescue Sat, 19 Feb 2011 15:00:00 +0200 -v1.2.0 Zerotorescue Fri, 17 Sep 2010 12:00:00 +0200 rev 86 + * Fixed an error at the mailbox that occured when using the latest ZeroAuctions (BETA) version. + +v1.2.11 Zerotorescue Sat, 29 Jan 2011 22:30:00 +0200 + + * Fixed Mail Opener being added to the Blizzard config twice. + * Might have fixed a possible issue with mail box refreshing not occuring right after logging in. + +v1.2.10 Zerotorescue Fri, 12 Oct 2010 18:00:00 +0200 + + * A "C stack overflow"-error when clicking the mail opener options in the interface -> addons tab should no longer occur. + +v1.2.9 Zerotorescue Wed, 20 Oct 2010 22:30:00 +0200 + + * Fixed the retrieval of a single attachment from mail when you are close to the keep free space limit. + * Added support for the other QuickAuctions child-addon called "AuctionProfitMaster". + +v1.2.8 Zerotorescue Sat, 16 Oct 2010 15:30:00 +0200 + + * Fixed double loading of ZeroAuctions when using AddonLoader. + +v1.2.7 Zerotorescue Sat, 16 Oct 2010 15:00:00 +0200 + + * Hopefully fixed hooking errors (I canīt reproduce them, but this should still solve it). + * Fixed the copy dialog. + * All QuickAuctions checks have been replaced with ZeroAuctions, as QA has been discontinued. + +v1.2.6 Zerotorescue Wed, 13 Oct 2010 15:30:00 +0200 + + * TOC update. + +v1.2.5 Zerotorescue Tue, 12 Oct 2010 12:00:00 +0200 + + * Now compatible with my future version of QuickAuctions (ZeroAuctions). + * Disabling Mail Opener will now also stop the overriding of the CheckInbox function. + +v1.2.4 Zerotorescue Fri, 01 Oct 2010 23:30:00 +0200 + + + Added an option to override the mailbox refresher to delay a mailbox refresh while there is still mail remaining. This option is enabled by default. + * Only announce mail skipped the first OpenAll after a server refresh, to reduce the spam with continuous mail opening enabled. + * Mail opening will now be interrupted when middle or alt-clicking the open all button. + +v1.2.3 Zerotorescue Mon, 27 Sep 2010 09:00:00 +0200 + + * enUS is default locale again, this should solve the errors with any non-English clients (please consider translating at http://wow.curseforge.com/addons/mailopener/localization/ ). + +v1.2.2 Zerotorescue Sun, 26 Sep 2010 15:30:00 +0200 + + + Added new module: Indicator. This module will show / hide the mail icon based on the amount of mail still waiting for you at the server. + +v1.2.1 Zerotorescue Fri, 24 Sep 2010 22:30:00 +0200 + + * Added AceLocale library. Oops, I forgot it because other addons usually provided it. + +v1.2.0 Zerotorescue Fri, 17 Sep 2010 12:00:00 +0200 Note: Remember that when updating from v1.1.4 or earlier versions you must restart the client or you will get many LUA errors. - M Tagging as v1.2.0 to indicate the last few builds (1.1.5 & 1.1.6) did a few larger/more important changes. - M Fixed an error when toggling auto mail on or off. + * Tagging as v1.2.0 to indicate the last few builds (1.1.5 & 1.1.6) did a few larger/more important changes. + * Fixed an error when toggling auto mail on or off. -v1.1.7 Zerotorescue Thu, 16 Sep 2010 18:30:00 +0200 rev 84 +v1.1.7 Zerotorescue Thu, 16 Sep 2010 18:30:00 +0200 - M My own tests were not sufficient, fixed an error when opening cash mail. + * My own tests were not sufficient, fixed an error when opening cash mail. -v1.1.6 Zerotorescue Thu, 16 Sep 2010 17:30:00 +0200 rev 81 +v1.1.6 Zerotorescue Thu, 16 Sep 2010 17:30:00 +0200 - M The keep free space will now cause the opener to partially loot mail when you are near the keep free space requirement, rather than skipping the entire mail. The config has been adjusted to reflect this change. - M Fixed the timespent tracker of the Collected module. - M Fixed some strings I forgot to localize in the Collected module. - A Added functionality for URLs to be added to tips. - A Added a tip requesting your help localizing the addon. Please visit http://wow.curseforge.com/addons/mailopener/localization/ if you are a kind person mastering a language supported by the game client (also would like some clever English person to correct any of my typos and grammar errors). + * The keep free space will now cause the opener to partially loot mail when you are near the keep free space requirement, rather than skipping the entire mail. The config has been adjusted to reflect this change. + * Fixed the timespent tracker of the Collected module. + * Fixed some strings I forgot to localize in the Collected module. + + Added functionality for URLs to be added to tips. + + Added a tip requesting your help localizing the addon. Please visit http://wow.curseforge.com/addons/mailopener/localization/ if you are a kind person mastering a language supported by the game client (also would like some clever English person to correct any of my typos and grammar errors). -v1.1.5 Zerotorescue Wed, 15 Sep 2010 17:30:00 +0200 rev 74 +v1.1.5 Zerotorescue Wed, 15 Sep 2010 17:30:00 +0200 - A Added localization files and set it up at Curseforge. Please head to CurseForge.com and search for MailOpener is you are willing to translate some things. - M Modified all files to support the localization strings. - M The TOC file has been updated with the locations for the localization files. A game client restart is required or you will get spammed with many errors. + + Added localization files and set it up at Curseforge. Please head to CurseForge.com and search for MailOpener is you are willing to translate some things. + * Modified all files to support the localization strings. + * The TOC file has been updated with the locations for the localization files. A game client restart is required or you will get spammed with many errors. -v1.1.4 Zerotorescue Tue, 14 Sep 2010 00:30:00 +0200 rev 64 +v1.1.4 Zerotorescue Tue, 14 Sep 2010 00:30:00 +0200 - M Fixed a LUA error when logging in. - M Tracking of the time spent at the mailbox with the Collected module should now be enabled by default. - M Hopefully fixed the usage of "mails". - A Added a section for Mail Opener tips to the bottom of the general config. Also, the first time you start the config you will be prompted to enable continuous opening. Right now only a handful of tips are there but I plan to extend it with FAQ. + * Fixed a LUA error when logging in. + * Tracking of the time spent at the mailbox with the Collected module should now be enabled by default. + * Hopefully fixed the usage of "mails". + + Added a section for Mail Opener tips to the bottom of the general config. Also, the first time you start the config you will be prompted to enable continuous opening. Right now only a handful of tips are there but I plan to extend it with FAQ. ~ Skipped 1.1.3. -v1.1.2 Zerotorescue Sun, 12 Sep 2010 21:30:00 +0200 rev 52 +v1.1.2 Zerotorescue Sun, 12 Sep 2010 21:30:00 +0200 - A Holding shift while clicking the open all button will now temporarily change the mail opening filters to auto loot every single mail with attachments (no exceptions). - A Right clicking the open all button will now show a drop down menu where you can quickly toggle the mail opening filters. - A Added a tooltip to the open all button explaining the above two features. - A Added neat(er) tooltips for both the mail opener status toggler as the config button. - A Added an option below the filters to disable the shift click functionality of the open all button. - A You can now toggle the help tooltips for the Mail Opener-added MailFrame buttons in the general config. - M Only when holding the shift key while opening the mailbox will toggle the opening status. If you want to do it somewhere in the middle of your mailbox visit, just untick the mail opener checkbox. + + Holding shift while clicking the open all button will now temporarily change the mail opening filters to auto loot every single mail with attachments (no exceptions). + + Right clicking the open all button will now show a drop down menu where you can quickly toggle the mail opening filters. + + Added a tooltip to the open all button explaining the above two features. + + Added neat(er) tooltips for both the mail opener status toggler as the config button. + + Added an option below the filters to disable the shift click functionality of the open all button. + + You can now toggle the help tooltips for the Mail Opener-added MailFrame buttons in the general config. + * Only when holding the shift key while opening the mailbox will toggle the opening status. If you want to do it somewhere in the middle of your mailbox visit, just untick the mail opener checkbox. -v1.1.1 Zerotorescue Sun, 12 Sep 2010 01:30:00 +0200 rev 42 +v1.1.1 Zerotorescue Sun, 12 Sep 2010 01:30:00 +0200 - A Added a new option to both of the current sound notifications to limit playing of the sound to once per mailbox visit, instead of once per mailbox refresh / bags update. - M Now using more standardized prefixes for changes. - M No longer showing spent "0 minutes" when you spent less than 59 seconds at the mailbox. - M When you only opened only a single mail, the summary will show "from this mail" rather than "from these mails". - M Reworded the QuickAuctions automail status changer config options. (old: auto mailing, new: auto mail status) - M Fixed an error when disabling the FailSafe module. + + Added a new option to both of the current sound notifications to limit playing of the sound to once per mailbox visit, instead of once per mailbox refresh / bags update. + * Now using more standardized prefixes for changes. + * No longer showing spent "0 minutes" when you spent less than 59 seconds at the mailbox. + * When you only opened only a single mail, the summary will show "from this mail" rather than "from these mails". + * Reworded the QuickAuctions automail status changer config options. (old: auto mailing, new: auto mail status) + * Fixed an error when disabling the FailSafe module. -v1.1.0 Zerotorescue Fri, 10 Sep 2010 19:00:00 +0200 rev 31 +v1.1.0 Zerotorescue Fri, 10 Sep 2010 19:00:00 +0200 - A Added a new config group: Modules. This group will show the module statuses and descriptions and it will contain all optional modules (with their settings) as subgroups. - A Now making a manual changelog as the one generated by Curseforge is useless. - R Removed all BeanCounter checks in files. - A Added a new module: BeanCounter Support. This module will now take care of preventing mail opening while BeanCounter is scanning. - A Added AceHook library for the BeanCounter Support module. - M Sorted the Core.lua OnInitialize to properly toggle modules before doing time consuming things. - M All module comments are now a property of the modules themselves and can be retrieved with (string)".moduleDescription" and (bool)".moduleRequired". - M All module references are now called "mod". - M Removed all libraries from the repository. + + Added a new config group: Modules. This group will show the module statuses and descriptions and it will contain all optional modules (with their settings) as subgroups. + + Now making a manual changelog as the one generated by Curseforge is useless. + - Removed all BeanCounter checks in files. + + Added a new module: BeanCounter Support. This module will now take care of preventing mail opening while BeanCounter is scanning. + + Added AceHook library for the BeanCounter Support module. + * Sorted the Core.lua OnInitialize to properly toggle modules before doing time consuming things. + * All module comments are now a property of the modules themselves and can be retrieved with (string)".moduleDescription" and (bool)".moduleRequired". + * All module references are now called "mod". + * Removed all libraries from the repository. -v1.0.2 Zerotorescue Thu, 09 Sep 2010 22:00:00 +0200 rev 27 +v1.0.2 Zerotorescue Thu, 09 Sep 2010 22:00:00 +0200 - M The opener will no longer lock when a mailbox refresh happens while opening. + * The opener will no longer lock when a mailbox refresh happens while opening. -v1.0.0 Zerotorescue Thu, 09 Sep 2010 18:00:00 +0200 rev 21 +v1.0.0 Zerotorescue Thu, 09 Sep 2010 18:00:00 +0200 - A complete rewrite to make MailOpener a stand-alone addon. + + complete rewrite to make MailOpener a stand-alone addon. MailOpener will no longer let Postal do the opening but rather do it by itself. You can change the configuration at the interface -> addons options or by opening the option interface with /mo c (/mailopener config). You can still leave Postal enabled for it's mail sending modules but there is no reason to leave it on for the mail opening. See the addon page for more information. ------------------------------------------------------------ - Legend: -R Removed -A Added -M Modified \ No newline at end of file +! Notable change / important information +* Changed ++ Added feature or improvement +- Something removed or a bug fix + +Version numbering: major.minor.build (optional -BETA appended)
--- a/Core.lua Sun Mar 10 23:09:32 2013 +0000 +++ b/Core.lua Sun Mar 10 16:09:57 2013 -0700 @@ -6,7 +6,7 @@ -- MailAddonBusy will be nil when nothing is happening or filled with the addon name when MO is working -- Another addon can use this variable to indicate they're working too, MailOpener will then wait for that to finish -local AutoOpenMail, MailOpenerConfig, lastAmount, lastQuickAuctionsStatus, freshList, mailboxEmptySoundPlayed, mailboxEmptySoundPlayedThisVisit; +local AutoOpenMail, MailOpenerConfig, lastAmount, lastQuickAuctionsStatus, freshList, mailboxEmptySoundPlayed, mailboxEmptySoundPlayedThisVisit, hasOpenedMailAlready, originalCheckInbox; function MailOpener:OnInitialize() self:Debug("OnInitialize"); @@ -33,6 +33,7 @@ continueOpening = false, waitTime = 5, initialDelay = 0.5, + overrideCheckInbox = true, }, modules = { BeanCounterSupport = true, @@ -145,15 +146,20 @@ local frame = CreateFrame("Frame", nil, UIParent); frame:Hide(); frame.name = "Mail Opener"; + frame.fresh = true; frame:HookScript("OnShow", function(self) - -- Enable the config module - MailOpener:EnableConfigModule(); - - -- Load the options and add it to the blizzard interface list - MailOpenerConfig:Load(); - - -- Refresh the frame to instantly show the right options - InterfaceOptionsFrame_OpenToCategory(self.name) + if self.fresh then + self.fresh = nil; + + -- Enable the config module + MailOpener:EnableConfigModule(); + + -- Load the options and add it to the blizzard interface list + MailOpenerConfig:Load(); + + -- Refresh the frame to instantly show the right options + InterfaceOptionsFrame_OpenToCategory(self.name); + end end); -- And add it to the interface options InterfaceOptions_AddCategory(frame); @@ -283,27 +289,45 @@ self.PostalEnabled = true; -- Set this as an object variable so we can use it in our modules -- Ensure this addon is loaded if AddonLoader is installed - if AddonLoader and AddonLoader.LoadAddOn and not Postal then + if AddonLoader and AddonLoader.LoadAddOn and not IsAddOnLoaded("Postal") and not Postal then AddonLoader:LoadAddOn("Postal"); end end - if select(6, GetAddOnInfo("QuickAuctions")) == nil then - self.QuickAuctionsEnabled = true; -- Set this as an object variable so we can use it in our modules + if select(6, GetAddOnInfo("ZeroAuctions")) == nil then + self.ZeroAuctionsEnabled = true; -- Set this as an object variable so we can use it in our modules -- Ensure this addon is loaded if AddonLoader is installed - if AddonLoader and AddonLoader.LoadAddOn then - AddonLoader:LoadAddOn("QuickAuctions"); + if AddonLoader and AddonLoader.LoadAddOn and not IsAddOnLoaded("ZeroAuctions") then + AddonLoader:LoadAddOn("ZeroAuctions"); end end + if select(6, GetAddOnInfo("AuctionProfitMaster")) == nil then + self.ZeroAuctionsEnabled = true; -- Set this as an object variable so we can use it in our modules + + -- Ensure this addon is loaded if AddonLoader is installed + if AddonLoader and AddonLoader.LoadAddOn and not IsAddOnLoaded("AuctionProfitMaster") then + AddonLoader:LoadAddOn("AuctionProfitMaster"); + end + end + + if select(6, GetAddOnInfo("TradeSkillMaster_Mailing")) == nil then + self.TSMMailingEnabled = true; -- Set this as an object variable so we can use it in our modules + + -- Ensure this addon is loaded if AddonLoader is installed + if AddonLoader and AddonLoader.LoadAddOn and not IsAddOnLoaded("TradeSkillMaster_Mailing") then + AddonLoader:LoadAddOn("TradeSkillMaster_Mailing"); + end + end + -- ADJUST POSITIONS - if self.QuickAuctionsEnabled then + if self.ZeroAuctionsEnabled then -- QA is enabled so move the checkbox further to the right self.cbOpenAll:SetPoint("TOPLEFT", MailFrame, "TOPLEFT", 155, -13); @@ -324,10 +348,13 @@ lastAmount = 0; self.debugChannel = nil; - --BETA:if (self.db.profile.uses % 15) == 0 then - --BETA: -- Automatically show once every 15 uses - --BETA: self:ShowBetaPopup(); - --BETA:end + if not originalCheckInbox then + -- Override the CheckInbox function + -- Remember the original + originalCheckInbox = CheckInbox; + -- Then override that + CheckInbox = NewCheckInbox; + end -- If we were toggling this addon on while the mailbox is opened we must register all events again if MailFrame:IsVisible() then @@ -340,6 +367,13 @@ self.btnConfig:Hide(); + if originalCheckInbox then + -- Change checkinbox back to the original value + CheckInbox = originalCheckInbox; + -- Forget the other reference + originalCheckInbox = nil; + end + MailOpener:Stop(); end @@ -419,17 +453,25 @@ InboxTooMuchMail:Hide() InboxTooMuchMail.Show = function() end - if self.QuickAuctionsEnabled then - local QAMail = LibStub("AceAddon-3.0"):GetAddon("QuickAuctions", true):GetModule("Mail", true); - - if QAMail then - -- Hide the open all button - QAMail.massOpening:Hide(); - -- Hide the x mail remaining text - QAMail.totalMail:Hide(); + if self.ZeroAuctionsEnabled then + local AHAddon = LibStub("AceAddon-3.0"):GetAddon("ZeroAuctions", true) or LibStub("AceAddon-3.0"):GetAddon("AuctionProfitMaster", true); + if AHAddon then + local QAMail = AHAddon:GetModule("Mail", true); + + if QAMail then + if QAMail.massOpening then + -- Hide the open all button + QAMail.massOpening:Hide(); + end + if QAMail.totalMail then + -- Hide the x mail remaining text + QAMail.totalMail:Hide(); + end + end end end + hasOpenedMailAlready = nil; mailboxEmptySoundPlayed = nil; mailboxEmptySoundPlayedThisVisit = nil; @@ -542,26 +584,27 @@ self:CancelTimer(self.tmrTryAgain, true); -- Insurance - if QuickAuctionsAutoMail then + if self.ZeroAuctionsEnabled and ZeroAuctionsAutoMail then -- Remember the last known quick auctions status - lastQuickAuctionsStatus = QuickAuctionsAutoMail:GetChecked(); + lastQuickAuctionsStatus = ZeroAuctionsAutoMail:GetChecked(); end - if self.db.profile.general.autoDisableQAAutoMail and self.QuickAuctionsEnabled and QuickAuctionsAutoMail and QuickAuctionsAutoMail:GetChecked() then + if self.db.profile.general.autoDisableQAAutoMail and self.ZeroAuctionsEnabled and ZeroAuctionsAutoMail and ZeroAuctionsAutoMail:GetChecked() then -- If auto disable "QA Auto mail" is enabled and QA's auto mail is currently toggled on, turn it off -- We need to do this with a :click to trigger the right events self:Debug("Turning automail |cffff0000off|r."); - QuickAuctionsAutoMail:Click(); + ZeroAuctionsAutoMail:Click(); end + MailAddonBusy = self:GetName(); self:Debug("MO_OPEN_MAIL"); -- Summon the mail opening gods self:SendMessage("MO_OPEN_MAIL"); - else + elseif MailAddonBusy ~= self:GetName() then -- Another addon is ACTIVE self:Debug("Another addon active, waiting .5 seconds... (" .. MailAddonBusy .. ")"); @@ -577,6 +620,8 @@ MailAddonBusy = nil; end + hasOpenedMailAlready = true; + -- Try a recheck self:Recheck(); @@ -592,18 +637,18 @@ end end - if self.QuickAuctionsEnabled then - -- Quick Auctions enabled? + if self.ZeroAuctionsEnabled then + -- Zero Auctions enabled? -- Toggle automailing as per settings - if self.db.profile.general.autoReenableQAAutoMail and QuickAuctionsAutoMail and not QuickAuctionsAutoMail:GetChecked() then + if self.db.profile.general.autoReenableQAAutoMail and ZeroAuctionsAutoMail and not ZeroAuctionsAutoMail:GetChecked() then -- If auto re-enable "QA Auto mail" is enabled and QA's auto mail is currently toggled OFF, turn it on -- We need to do this with a :click to trigger the right events self:Debug("Turning automail |cff00ff00on|r."); - QuickAuctionsAutoMail:Click(); - elseif self.db.profile.general.autoSetBackQAAutoMail and QuickAuctionsAutoMail and lastQuickAuctionsStatus ~= QuickAuctionsAutoMail:GetChecked() then + ZeroAuctionsAutoMail:Click(); + elseif self.db.profile.general.autoSetBackQAAutoMail and ZeroAuctionsAutoMail and lastQuickAuctionsStatus ~= ZeroAuctionsAutoMail:GetChecked() then -- If auto set back "QA Auto mail" is enabled and QA's auto mail is currently not the same as it was before starting, toggle it -- We need to do this with a :click to trigger the right events @@ -613,7 +658,7 @@ self:Debug("Turning automail |cffff0000off|r."); end - QuickAuctionsAutoMail:Click(); + ZeroAuctionsAutoMail:Click(); end end @@ -640,7 +685,8 @@ --local BeanCounterActive = not InboxCloseButton:IsVisible(); --if not BeanCounterActive and AutoOpenMail and not MailAddonBusy then - if AutoOpenMail and not MailAddonBusy then + --if AutoOpenMail and not MailAddonBusy then + if not MailAddonBusy then -- Query the server CheckInbox(); end @@ -660,6 +706,8 @@ MailAddonBusy = nil; end + hasOpenedMailAlready = nil; + -- We won't need this anymore self:UnregisterEvent("MAIL_CLOSED"); self:UnregisterEvent("PLAYER_LEAVING_WORLD"); @@ -715,21 +763,32 @@ -- Toggle module (let Postal handle this) Postal.ToggleModule(nil, name, Postal:GetModule(name), status); end + + if self.TSMMailingEnabled then + local TSMMailing = LibStub("AceAddon-3.0"):GetAddon("TradeSkillMaster_Mailing"); + if TSMMailing and TSMMailing.massOpening then + if not status then + TSMMailing.massOpening:Hide(); + else + TSMMailing.massOpening:Show(); + end + end + end end -- Change Quick Auction's auto mail status based on our prefered settings function MailOpener:ToggleQAStatus() self:Debug("defaultQAStatus:" .. self.db.profile.general.defaultQAStatus); - if self.QuickAuctionsEnabled and self.db.profile.general.defaultQAStatus ~= "__remember" and QuickAuctionsAutoMail then - if self.db.profile.general.defaultQAStatus == "_enabled" and not QuickAuctionsAutoMail:GetChecked() then + if self.ZeroAuctionsEnabled and self.db.profile.general.defaultQAStatus ~= "__remember" and ZeroAuctionsAutoMail then + if self.db.profile.general.defaultQAStatus == "_enabled" and not ZeroAuctionsAutoMail:GetChecked() then self:Debug("Turning automail |cff00ff00on|r."); - QuickAuctionsAutoMail:Click(); - elseif self.db.profile.general.defaultQAStatus == "disabled" and QuickAuctionsAutoMail:GetChecked() then + ZeroAuctionsAutoMail:Click(); + elseif self.db.profile.general.defaultQAStatus == "disabled" and ZeroAuctionsAutoMail:GetChecked() then self:Debug("Turning automail |cffff0000off|r."); - QuickAuctionsAutoMail:Click(); + ZeroAuctionsAutoMail:Click(); end end end @@ -753,23 +812,21 @@ text = L["Press CTRL-C to copy."], button2 = CLOSE, hasEditBox = 1, - hasWideEditBox = 1, - OnShow = function() - local editBox = _G[this:GetName().."WideEditBox"]; - if editBox and MailOpener.currentPopupContents then - editBox:SetText(MailOpener.currentPopupContents); - editBox:SetFocus(); - editBox:HighlightText(0); + editBoxWidth = 360, + OnShow = function(self) + if self.editBox and MailOpener.currentPopupContents then + self.editBox:SetText(MailOpener.currentPopupContents); + self.editBox:SetFocus(); + self.editBox:HighlightText(0); end -- Position the close button in the middle - local button = _G[this:GetName().."Button2"]; - if button then + if self.button2 then -- Remove previous know position - button:ClearAllPoints(); - button:SetWidth(200); + self.button2:ClearAllPoints(); + self.button2:SetWidth(200); -- Reposition in the center - button:SetPoint("CENTER", editBox, "CENTER", 0, -30); + self.button2:SetPoint("CENTER", self.editBox, "CENTER", 0, -30); end end, EditBoxOnEscapePressed = function(self) @@ -781,117 +838,32 @@ maxLetters = 1024, }; ---BETA: The below either has to be removed or changed when releasing ---[[ -BETA/ALPHA request box -function MailOpener:ShowBetaPopup() - function TableDump(key, val, jumps) - local cache = ""; +-- The idea for this is to wait with refresing while there is still mail remaining which can be opened +-- This should speed things up a tiny bit, but might become buggy if coded wrong +-- We actually override the function in the onenable +function NewCheckInbox(...) + if not MailOpener.db.profile.general.overrideCheckInbox or not MailOpener.db.profile.general.continueOpening or not AutoOpenMail or not lastAmount or lastAmount == 0 then + -- If the override Check Inbox option is off + -- or continuous opening is off + -- or there's currently no mail visible - if not jumps then - jumps = 0; - end + MailOpener:Debug("CheckInbox:" .. tostring((not MailOpener.db.profile.general.overrideCheckInbox)) .. "/" .. tostring((not MailOpener.db.profile.general.continueOpening)) .. "/" .. tostring(lastAmount == 0)); - local spacer = ""; - if jumps > 0 then - for i = 1, jumps do - spacer = spacer .. " "; - end - end - - if type(val) == "table" then - cache = cache .. spacer .. key .. " = {\n"; - foreach(val, function(k, v) - cache = cache .. TableDump(k, v, (jumps + 1)); - end); - cache = cache .. spacer .. "},\n"; - else - cache = cache .. spacer .. key .. " = " .. tostring(val) .. ",\n"; - end - - return cache; + -- Just call the original function + return originalCheckInbox(...); end - local cache = ""; - foreach(MailOpener.db.profile, function(k, v) - cache = cache .. TableDump(k, v, 0); - end); - - local AceGUI = LibStub("AceGUI-3.0"); - local frame = AceGUI:Create("Frame"); - frame:SetTitle("Mail Opener ALPHA"); - frame:SetWidth(575); - frame:SetHeight(375); - - -- Add a normal description label - local desc = AceGUI:Create("Label"); - desc:SetText("|cff00ff00After you have been using Mail Opener for a while and configured it just as you want it to be, please report your favorite settings by copying the text below at either of the below links. Thanks in advance!|r\n\n"); - desc:SetFont(GameFontHighlightSmall:GetFont(), 13); - desc:SetFullWidth(true); - frame:AddChild(desc); - - -- Add a MultiLineEditBox - local settingsMLEEB = AceGUI:Create("MultiLineEditBox"); - settingsMLEEB:SetText(cache); - settingsMLEEB:SetLabel("Hit CTRL-A to select all and CTRL-C to copy the text. You can then use CTRL-V to paste."); - settingsMLEEB:SetFullWidth(true); - settingsMLEEB:SetNumLines(8); - settingsMLEEB:DisableButton(true); - settingsMLEEB:SetCallback("OnTextChanged", function() - settingsMLEEB:SetText(cache); - end); - frame:AddChild(settingsMLEEB); - - -- Empty line between the two links - local label = AceGUI:Create("Label"); - label:SetText("Please post the above text at either of these two links:"); - label:SetFullWidth(true); - frame:AddChild(label); - - local desc1 = AceGUI:Create("InteractiveLabel"); - desc1:SetText("|cff00bbbb[http://wow.curseforge.com/addons/mailopener/create-ticket/]|r"); - desc1:SetFont(GameFontHighlightSmall:GetFont(), 13); - desc1:SetFullWidth(true); - desc1:SetCallback("OnClick", function() - MailOpener.currentPopupContents = "http://wow.curseforge.com/addons/mailopener/create-ticket/"; + if not hasOpenedMailAlready then + -- If MO hasn't opened mail yet, we wait. + -- MO will call this function when mail opening is done - StaticPopup_Show("MailOpenerCopyWindow"); - end); - desc1:SetCallback("OnEnter", function() - frame:SetStatusText("Click to copy this URL."); - end); - desc1:SetCallback("OnLeave", function() - frame:SetStatusText(""); - end); - frame:AddChild(desc1); - - -- Empty line between the two links - local spacer = AceGUI:Create("Label"); - spacer:SetText(" "); - frame:AddChild(spacer); - - local desc2 = AceGUI:Create("InteractiveLabel"); - desc2:SetText("|cff00bbbb[http://20kleveling.com/JMTCforum/posting.php?mode=reply&f=9&t=1403]|r"); - desc2:SetFont(GameFontHighlightSmall:GetFont(), 13); - desc2:SetFullWidth(true); - desc2:SetCallback("OnClick", function() - MailOpener.currentPopupContents = "http://20kleveling.com/JMTCforum/posting.php?mode=reply&f=9&t=1403"; + MailOpener:Debug("CheckInbox:Waiting..."); - StaticPopup_Show("MailOpenerCopyWindow"); - end); - desc2:SetCallback("OnEnter", function() - frame:SetStatusText("Click to copy this URL."); - end); - desc2:SetCallback("OnLeave", function() - frame:SetStatusText(""); - end); - frame:AddChild(desc2); - - -- Empty line between the two links - local label = AceGUI:Create("Label"); - label:SetText("\n\nps. You can always view this window again at a later time by clicking the \"Config\" button in the mail frame.\nps2. The information above is completely Mail Opener related. It will be used to determine the best default settings."); - label:SetFullWidth(true); - frame:AddChild(label); + return false; + else + MailOpener:Debug("CheckInbox:Refresh!"); + + return originalCheckInbox(...); + end end -]] \ No newline at end of file
--- a/Localization/enUS.debug.lua Sun Mar 10 23:09:32 2013 +0000 +++ b/Localization/enUS.debug.lua Sun Mar 10 16:09:57 2013 -0700 @@ -3,11 +3,6 @@ if not L then return; end -- Core -L["|cff00ff00Enabled|r"] = true -- Needs review -L["|cff00ff00Enabling|r automatic opening of mail."] = true -- Needs review -L["|cff15ff00Mail Opener|r: %s"] = true -- Needs review -L["|cffff0000Disabling|r automatic opening of mail."] = true -- Needs review -L["|cffff0000Disabling|r automatic opening of mail, shift key was down when opening the mailbox."] = true -- Needs review L["Click here to completely toggle this module on or off."] = true -- Needs review L["Click to open the configuration window for Mail Opener."] = true -- Needs review L["Config"] = true -- Needs review @@ -29,6 +24,11 @@ You can always change the standard behavior in the General options.]=] ] = true -- Needs review L["You can always change the default status in the General config (|cff00ffff/mo c|r)."] = true -- Needs review +L["|cff00ff00Enabled|r"] = true -- Needs review +L["|cff00ff00Enabling|r automatic opening of mail."] = true -- Needs review +L["|cff15ff00Mail Opener|r: %s"] = true -- Needs review +L["|cffff0000Disabling|r automatic opening of mail, shift key was down when opening the mailbox."] = true -- Needs review +L["|cffff0000Disabling|r automatic opening of mail."] = true -- Needs review -- BeanCounterSupport @@ -36,54 +36,52 @@ It will only be active when needed and disabling it may cause your BeanCounter data to become incomplete. Leaving it on causes no harm.]=] ] = true -- Needs review L["BeanCounter Support"] = true -- Needs review +L["Change settings for the BeanCounter Support module."] = true -- Needs review +L["Prevents mail opening while BeanCounter is still scanning. Does nothing when BeanCounter is disabled."] = true -- Needs review L["|cfffed000Please note this module will only be enabled when the addon \"BeanCounter\" is enabled. This module will be disabled when BeanCounter could not be found and enabled when it can unless you manually disabled this module.|r"] = true -- Needs review L["|cffff0000You are strongly adviced to leave this module enabled unless you have very good reasons not to.|r"] = true -- Needs review -L["Change settings for the BeanCounter Support module."] = true -- Needs review -L["Prevents mail opening while BeanCounter is still scanning. Does nothing when BeanCounter is disabled."] = true -- Needs review -- Collected +L["(Required module)"] = true -- Needs review +L["(Session summary)"] = true -- Needs review L["Also show a summary of the recorded stats within the entire session"] = true -- Needs review L["Also show a summary of the recorded stats within the entire session (since your last login or /reload)."] = true -- Needs review -L["|cfffed000Shift-click|r the |cfffed000open all|r button to temporarily override your filters and loot every single mail containing attachments and/or gold."] = true -- Needs review L["Change settings for the collected module."] = true -- Needs review L["Collected"] = true -- Needs review +L["Collected a total of %d mail this session."] = true -- Needs review +L["Collected a total of %d mail within %d minutes and %d seconds this session."] = true -- Needs review +L["Collected a total of %d mail within %d minutes and %d seconds."] = true -- Needs review +L["Collected a total of %d mail within %d seconds this session."] = true -- Needs review +L["Collected a total of %d mail within %d seconds."] = true -- Needs review L["Collected a total of %d mail."] = true -- Needs review -L["Collected a total of %d mail this session."] = true -- Needs review -L["Collected a total of %d mail within %d minutes and %d seconds."] = true -- Needs review -L["Collected a total of %d mail within %d minutes and %d seconds this session."] = true -- Needs review -L["Collected a total of %d mail within %d seconds."] = true -- Needs review -L["Collected a total of %d mail within %d seconds this session."] = true -- Needs review -L["(Required module)"] = true -- Needs review -L["(Session summary)"] = true -- Needs review L["Show a summary of the recorded stats whenever it has been updated after opening the current batch of mails has finished."] = true -- Needs review L["Show a summary of the recorded stats whenever it updated after opening the current batch has finished"] = true -- Needs review L["Shows a simple summary of what has been collected at the mailbox."] = true -- Needs review +L["Spent %d minutes and %d seconds collecting mail this session."] = true -- Needs review L["Spent %d minutes and %d seconds collecting mail."] = true -- Needs review -L["Spent %d minutes and %d seconds collecting mail this session."] = true -- Needs review +L["Spent %d seconds collecting mail this session."] = true -- Needs review L["Spent %d seconds collecting mail."] = true -- Needs review -L["Spent %d seconds collecting mail this session."] = true -- Needs review L["Summarize"] = true -- Needs review -L["Track |cfffed000gold gained|r"] = true -- Needs review -L["Track |cfffed000items gained|r"] = true -- Needs review -L["Track |cfffed000mail opened|r"] = true -- Needs review -L["Track |cfffed000time spent|r"] = true -- Needs review L["Track Stats"] = true -- Needs review L["Track the amount of gold gained and display it when closing the mailbox."] = true -- Needs review L["Track the amount of items gained and display it when closing the mailbox."] = true -- Needs review L["Track the amount of mail received and display it when closing the mailbox."] = true -- Needs review L["Track the amount of time spent at the mailbox."] = true -- Needs review +L["Track |cfffed000gold gained|r"] = true -- Needs review +L["Track |cfffed000items gained|r"] = true -- Needs review +L["Track |cfffed000mail opened|r"] = true -- Needs review +L["Track |cfffed000time spent|r"] = true -- Needs review L["You can select what things to track. Toggling something off will stop tracking of it completely and reduce the resources used by Mail Opener (although you shouldn't notice a difference)."] = true -- Needs review L["You gained %d items and %s from this."] = true -- Needs review L["You gained %d items from this."] = true -- Needs review L["You gained %s from this."] = true -- Needs review +L["|cfffed000Shift-click|r the |cfffed000open all|r button to temporarily override your filters and loot every single mail containing attachments and/or gold."] = true -- Needs review -- Config +L["...per mailbox visit"] = true -- Needs review L["Addon Disabled"] = true -- Needs review -L["Announce when |cfffed000finished opening the current batch|r"] = true -- Needs review -L["Announce when |cfffed000the mailbox is completely empty|r"] = true -- Needs review -L["Announce when mail is processed because..."] = true -- Needs review L["Announce when mail is processed because it's |cfffed000any other kind of mail|r (e.g. plain text)."] = true -- Needs review L["Announce when mail is processed because it's |cfffed000auction canceled mail|r."] = true -- Needs review L["Announce when mail is processed because it's |cfffed000auction expired mail|r."] = true -- Needs review @@ -92,10 +90,8 @@ L["Announce when mail is processed because it's |cfffed000auction won mail|r."] = true -- Needs review L["Announce when mail is processed because it's |cfffed000normal mail containing gold|r."] = true -- Needs review L["Announce when mail is processed because it's |cfffed000normal mail containing items|r."] = true -- Needs review +L["Announce when mail is processed because..."] = true -- Needs review L["Announce when mail is processed for |cfffed000any|r reason."] = true -- Needs review -L["Announce when mail is skipped because..."] = true -- Needs review -L["Announce when mail is skipped because |cfffed000the keep free space limit has been reached|r."] = true -- Needs review -L["Announce when mail is skipped because |cfffed000your inventory is full|r."] = true -- Needs review L["Announce when mail is skipped because it's |cfffed000a Cost On Delivery mail|r."] = true -- Needs review L["Announce when mail is skipped because it's |cfffed000any other kind of mail|r (e.g. plain text)."] = true -- Needs review L["Announce when mail is skipped because it's |cfffed000auction canceled mail|r."] = true -- Needs review @@ -106,9 +102,14 @@ L["Announce when mail is skipped because it's |cfffed000mail sent by Blizzard|r."] = true -- Needs review L["Announce when mail is skipped because it's |cfffed000normal mail containing gold|r."] = true -- Needs review L["Announce when mail is skipped because it's |cfffed000normal mail containing items|r."] = true -- Needs review +L["Announce when mail is skipped because |cfffed000the keep free space limit has been reached|r."] = true -- Needs review +L["Announce when mail is skipped because |cfffed000your inventory is full|r."] = true -- Needs review +L["Announce when mail is skipped because..."] = true -- Needs review L["Announce when mail is skipped for |cfffed000any|r reason."] = true -- Needs review L["Announce when opening of the current batch of mail has been completed."] = true -- Needs review L["Announce when there is nothing left for Mail Opener to open."] = true -- Needs review +L["Announce when |cfffed000finished opening the current batch|r"] = true -- Needs review +L["Announce when |cfffed000the mailbox is completely empty|r"] = true -- Needs review L["Auction canceled mail"] = true -- Needs review L["Auction expired mail"] = true -- Needs review L["Auction outbid mail"] = true -- Needs review @@ -117,32 +118,27 @@ L["Auto opening disabled"] = true -- Needs review L["Blizzard mail"] = true -- Needs review L["Builds and loads the config frame(s) and handles the slash commands. Automatically loaded when needed."] = true -- Needs review -L["|cff00ff00Enabled|r"] = true -- Needs review -L["|cfffed000Cost on Delivery|r and |cfffed000Blizzard|r mail will always be skipped, regardless of any filters."] = true -- Needs review -L["|cfffed000Default Status|r"] = true -- Needs review -L["|cfffed000Mail Opener|r is not meant to be a full replacement of |cfffed000Postal|r, it will only handle the opening of your mail and you can run both addons simultaneously."] = true -- Needs review -L["|cfffed000Module Name|r"] = true -- Needs review -L["|cfffed000Postal|r allows you to return mail by |cfffed000alt-clicking|r the mail icon."] = true -- Needs review -L["|cfffed000Right-click|r the |cfffed000open all|r button to quickly adjust your mail opening filters."] = true -- Needs review -L["|cfffed000Status|r"] = true -- Needs review -L["|cffff0000Disabled|r"] = true -- Needs review +L["C.O.D. mail"] = true -- Needs review L["Change general Mail Opener settings."] = true -- Needs review L["Change settings for modules or toggle them on or off."] = true -- Needs review -L["C.O.D. mail"] = true -- Needs review L["Completely enabled"] = true -- Needs review L["Continue trying to open mail after your bags are full"] = true -- Needs review L["Copy URL"] = true -- Needs review L["Create a new character specific profile"] = true -- Needs review L["Create a new profile for this user. You can also make profile groups at the profiles tab to the left."] = true -- Needs review +L["Default QA Auto Mail status"] = true -- Needs review L["Default mail opener status"] = true -- Needs review -L["Default QA Auto Mail status"] = true -- Needs review L["Disabled"] = true -- Needs review L["Display help tooltips at the mailbox buttons added by Mail Opener."] = true -- Needs review L["Display the help tooltips when hovering at any of the mailbox buttons added by Mail Opener."] = true -- Needs review L["Do you wish to enable \"continue opening mail\"? Read the tip at the bottom of the \"General\" config for more information."] = true -- Needs review +L["Don't refresh the mailbox while there is still mail waiting to be opened"] = true L["Enabled"] = true -- Needs review L["Enabling the functionality. Remember you can always change this setting in the \\\"Open All\\\" config (|cff00ffff/mo c|r)."] = true -- Needs review L["General Notifications"] = true -- Needs review +L[ [=[Having this option toggled on will prevent the mailbox from automatically refreshing while there is still openable mail remaining. + +If you close the mailbox while there is still mail remaining, your client will always try to refresh the inbox when you reopen it. This feature will wait with refreshing until there is no openable mail remaining, possibly saving a few seconds.]=] ] = true L[ [=[If there are a lot of stackable items in your mailbox (e.g. glyphs) you may want to toggle this option on. This will cause your Blizzard error frame to get extremely spammy if there's a lot of mail remaining. With this disabled, Mail Opener will completely stop opening mail while your inventory is full.]=] ] = true -- Needs review @@ -163,14 +159,13 @@ L["Normal mail with gold"] = true -- Needs review L["Notifications"] = true -- Needs review L["Only once"] = true -- Needs review +L["Only play this sound once each time new mail has been arrived or your bags are updated."] = true -- Needs review L["Only play this sound once each time new mail has been arrived."] = true -- Needs review -L["Only play this sound once each time new mail has been arrived or your bags are updated."] = true -- Needs review L["Only play this sound once each time you visit the mailbox."] = true -- Needs review L["Other mail (e.g. plain text)"] = true -- Needs review -L["...per mailbox visit"] = true -- Needs review -L["Play a sound when..."] = true -- Needs review L["Play a sound when no more mail can be opened. You can select what sound in the select box next to this."] = true -- Needs review L["Play a sound when your inventory is full. You can select what sound in the select box next to this."] = true -- Needs review +L["Play a sound when..."] = true -- Needs review L["Please report |cfffed000issues|r and |cfffed000suggestions|r/|cfffed000requests|r at the |cfffed000CurseForge ticket tracker|r, I will try to process and respond to them all (you can get a link to the ticket tracker by clicking the button below)."] = true -- Needs review L[ [=[Quick Auction's auto mail is buggy when using other mail opening addons. If you are collecting mail while auto mailer is enabled wrong items may be send to the wrong character. @@ -180,48 +175,65 @@ L["Select the default Quick Auctions auto mail status whenever you open a mailbox."] = true -- Needs review L["Set Quick Auction's auto mail status |cff00ffffback|r after opening mail has finished (remember it)"] = true -- Needs review L["Sound File"] = true -- Needs review +L["Sound Notifications"] = true -- Needs review L["Sound file to play when Mail Opener can't open any more mail."] = true -- Needs review L["Sound file to play when your bags are full."] = true -- Needs review -L["Sound Notifications"] = true -- Needs review +L["To make Mail Opener automatically continue the opening of a batch of mail that had previously been interrupted, you will have to tick the \"|cfffed000Continue opening mail|r\"-box at the \"|cfffed000Open All|r\" config. By default Mail Opener will always automatically start opening mail right after a server refresh, but you will have to manually resume mail opening if it gets interrupted (e.g. because you closed the mailbox or because your bags were full)."] = true -- Needs review L["Toggle everything"] = true -- Needs review L["Toggle notifications."] = true -- Needs review L["Toggle which notification you wish to see."] = true -- Needs review -L["To make Mail Opener automatically continue the opening of a batch of mail that had previously been interrupted, you will have to tick the \"|cfffed000Continue opening mail|r\"-box at the \"|cfffed000Open All|r\" config. By default Mail Opener will always automatically start opening mail right after a server refresh, but you will have to manually resume mail opening if it gets interrupted (e.g. because you closed the mailbox or because your bags were full)."] = true -- Needs review L["Turn Quick Auction's auto mail status |cff00ff00on|r after opening mail has finished"] = true -- Needs review L["Turn Quick Auction's auto mail status |cffff0000off|r when opening mail"] = true -- Needs review L["Wrong command, available: /mo config (or /mo c)"] = true -- Needs review L["Yes"] = true -- Needs review L["You can always change this setting in the \\\"Open All\\\" config (|cff00ffff/mo c|r)."] = true -- Needs review -L["You can |cfffed000shift-click|r a mail icon to loot all attachments from that single mail."] = true -- Needs review L["You can click the time remaining text to get it into a popup dialog so you can copy it (with |cfffed000CTRL-C|r) and then paste it (with |cfffed000CTRL-V|r) elsewhere."] = true -- Needs review L["You can create a new profile to allow different behaviour for different characters. Imagine setting up a profile for your AH banker which will retrieve all sorts of mail containing items while other characters don't automatically open mail with items sent by other players."] = true -- Needs review +L["You can |cfffed000shift-click|r a mail icon to loot all attachments from that single mail."] = true -- Needs review L["You may have to increase the mail opening interval if this sound effect gets spammy. The recommended value is 10 seconds."] = true -- Needs review L["Your chance to contribute to this addon! Please help localizing Mail Opener if you master a second language supported by WoW. You can do so by clicking the button below to get a link to the localization pages, login with your Curse account and then you can start localizing."] = true -- Needs review L["Your inventory is full"] = true -- Needs review +L["|cff00ff00Enabled|r"] = true -- Needs review +L["|cfffed000Cost on Delivery|r and |cfffed000Blizzard|r mail will always be skipped, regardless of any filters."] = true -- Needs review +L["|cfffed000Default Status|r"] = true -- Needs review +L["|cfffed000Mail Opener|r is not meant to be a full replacement of |cfffed000Postal|r, it will only handle the opening of your mail and you can run both addons simultaneously."] = true -- Needs review +L["|cfffed000Module Name|r"] = true -- Needs review +L["|cfffed000Postal|r allows you to return mail by |cfffed000alt-clicking|r the mail icon."] = true -- Needs review +L["|cfffed000Right-click|r the |cfffed000open all|r button to quickly adjust your mail opening filters."] = true -- Needs review +L["|cfffed000Status|r"] = true -- Needs review +L["|cffff0000Disabled|r"] = true -- Needs review -- FailSafe +L["(FailSafe) Mail opening timeout, continuing with the next mail."] = true -- Needs review L[ [=[Change how long FailSafe should wait before skipping the last mail and continuing with the next. This should prevent mail opening getting stuck because a single mail is stuck for whatever reason. Default value is 20 seconds.]=] ] = true -- Needs review L["Change how long FailSafe should wait before skipping the last mail and continuing with the next. This will prevent mail opening getting stuck forever because a single mail is frozen for whatever reason."] = true -- Needs review L["Change settings for the FailSafe module."] = true -- Needs review L["FailSafe"] = true -- Needs review -L["(FailSafe) Mail opening timeout, continuing with the next mail."] = true -- Needs review L["Prevents the mail opening from completely stopping when the opening of a single mail gets stuck."] = true -- Needs review L["Single Mail Opening Timeout"] = true -- Needs review L["Single Mail Timeout"] = true -- Needs review +-- Indicator +L["Change settings for the Indicator module."] = true -- Needs review +L["Indicator"] = true -- Needs review +L["This mail includes mail sent by:"] = true -- Needs review +L["Uses the minimap mail icon to indicate when there is still unread mail waiting for you at the mailbox."] = true -- Needs review +L["You have %d unread mail remaining in your mailbox."] = true -- Needs review +L["You have unread mail remaining in your mailbox."] = true -- Needs review + + -- OpenAll +L["Allow shift-clicking of the |cfffed000Open All|r button to autoloot |cfffed000everything|r with attachments, temporarily overriding all filters."] = true -- Needs review L["Allow shift-clicking of the |cfffed000Open All|r button to autoloot |cfffed000everything|r, regardless of the above filters."] = true -- Needs review -L["Allow shift-clicking of the |cfffed000Open All|r button to autoloot |cfffed000everything|r with attachments, temporarily overriding all filters."] = true -- Needs review +L["Auction House Mail"] = true -- Needs review L["Auction canceled"] = true -- Needs review L["Auction expired"] = true -- Needs review -L["Auction House Mail"] = true -- Needs review L["Auction outbid"] = true -- Needs review L["Auction successful"] = true -- Needs review -L["auction won"] = true -- Needs review L["Auction won"] = true -- Needs review L["Automatically loot all auction canceled mail from the auction house."] = true -- Needs review L["Automatically loot all auction expired mail from the auction house."] = true -- Needs review @@ -231,15 +243,7 @@ L["Automatically loot all normal mail containing attachments (CoDs and Blizzard mail will be skipped)."] = true -- Needs review L["Automatically loot all normal mail containing gold (CoDs and Blizzard mail will be skipped)."] = true -- Needs review L["Blizzard mail"] = true -- Needs review -L["canceled auction"] = true -- Needs review -L["|cffff0000There is currently no mail available.|r"] = true -- Needs review -L["|cffffffff%d|r/|cffffffff%d|r mail remaining - everything will be opened soon..."] = true -- Needs review -L["|cffffffff%d|r/|cffffffff%d|r mail remaining, next refresh in |cffffffff%d|r seconds."] = true -- Needs review -L["|cffffffff%d|r/|cffffffff%d|r mail remaining, opening everything will take about |cffffffff%d|r minutes and |cffffffff%d|r seconds (next refresh in |cffffffff%d|r seconds)."] = true -- Needs review -L["|cffffffff%d|r/|cffffffff%d|r mail remaining, opening everything will take about |cffffffff%d|r minutes (next refresh in |cffffffff%d|r seconds)."] = true -- Needs review -L["|cffffffff%d|r/|cffffffff%d|r mail remaining, opening everything will take about |cffffffff%d|r seconds (next refresh in |cffffffff%d|r seconds)."] = true -- Needs review -L["|cffffffff%d|r/|cffffffff%d|r mail remaining - waiting for something from the current batch to be opened..."] = true -- Needs review -L["|cffffffff%d|r/|cffffffff%d|r mail remaining - waiting for the next mailbox refresh..."] = true -- Needs review +L["C.O.D."] = true -- Needs review L["Change open all settings."] = true -- Needs review L[ [=[Change the amount of space to reserve for other things when opening mail. @@ -254,60 +258,63 @@ The default value is 5 seconds.]=] ] = true -- Needs review L["Change the mail opening speed (in microseconds) for each mail. Lower may not always be faster."] = true -- Needs review L["Change the speed at which mail is opened. You should set the opening speed to the lowest latency you have in a city or experiment with setting it to the minimum."] = true -- Needs review -L["C.O.D."] = true -- Needs review -L["Continued Mail Opening Interval"] = true -- Needs review L["Continue opening mail"] = true -- Needs review L["Continue opening mail at the interval set below, even if the mailbox wasn't refreshed recently."] = true -- Needs review -L["expired auction"] = true -- Needs review +L["Continued Mail Opening Interval"] = true -- Needs review L["Filters"] = true -- Needs review L["Finished opening the current batch."] = true -- Needs review L[ [=[Hold |cfffed000shift|r while clicking this button to temporarily override your filters and loot every single mail containing attachments and/or gold. -|cfffed000Right|r click this button to quickly adjust mail opening filters for this profile.]=] ] = true -- Needs review +|cfffed000Right|r click this button to quickly adjust mail opening filters for this profile. + +|cfffed000Middle|r click or hold |cfffed000alt|r while clicking this button to interrupt mail opening.]=] ] = true L["Initial Mail Opening Delay"] = true -- Needs review -L["inventory is full"] = true -- Needs review +L["Interrupting mail opening as the alt key was held down while clicking the open all button or the middle mouse-button was used on it."] = true +L["Keep Free Space"] = true -- Needs review L["Keep free space"] = true -- Needs review -L["Keep Free Space"] = true -- Needs review -L["keep free space limit"] = true -- Needs review L["Mail Opener will |cff00ff00continue|r to attempt to open the remaining mail every |cfffed000%d seconds|r."] = true -- Needs review L["Mail Opener will |cffff0000not|r continue to attempt to open the remaining mail and will only start opening when new mail has just been received from the server."] = true -- Needs review -L["normal mail with attachments"] = true -- Needs review L["Normal mail with |cfffed000attachments|r"] = true -- Needs review L["Normal mail with |cfffed000gold|r"] = true -- Needs review -L["normal mail with gold"] = true -- Needs review +L["Open All"] = true -- Needs review L["Open all"] = true -- Needs review -L["Open All"] = true -- Needs review L["Open all |cfffed000auction canceled|r mail"] = true -- Needs review L["Open all |cfffed000auction expired|r mail"] = true -- Needs review L["Open all |cfffed000auction successful|r mail"] = true -- Needs review L["Open all |cfffed000auction won|r mail"] = true -- Needs review L["Open all |cfffed000outbid on|r mail"] = true -- Needs review -L["Opening..."] = true -- Needs review +L["Open single mail interval"] = true -- Needs review L["Opening Interval"] = true -- Needs review L["Opening Speed"] = true -- Needs review -L["Open single mail interval"] = true -- Needs review +L["Opening..."] = true -- Needs review L["Other mail with attachments"] = true -- Needs review L["Other mail with gold"] = true -- Needs review -L["outbid on auction"] = true -- Needs review L["Processing %d: %s"] = true -- Needs review L["Processing %d: %s (%s)"] = true -- Needs review L["Remaining Mail"] = true -- Needs review L["Shift key was held while pressing the open all button. Temporarily overriding filters; going to open every mail with attachments."] = true -- Needs review L["Skipping %d: %s"] = true -- Needs review L["Skipping %d: %s (%s)"] = true -- Needs review -L["successful auction"] = true -- Needs review L["The actual mail opening initiated by the core."] = true -- Needs review L["The default behavior for opening mail is to only do so right after new mail was received from the server. If you close the mailbox or your inventory is full before everything is opened you will have to click the open all button manually or wait for a next mailbox refresh."] = true -- Needs review L["The first batch after each server refresh will be opened after waiting |cfffed000%d seconds|r."] = true -- Needs review L["Toggle filters for %s profile."] = true -- Needs review L["Toggle which mail the opener should autoloot."] = true -- Needs review L["You can set an amount of bag space you wish to reserve when opening mail."] = true -- Needs review - - --- Indicator -L["Change settings for the Indicator module."] = "Change settings for the Indicator module." -L["Indicator"] = "Indicator" -L["This mail includes mail sent by:"] = "This mail includes mail sent by:" -L["Uses the minimap mail icon to indicate when there is still unread mail waiting for you at the mailbox."] = "Uses the minimap mail icon to indicate when there is still unread mail waiting for you at the mailbox." -L["You have %d unread mail remaining in your mailbox."] = "You have %d unread mail remaining in your mailbox." -L["You have unread mail remaining in your mailbox."] = "You have unread mail remaining in your mailbox." +L["auction won"] = true -- Needs review +L["canceled auction"] = true -- Needs review +L["expired auction"] = true -- Needs review +L["inventory is full"] = true -- Needs review +L["keep free space limit"] = true -- Needs review +L["normal mail with attachments"] = true -- Needs review +L["normal mail with gold"] = true -- Needs review +L["outbid on auction"] = true -- Needs review +L["successful auction"] = true -- Needs review +L["|cffff0000There is currently no mail available.|r"] = true -- Needs review +L["|cffffffff%d|r/|cffffffff%d|r mail remaining - everything will be opened soon..."] = true -- Needs review +L["|cffffffff%d|r/|cffffffff%d|r mail remaining - waiting for something from the current batch to be opened..."] = true -- Needs review +L["|cffffffff%d|r/|cffffffff%d|r mail remaining - waiting for the next mailbox refresh..."] = true -- Needs review +L["|cffffffff%d|r/|cffffffff%d|r mail remaining, next refresh in |cffffffff%d|r seconds."] = true -- Needs review +L["|cffffffff%d|r/|cffffffff%d|r mail remaining, opening everything will take about |cffffffff%d|r minutes (next refresh in |cffffffff%d|r seconds)."] = true -- Needs review +L["|cffffffff%d|r/|cffffffff%d|r mail remaining, opening everything will take about |cffffffff%d|r minutes and |cffffffff%d|r seconds (next refresh in |cffffffff%d|r seconds)."] = true -- Needs review +L["|cffffffff%d|r/|cffffffff%d|r mail remaining, opening everything will take about |cffffffff%d|r seconds (next refresh in |cffffffff%d|r seconds)."] = true -- Needs review
--- a/MailOpener.toc Sun Mar 10 23:09:32 2013 +0000 +++ b/MailOpener.toc Sun Mar 10 16:09:57 2013 -0700 @@ -1,8 +1,11 @@ -## Interface: 30300 -## X-Compatible-With: 40000 +## Interface: 50200 ## Title: Mail Opener ## Notes: Mail Opener will automatically retrieve all your mail from the mailbox. -## Author: Zerotorescue +<<<<<<< local +## Author: Zerotorescue, profplump +======= +## Author: Zerotorescue (at EU - Al'Akir), profplump +>>>>>>> other ## Version: @project-version@ ## SavedVariables: MailOpenerDB ## LoadManagers: AddonLoader @@ -33,4 +36,4 @@ Modules\Config.lua Modules\FailSafe.lua Modules\Indicator.lua -Modules\OpenAll.lua \ No newline at end of file +Modules\OpenAll.lua
--- a/Modules/BeanCounterSupport.lua Sun Mar 10 23:09:32 2013 +0000 +++ b/Modules/BeanCounterSupport.lua Sun Mar 10 16:09:57 2013 -0700 @@ -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;
--- a/Modules/Collected.lua Sun Mar 10 23:09:32 2013 +0000 +++ b/Modules/Collected.lua Sun Mar 10 16:09:57 2013 -0700 @@ -236,8 +236,6 @@ sessionTimeSpent = tempSessionTimeSpent; end end - - self:Debug(timeSpent); end -- Did we record any mail being opened?
--- a/Modules/Config.lua Sun Mar 10 23:09:32 2013 +0000 +++ b/Modules/Config.lua Sun Mar 10 16:09:57 2013 -0700 @@ -174,9 +174,12 @@ -- Set a nice default size AceConfigDialog:SetDefaultSize("Mail Opener", 950, 600); - -- In case the addon is loaded from another condition, always call the remove interface options - if AddonLoader and AddonLoader.RemoveInterfaceOptions then - AddonLoader:RemoveInterfaceOptions("Mail Opener"); + -- Remove our old config tab + for k, f in ipairs(INTERFACEOPTIONS_ADDONCATEGORIES) do + if f == "Mail Opener" or f.name == "Mail Opener" then + tremove(INTERFACEOPTIONS_ADDONCATEGORIES, k); + break; + end end -- Add to the blizzard addons options thing @@ -400,7 +403,16 @@ }, get = function() return MailOpener.db.profile.general.defaultQAStatus; end, set = function(i, v) MailOpener.db.profile.general.defaultQAStatus = v; end, - hidden = (not MailOpener.QuickAuctionsEnabled), + hidden = (not MailOpener.ZeroAuctionsEnabled), + }, + overrideCheckInbox = { + order = 12, + type = "toggle", + name = L["Don't refresh the mailbox while there is still mail waiting to be opened"], + desc = L["Having this option toggled on will prevent the mailbox from automatically refreshing while there is still openable mail remaining.\n\nIf you close the mailbox while there is still mail remaining, your client will always try to refresh the inbox when you reopen it. This feature will wait with refreshing until there is no openable mail remaining, possibly saving a few seconds."], + width = "full", + get = function() return MailOpener.db.profile.general.overrideCheckInbox; end, + set = function(i, v) MailOpener.db.profile.general.overrideCheckInbox = v; end, }, continueOpeningStackableItems = { order = 15, @@ -428,7 +440,7 @@ width = "full", get = function() return MailOpener.db.profile.general.autoDisableQAAutoMail; end, set = function(i, v) MailOpener.db.profile.general.autoDisableQAAutoMail = v; end, - hidden = (not MailOpener.QuickAuctionsEnabled), + hidden = (not MailOpener.ZeroAuctionsEnabled), }, autoReenableQAAutoMail = { order = 30, @@ -438,7 +450,7 @@ width = "full", get = function() return MailOpener.db.profile.general.autoReenableQAAutoMail; end, set = function(i, v) MailOpener.db.profile.general.autoReenableQAAutoMail = v; end, - hidden = (not MailOpener.QuickAuctionsEnabled), + hidden = (not MailOpener.ZeroAuctionsEnabled), disabled = function() return (MailOpener.db.profile.general.autoSetBackQAAutoMail and not MailOpener.db.profile.general.autoReenableQAAutoMail); end, }, autoSetBackQAAutoMail = { @@ -449,7 +461,7 @@ width = "full", get = function() return MailOpener.db.profile.general.autoSetBackQAAutoMail; end, set = function(i, v) MailOpener.db.profile.general.autoSetBackQAAutoMail = v; end, - hidden = (not MailOpener.QuickAuctionsEnabled), + hidden = (not MailOpener.ZeroAuctionsEnabled), disabled = function() return (MailOpener.db.profile.general.autoReenableQAAutoMail and not MailOpener.db.profile.general.autoSetBackQAAutoMail); end, }, },
--- a/Modules/OpenAll.lua Sun Mar 10 23:09:32 2013 +0000 +++ b/Modules/OpenAll.lua Sun Mar 10 16:09:57 2013 -0700 @@ -10,7 +10,7 @@ When shift clicking the Open All button it should override all filters. ]] -local MAIL_ITEM_INDEX, MAIL_OPEN_EVERYTHING, mailTimer, inventoryFull, inventoryFullSoundPlayed, inventoryFullSoundPlayedThisVisit, opening, lastSync, numCurrentMail, numHiddenMail, continue; +local MAIL_ITEM_INDEX, MAIL_OPEN_EVERYTHING, mailTimer, inventoryFull, inventoryFullSoundPlayed, inventoryFullSoundPlayedThisVisit, opening, lastSync, numCurrentMail, numHiddenMail, continue, firstOpenThisSync, takingSingleItem; function mod:OnInitialize() local defaults = { @@ -46,9 +46,16 @@ button:SetHeight(26); button:SetWidth(120); button:SetPoint("BOTTOM", InboxFrame, "CENTER", -10, -165); - button:RegisterForClicks("LeftButtonUp", "RightButtonUp"); + button:RegisterForClicks("LeftButtonUp", "RightButtonUp", "MiddleButtonUp"); button:SetScript("OnClick", function(self, mouseButton) + local action = "open"; if mouseButton == "RightButton" then + action = "menu"; + elseif mouseButton == "MiddleButton" or (mouseButton == "LeftButton" and IsAltKeyDown()) then + action = "stop"; + end + + if action == "menu" then -- Hide the gametooltip GameTooltip:Hide(); @@ -118,7 +125,7 @@ info.checked = mod.db.profile.filter.normalMoney; UIDropDownMenu_AddButton(info, level); - -- Make Other mail with gold + -- Close link info.text = CLOSE; info.func = function() CloseDropDownMenus(); end; info.checked = nil; @@ -133,12 +140,16 @@ end ToggleDropDownMenu(1, nil, mod.ddmFilters, self:GetName(), 0, 0); + elseif action == "stop" then + MailOpener:Print(L["Interrupting mail opening as the alt key was held down while clicking the open all button or the middle mouse-button was used on it."]); + + mod:StopOpening(true); else mod:Open(true, IsShiftKeyDown()); end end); button.tooltipTitle = L["Open all"]; - button.tooltip = L["Hold |cfffed000shift|r while clicking this button to temporarily override your filters and loot every single mail containing attachments and/or gold.\n\n|cfffed000Right|r click this button to quickly adjust mail opening filters for this profile."]; + button.tooltip = L["Hold |cfffed000shift|r while clicking this button to temporarily override your filters and loot every single mail containing attachments and/or gold.\n\n|cfffed000Right|r click this button to quickly adjust mail opening filters for this profile.\n\n|cfffed000Middle|r click or hold |cfffed000alt|r while clicking this button to interrupt mail opening."]; button:SetScript("OnEnter", function(self) if MailOpener.db.profile.general.showHelpTooltips then GameTooltip:SetOwner(self, "ANCHOR_NONE") @@ -271,6 +282,7 @@ self:RegisterMessage("MO_OPEN_MAIL", "Open"); self:RegisterMessage("MO_SERVER_SYNCED"); self:RegisterMessage("MO_MAIL_EMPTIED"); + self:RegisterMessage("MO_STOP_MAIL_OPENING"); self:CancelTimer(self.tmrTimeRemaining, true); self.tmrTimeRemaining = self:ScheduleRepeatingTimer("UpdateTimer", 1); @@ -292,6 +304,7 @@ self:UnregisterMessage("MO_OPEN_MAIL"); self:UnregisterMessage("MO_SERVER_SYNCED"); self:UnregisterMessage("MO_MAIL_EMPTIED"); + self:UnregisterMessage("MO_STOP_MAIL_OPENING"); self:CancelTimer(self.tmrMailOpener, true); self:CancelTimer(self.tmrTimeRemaining, true); @@ -308,6 +321,9 @@ lastSync = GetTime(); self:UpdateMailCount(); + + -- While this is true, we'll announce mail skipped - will be set to false after opening happened once + firstOpenThisSync = true; end function mod:MO_MAIL_EMPTIED() @@ -317,6 +333,10 @@ self:UpdateTimer(); end +function mod:MO_STOP_MAIL_OPENING() + self:StopOpening(true); +end + function mod:UpdateMailCount() local numItems, totalItems = GetInboxNumItems(); @@ -329,6 +349,10 @@ inventoryFull = false; -- Replay sound inventoryFullSoundPlayed = nil; + + if opening and takingSingleItem then + self:ScheduleTimer("Continue", self.db.profile.speed); + end end -- We registered this event to look for the inventory full error message because this is faster than counting the amount of items in the inventory all the time @@ -370,6 +394,9 @@ -- Stop the previous opening and restart if forced == true then + -- Show skips again + firstOpenThisSync = true; + self:StopOpening(false); -- this is not a "simple" stop, so also reset inventory full warning else self:StopOpening(true); -- forced is false - automated action - simple reset, skip inventory full reset to avoid sound spam @@ -406,11 +433,11 @@ -- Return the type of mail a message subject is local knownAHSubjectPatterns = { - canceled = AUCTION_REMOVED_MAIL_SUBJECT:replace("%s", ""), - expired = AUCTION_EXPIRED_MAIL_SUBJECT:replace("%s", ""), - outbid = AUCTION_OUTBID_MAIL_SUBJECT:replace("%s", ""), - success = AUCTION_SOLD_MAIL_SUBJECT:replace("%s", ""), - won = AUCTION_WON_MAIL_SUBJECT:replace("%s", ""), + canceled = AUCTION_REMOVED_MAIL_SUBJECT:format(""), + expired = AUCTION_EXPIRED_MAIL_SUBJECT:format(""), + outbid = AUCTION_OUTBID_MAIL_SUBJECT:format(""), + success = AUCTION_SOLD_MAIL_SUBJECT:format(""), + won = AUCTION_WON_MAIL_SUBJECT:format(""), }; function mod:GetAuctionMailType(subject) if subject then @@ -431,6 +458,8 @@ return; -- not auction mail end +local slotsAvailable; + function mod:OpenMail(index) if index and index > 0 then -- LUA arrays start at 1, so mail with index 0 doesn't exist, so we're finished @@ -440,11 +469,13 @@ if not subject then subject = ""; end + local onlyShowOnceCheck = firstOpenThisSync; + local skippingString = L["Skipping %d: %s (%s)"]; if isGM then -- Blizzard Mail - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped.GMMail then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped.GMMail then print(skippingString:format(index, subject, L["Blizzard mail"])); end @@ -453,7 +484,7 @@ return; elseif cod and cod > 0 then -- Cost on delivery - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped.COD then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped.COD then print(skippingString:format(index, subject, L["C.O.D."])); end @@ -463,7 +494,6 @@ elseif ((gold and gold > 0) or (items and items > 0)) then -- Mail with some sort of attachments - local slotsAvailable; if self.db.profile.keepFreeSpace > 0 then slotsAvailable = 0; @@ -480,7 +510,7 @@ -- and not MAIL_OPEN_EVERYTHING -- Removed above part from below if statement, I forgot why I put it here and now it makes no sense if inventoryFull and not MailOpener.db.profile.general.continueOpeningStackableItems and items and items > 0 then - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped.inventoryFull then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped.inventoryFull then print(skippingString:format(index, subject, L["inventory is full"])); end @@ -488,7 +518,7 @@ return; elseif self.db.profile.keepFreeSpace > 0 and items and slotsAvailable ~= nil and slotsAvailable <= 0 then - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit then print(skippingString:format(index, subject, L["keep free space limit"])); end @@ -514,7 +544,7 @@ end if not MAIL_OPEN_EVERYTHING and not self.db.profile.filter.normalMoney and mailType == "normalGoldMail" then - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped[mailType] then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped[mailType] then print(skippingString:format(index, subject, L["normal mail with gold"])); end @@ -522,7 +552,7 @@ return; elseif not MAIL_OPEN_EVERYTHING and not self.db.profile.filter.normalAttachments and mailType == "normalItemsMail" then - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped[mailType] then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped[mailType] then print(skippingString:format(index, subject, L["normal mail with attachments"])); end @@ -530,7 +560,7 @@ return; elseif not MAIL_OPEN_EVERYTHING and not self.db.profile.filter.AH.expired and mailType == "AHexpired" then - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped[mailType] then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped[mailType] then print(skippingString:format(index, subject, L["expired auction"])); end @@ -538,7 +568,7 @@ return; elseif not MAIL_OPEN_EVERYTHING and not self.db.profile.filter.AH.success and mailType == "AHsuccess" then - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped[mailType] then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped[mailType] then print(skippingString:format(index, subject, L["successful auction"])); end @@ -546,7 +576,7 @@ return; elseif not MAIL_OPEN_EVERYTHING and not self.db.profile.filter.AH.won and mailType == "AHwon" then - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped[mailType] then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped[mailType] then print(skippingString:format(index, subject, L["auction won"])); end @@ -554,7 +584,7 @@ return; elseif not MAIL_OPEN_EVERYTHING and not self.db.profile.filter.AH.canceled and mailType == "AHcanceled" then - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped[mailType] then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped[mailType] then print(skippingString:format(index, subject, L["canceled auction"])); end @@ -562,7 +592,7 @@ return; elseif not MAIL_OPEN_EVERYTHING and not self.db.profile.filter.AH.outbid and mailType == "AHoutbid" then - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped[mailType] then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped[mailType] then print(skippingString:format(index, subject, L["outbid on auction"])); end @@ -590,12 +620,18 @@ self:Debug("Taking attachment " .. attachIndex); TakeInboxItem(index, attachIndex); + takingSingleItem = true; + + -- We want to open the next attachment for this same mail again, so set the index one back + MAIL_ITEM_INDEX = ( MAIL_ITEM_INDEX + 1 ); -- Gained an item, lost an available slot slotsAvailable = ( slotsAvailable - 1 ); + + break; else -- No more room available, announce and go to next item - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit then print(skippingString:format(index, subject, L["keep free space limit"])); end @@ -621,13 +657,14 @@ end end + self:CancelTimer(self.tmrMailOpener, true); -- And prepare for the next self.tmrMailOpener = self:ScheduleTimer("OpenNext", self.db.profile.speed); end end else -- Unknown, probably just text - if MailOpener.db.profile.notifications.skipped.all and MailOpener.db.profile.notifications.skipped.other then + if MailOpener.db.profile.notifications.skipped.all and onlyShowOnceCheck and MailOpener.db.profile.notifications.skipped.other then print(L["Skipping %d: %s"]:format(index, subject)); end @@ -635,10 +672,13 @@ end else -- Finished! - if MailOpener.db.profile.notifications.finishedCurrentBatch then + if MailOpener.db.profile.notifications.finishedCurrentBatch and firstOpenThisSync then print(L["Finished opening the current batch."]); end + -- We have opened mail once this batch, so quit notifying + firstOpenThisSync = nil; + self:SetOpeningStatus(false); self:Debug("MO_OPEN_COMPLETE"); @@ -660,13 +700,14 @@ else -- Try again at the next interval + self:CancelTimer(self.tmrMailOpener, true); self.tmrMailOpener = self:ScheduleTimer("OpenNext", self.db.profile.speed); end end function mod:Continue() continue = true; - self:OpenNext(); + takingSingleItem = nil; end local mailRemainingPatterns = { @@ -774,6 +815,8 @@ -- Stopped opening, so allow to continue continue = true; + takingSingleItem = nil; + self:SetOpeningStatus(false); end
