Zerotorescue@0: local MailOpener = LibStub("AceAddon-3.0"):GetAddon("MailOpener"); Zerotorescue@31: local mod = MailOpener:NewModule("Config", "AceEvent-3.0", "AceTimer-3.0"); Zerotorescue@0: Zerotorescue@31: mod.moduleDescription = "Builds and loads the config frame(s) and handles the slash commands. Automatically loaded when needed."; Zerotorescue@31: mod.moduleRequired = false; Zerotorescue@4: Zerotorescue@0: local Media = LibStub("LibSharedMedia-3.0"); Zerotorescue@0: Media:Register("sound", "Cartoon FX", [[Sound\Doodad\Goblin_Lottery_Open03.wav]]); Zerotorescue@0: Media:Register("sound", "Cheer", [[Sound\Event Sounds\OgreEventCheerUnique.wav]]); Zerotorescue@0: Media:Register("sound", "Explosion", [[Sound\Doodad\Hellfire_Raid_FX_Explosion05.wav]]); Zerotorescue@0: Media:Register("sound", "Fel Nova", [[Sound\Spells\SeepingGaseous_Fel_Nova.wav]]); Zerotorescue@0: Media:Register("sound", "Fel Portal", [[Sound\Spells\Sunwell_Fel_PortalStand.wav]]); Zerotorescue@0: Media:Register("sound", "Magic Click", [[Sound\interface\MagicClick.wav]]); Zerotorescue@0: Media:Register("sound", "Rubber Ducky", [[Sound\Doodad\Goblin_Lottery_Open01.wav]]); Zerotorescue@0: Media:Register("sound", "Shing!", [[Sound\Doodad\PortcullisActive_Closed.wav]]); Zerotorescue@0: Media:Register("sound", "Simon Chime", [[Sound\Doodad\SimonGame_LargeBlueTree.wav]]); Zerotorescue@0: Media:Register("sound", "Simon Error", [[Sound\Spells\SimonGame_Visual_BadPress.wav]]); Zerotorescue@0: Media:Register("sound", "Simon Start", [[Sound\Spells\SimonGame_Visual_GameStart.wav]]); Zerotorescue@0: Media:Register("sound", "War Drums", [[Sound\Event Sounds\Event_wardrum_ogre.wav]]); Zerotorescue@0: Media:Register("sound", "Wham!", [[Sound\Doodad\PVP_Lordaeron_Door_Open.wav]]); Zerotorescue@0: Media:Register("sound", "Whisper Ping", [[Sound\interface\iTellMessage.wav]]); Zerotorescue@0: Media:Register("sound", "You Will Die!", [[Sound\Creature\CThun\CThunYouWillDIe.wav]]); Zerotorescue@0: Zerotorescue@0: local AceConfigDialog; Zerotorescue@60: Zerotorescue@60: local tip; -- if this is nil, it will be filled with a table, once that table is processed, this var will be re-used with the currently selected tip Zerotorescue@0: Zerotorescue@31: function mod:OnEnable() Zerotorescue@0: MailOpener:Debug("Enabling |cff00ffffConfig|r module."); Zerotorescue@60: Zerotorescue@60: if MailOpener.db.global.currentTip == -1 and MailOpener.db.profile.general.continueOpening == false then Zerotorescue@60: StaticPopupDialogs["MailOpenerFirstConfigUseConfirmBox"] = { Zerotorescue@60: text = "Do you wish to enable \"continue opening mail\"? Read the tip at the bottom of the \"General\" config for more information.", Zerotorescue@60: button1 = "Yes", Zerotorescue@60: button2 = "No", Zerotorescue@60: OnAccept = function() Zerotorescue@60: MailOpener.db.profile.general.continueOpening = true; Zerotorescue@60: Zerotorescue@60: print("|cff15ff00Mail Opener|r: Enabling the functionality. Remember you can always change this setting in the \"Open All\" config (|cff00ffff/mo c|r)."); Zerotorescue@60: end, Zerotorescue@60: OnCancel = function (_,reason) Zerotorescue@60: print("|cff15ff00Mail Opener|r: You can always change this setting in the \"Open All\" config (|cff00ffff/mo c|r)."); Zerotorescue@60: end, Zerotorescue@60: timeout = 0, Zerotorescue@60: whileDead = 1, Zerotorescue@60: hideOnEscape = 1, Zerotorescue@60: }; Zerotorescue@60: StaticPopup_Show("MailOpenerFirstConfigUseConfirmBox"); Zerotorescue@60: end Zerotorescue@60: Zerotorescue@60: if tip == nil then Zerotorescue@60: self:NextTip(); Zerotorescue@60: Zerotorescue@60: self:GetTip(); Zerotorescue@60: end Zerotorescue@60: end Zerotorescue@60: Zerotorescue@60: function mod:GetTip() Zerotorescue@60: -- First we fill the global "tip" with our table Zerotorescue@60: -- Then we erase tips that are irrelevant to us Zerotorescue@60: -- and finally the table will be replaced with the currently selected tip Zerotorescue@60: Zerotorescue@60: -- Can't put this in the abive scope as the ADDONEnable vars would then always be empty Zerotorescue@60: tip = { Zerotorescue@62: "To make Mail Opener automatically continue the opening of a batch of mail that had previously been interupted, 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 interupted (e.g. because you closed the mailbox or because your bags were full).", Zerotorescue@62: "You can |cfffed000shift-click|r a mail icon to loot all attachments from that single mail.", Zerotorescue@62: { Zerotorescue@62: txt = "|cfffed000Postal|r allows you to return mail by |cfffed000alt-clicking|r the mail icon.", Zerotorescue@62: shown = (MailOpener.PostalEnabled), Zerotorescue@62: }, Zerotorescue@62: { Zerotorescue@62: txt = "|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.", Zerotorescue@62: shown = (MailOpener.PostalEnabled), Zerotorescue@62: }, Zerotorescue@62: "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.", Zerotorescue@60: { Zerotorescue@60: txt = "If you are looking for an addon with many handy modifications for |cfffed000sending|r mail, you might want to consider |cfffed000Postal|r.", Zerotorescue@60: shown = (not MailOpener.PostalEnabled), Zerotorescue@60: }, Zerotorescue@62: "|cfffed000Cost on Delivery|r and |cfffed000Blizzard|r mail will always be skipped, regardless of any filters.", Zerotorescue@62: "|cfffed000Right-click|r the |cfffed000open all|r button to quickly adjust your mail opening filters.", Zerotorescue@62: "|cfffed000Shift-click|r the |cfffed000open all|r button to temporarily override your filters and loot every single mail containing attachments and/or gold.", Zerotorescue@60: }; Zerotorescue@60: Zerotorescue@60: -- Remove any "hidden" tips Zerotorescue@60: for i = table.getn(tip), 1 do Zerotorescue@60: local val = tip[i]; Zerotorescue@60: Zerotorescue@60: if type(val) == "table" and val.shown == false then Zerotorescue@60: table.remove(tip, i); Zerotorescue@60: end Zerotorescue@60: end Zerotorescue@60: Zerotorescue@60: -- Find our current tip Zerotorescue@60: local tipsAvailable = table.getn(tip); Zerotorescue@60: local selectedTip = ( ( MailOpener.db.global.currentTip % tipsAvailable ) + 1 ); -- this should return a value between 1 and tipsAvailable Zerotorescue@60: Zerotorescue@60: if selectedTip < 1 then Zerotorescue@60: -- If we're going under zero, we'll use the last tip available instead Zerotorescue@60: MailOpener.db.global.currentTip = tipsAvailable; Zerotorescue@60: end Zerotorescue@60: Zerotorescue@60: -- We don't need to leave the tip-table in memory, so overwrite it Zerotorescue@60: if type(tip[selectedTip]) == "table" then Zerotorescue@60: tip = tip[selectedTip]['txt']; Zerotorescue@60: else Zerotorescue@60: tip = tip[selectedTip]; Zerotorescue@60: end Zerotorescue@60: end Zerotorescue@60: Zerotorescue@60: function mod:NextTip() Zerotorescue@60: MailOpener.db.global.currentTip = ( MailOpener.db.global.currentTip + 1 ); Zerotorescue@0: end Zerotorescue@0: Zerotorescue@31: function mod:CommandHandler(message) Zerotorescue@0: local cmd, arg = string.split(" ", (message or ""), 2); Zerotorescue@0: cmd = string.lower(cmd); Zerotorescue@0: Zerotorescue@0: if cmd == "c" or cmd == "config" or cmd == "conf" or cmd == "option" or cmd == "options" or cmd == "opt" or cmd == "setting" or cmd == "settings" then Zerotorescue@0: self:Show(); Zerotorescue@0: elseif cmd == "d" or cmd == "debug" then Zerotorescue@0: MailOpener.debugChannel = false; Zerotorescue@0: for i = 1, NUM_CHAT_WINDOWS do Zerotorescue@0: local name = GetChatWindowInfo(i); Zerotorescue@0: Zerotorescue@0: if name:upper() == "DEBUG" then Zerotorescue@0: MailOpener.debugChannel = _G["ChatFrame" .. i]; Zerotorescue@0: Zerotorescue@46: print("A debug channel already exists, used the old one. (" .. i .. ")"); Zerotorescue@0: return; Zerotorescue@0: end Zerotorescue@0: end Zerotorescue@0: Zerotorescue@0: if not MailOpener.debugChannel then Zerotorescue@0: -- Create a new debug channel Zerotorescue@0: local chatFrame = FCF_OpenNewWindow('Debug'); Zerotorescue@0: ChatFrame_RemoveAllMessageGroups(chatFrame); Zerotorescue@0: MailOpener.debugChannel = chatFrame; Zerotorescue@0: Zerotorescue@0: print("New debug channel created."); Zerotorescue@0: end Zerotorescue@0: else Zerotorescue@0: print("Wrong command, available: /mo config (or /mo c)"); Zerotorescue@0: end Zerotorescue@0: end Zerotorescue@0: Zerotorescue@31: function mod:Load() Zerotorescue@0: if not AceConfigDialog then Zerotorescue@0: local options = self:GetOptions(); Zerotorescue@0: Zerotorescue@47: -- We have been pretty sloppy with tables in self:GetOptions(), but since this is only executed once and for readability we'll leave it this way Zerotorescue@47: -- Instead, do a garbage collection Zerotorescue@47: collectgarbage(); Zerotorescue@47: Zerotorescue@0: -- Build options dialog Zerotorescue@0: AceConfigDialog = LibStub("AceConfigDialog-3.0"); Zerotorescue@0: -- Register options table Zerotorescue@0: LibStub("AceConfig-3.0"):RegisterOptionsTable("Mail Opener", options); Zerotorescue@0: -- Set a nice default size Zerotorescue@0: AceConfigDialog:SetDefaultSize("Mail Opener", 950, 600); Zerotorescue@0: Zerotorescue@0: -- In case the addon is loaded from another condition, always call the remove interface options Zerotorescue@0: if AddonLoader and AddonLoader.RemoveInterfaceOptions then Zerotorescue@0: AddonLoader:RemoveInterfaceOptions("Mail Opener"); Zerotorescue@0: end Zerotorescue@0: Zerotorescue@0: -- Add to the blizzard addons options thing Zerotorescue@0: AceConfigDialog:AddToBlizOptions("Mail Opener"); Zerotorescue@0: end Zerotorescue@0: end Zerotorescue@0: Zerotorescue@31: function mod:Show() Zerotorescue@0: self:Load(); Zerotorescue@0: Zerotorescue@0: AceConfigDialog:Open("Mail Opener"); Zerotorescue@0: end Zerotorescue@0: Zerotorescue@31: function mod:GetOptions() Zerotorescue@0: local options = { Zerotorescue@0: type = "group", Zerotorescue@0: name = "Mail Opener", Zerotorescue@0: childGroups = "tree", Zerotorescue@0: args = { Zerotorescue@0: }, Zerotorescue@0: }; Zerotorescue@0: Zerotorescue@0: options.args.general = self:GetGeneralOptions(); Zerotorescue@0: Zerotorescue@0: options.args.notifications = self:GetNotificationsOptions(); Zerotorescue@0: Zerotorescue@0: options = self:GetModuleOptions(options); Zerotorescue@0: Zerotorescue@0: options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(MailOpener.db, true); Zerotorescue@0: options.args.profiles.order = 1000; -- we want this as last group Zerotorescue@0: Zerotorescue@0: return options; Zerotorescue@0: end Zerotorescue@0: Zerotorescue@31: -- Get the options group for every one of our modules Zerotorescue@31: function mod:GetModuleOptions(options) Zerotorescue@31: -- Go through all our modules Zerotorescue@0: for name, module in MailOpener:IterateModules() do Zerotorescue@31: -- Look if they even have an options group Zerotorescue@0: if module.GetOptionsGroup then Zerotorescue@31: -- Get that options group Zerotorescue@31: local moduleGroup = module:GetOptionsGroup(); Zerotorescue@31: Zerotorescue@31: -- If it's set to be a subgroup of the modules group, put it there Zerotorescue@31: if moduleGroup['type'] == "modulesSubGroup" then Zerotorescue@31: moduleGroup['type'] = "group"; Zerotorescue@31: Zerotorescue@31: -- If the modules group doesn't exist yet, make it Zerotorescue@31: if options.args.Modules == nil then Zerotorescue@31: options.args.Modules = self:GetModuleGroupsContainer(); Zerotorescue@31: end Zerotorescue@31: Zerotorescue@31: -- Add to the modules sub group Zerotorescue@31: options.args.Modules.args[name] = moduleGroup; Zerotorescue@31: else Zerotorescue@31: options.args[name] = moduleGroup; Zerotorescue@31: end Zerotorescue@31: Zerotorescue@0: end Zerotorescue@0: end Zerotorescue@0: Zerotorescue@0: return options; Zerotorescue@0: end Zerotorescue@0: Zerotorescue@31: function mod:GetModuleGroupsContainer() Zerotorescue@31: local modulesConfigGroup = { Zerotorescue@31: order = 400, Zerotorescue@31: type = "group", Zerotorescue@31: childGroups = "tree", Zerotorescue@31: name = "Modules", Zerotorescue@31: desc = "Change settings for modules or toggle them on or off.", Zerotorescue@31: args = { Zerotorescue@31: General = { Zerotorescue@31: order = 10, Zerotorescue@31: type = "group", Zerotorescue@31: inline = true, Zerotorescue@31: name = "Modules Status", Zerotorescue@31: args = { Zerotorescue@31: headerName = { Zerotorescue@31: order = 0, Zerotorescue@31: width = "normal", Zerotorescue@31: type = "description", Zerotorescue@31: fontSize = "medium", Zerotorescue@31: name = "|cfffed000Module Name|r", Zerotorescue@31: }, Zerotorescue@31: headerStatus = { Zerotorescue@31: order = 1, Zerotorescue@31: width = "half", Zerotorescue@31: type = "description", Zerotorescue@31: fontSize = "medium", Zerotorescue@31: name = "|cfffed000Status|r", Zerotorescue@31: }, Zerotorescue@31: headerDefault = { Zerotorescue@31: order = 2, Zerotorescue@43: width = "double", Zerotorescue@31: type = "description", Zerotorescue@31: fontSize = "medium", Zerotorescue@31: name = "|cfffed000Default Status|r", Zerotorescue@31: }, Zerotorescue@31: headerseperator = { Zerotorescue@31: order = 3, Zerotorescue@31: type = "description", Zerotorescue@31: name = "", Zerotorescue@31: }, Zerotorescue@31: }, Zerotorescue@31: }, Zerotorescue@31: }, Zerotorescue@31: }; Zerotorescue@31: Zerotorescue@31: -- Make a list of modules and their statuses Zerotorescue@31: local orderNo = 5; Zerotorescue@31: for moduleName, module in MailOpener:IterateModules() do Zerotorescue@31: -- Display each module as NAME CURRENT STATUS DEFAULT STATUS Zerotorescue@31: Zerotorescue@31: -- Name Zerotorescue@31: modulesConfigGroup.args.General.args[moduleName .. "name"] = { Zerotorescue@31: order = orderNo, Zerotorescue@31: width = "normal", Zerotorescue@31: type = "description", Zerotorescue@31: fontSize = "medium", Zerotorescue@31: name = function() Zerotorescue@31: return moduleName; Zerotorescue@31: end, Zerotorescue@31: }; Zerotorescue@31: -- Current status Zerotorescue@31: modulesConfigGroup.args.General.args[moduleName .. "status"] = { Zerotorescue@31: order = ( orderNo + 1 ), Zerotorescue@31: width = "half", Zerotorescue@31: type = "description", Zerotorescue@31: fontSize = "medium", Zerotorescue@31: name = function() Zerotorescue@31: if module:IsEnabled() then Zerotorescue@31: return "|cff00ff00Enabled|r"; Zerotorescue@31: else Zerotorescue@31: return "|cffff0000Disabled|r"; Zerotorescue@31: end Zerotorescue@31: end, Zerotorescue@31: }; Zerotorescue@31: -- Default status Zerotorescue@31: modulesConfigGroup.args.General.args[moduleName .. "default"] = { Zerotorescue@31: order = ( orderNo + 2 ), Zerotorescue@43: width = "double", Zerotorescue@31: type = "description", Zerotorescue@31: fontSize = "medium", Zerotorescue@31: name = function() Zerotorescue@31: local desc = ""; Zerotorescue@31: if MailOpener.db.profile.modules[moduleName] == nil or MailOpener.db.profile.modules[moduleName] == true then Zerotorescue@31: desc = "|cff00ff00Enabled|r"; Zerotorescue@31: else Zerotorescue@31: desc = "|cffff0000Disabled|r"; Zerotorescue@31: end Zerotorescue@31: Zerotorescue@31: if module.moduleRequired then Zerotorescue@31: desc = desc .. " (Required module)"; Zerotorescue@31: end Zerotorescue@31: Zerotorescue@31: return desc; Zerotorescue@31: end, Zerotorescue@31: }; Zerotorescue@31: Zerotorescue@31: -- Seperator Zerotorescue@31: modulesConfigGroup.args.General.args[moduleName .. "seperator"] = { Zerotorescue@31: order = ( orderNo + 3 ), Zerotorescue@31: type = "description", Zerotorescue@31: name = "", Zerotorescue@31: }; Zerotorescue@31: Zerotorescue@31: if module.moduleDescription then Zerotorescue@31: -- Description Zerotorescue@31: modulesConfigGroup.args.General.args[moduleName .. "description"] = { Zerotorescue@31: order = ( orderNo + 4 ), Zerotorescue@31: type = "description", Zerotorescue@31: name = function() Zerotorescue@31: return "|cfffed000" .. module.moduleDescription .. "|r"; Zerotorescue@31: end, Zerotorescue@31: }; Zerotorescue@31: end Zerotorescue@31: Zerotorescue@31: orderNo = orderNo + 5; Zerotorescue@31: end Zerotorescue@31: Zerotorescue@31: return modulesConfigGroup; Zerotorescue@31: end Zerotorescue@31: Zerotorescue@31: function mod:GetGeneralOptions() Zerotorescue@0: local generalConfigGroup = { Zerotorescue@0: order = 100, Zerotorescue@0: type = "group", Zerotorescue@0: name = "General", Zerotorescue@0: desc = "Change general Mail Opener settings.", Zerotorescue@0: args = { Zerotorescue@0: -- General config inline group Zerotorescue@0: generalConfig = { Zerotorescue@0: order = 10, Zerotorescue@0: type = "group", Zerotorescue@0: inline = true, Zerotorescue@0: name = "General", Zerotorescue@0: args = { Zerotorescue@0: defaultStatus = { Zerotorescue@0: order = 0, Zerotorescue@0: type = "select", Zerotorescue@0: name = "Default mail opener status", Zerotorescue@0: desc = "Select the default Mail Opener status when you open a mailbox for the first time since your log on.", Zerotorescue@0: values = { Zerotorescue@4: _enabled = "Completely enabled", Zerotorescue@4: disabled = "Auto opening disabled", Zerotorescue@4: xdisabled = "Addon Disabled", Zerotorescue@0: }, Zerotorescue@0: get = function() return MailOpener.db.profile.general.defaultStatus; end, Zerotorescue@0: set = function(i, v) MailOpener.db.profile.general.defaultStatus = v; end, Zerotorescue@0: }, Zerotorescue@0: defaultQAStatus = { Zerotorescue@0: order = 10, Zerotorescue@0: type = "select", Zerotorescue@0: name = "Default QA Auto Mail status", Zerotorescue@0: desc = "Select the default Quick Auctions auto mail status whenever you open a mailbox.", Zerotorescue@0: values = { Zerotorescue@0: __remember = "Remember", Zerotorescue@0: _enabled = "Enabled", Zerotorescue@0: disabled = "Disabled", Zerotorescue@0: }, Zerotorescue@0: get = function() return MailOpener.db.profile.general.defaultQAStatus; end, Zerotorescue@0: set = function(i, v) MailOpener.db.profile.general.defaultQAStatus = v; end, Zerotorescue@0: hidden = (not MailOpener.QuickAuctionsEnabled), Zerotorescue@0: }, Zerotorescue@0: continueOpeningStackableItems = { Zerotorescue@0: order = 15, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Continue trying to open mail after your bags are full", Zerotorescue@54: desc = "If there are a lot of stackable items in your mailbox (e.g. glyphs) you may want to toggle this option on.\n\nThis 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.", Zerotorescue@0: width = "full", Zerotorescue@0: get = function() return MailOpener.db.profile.general.continueOpeningStackableItems; end, Zerotorescue@0: set = function(i, v) MailOpener.db.profile.general.continueOpeningStackableItems = v; end, Zerotorescue@0: }, Zerotorescue@51: showHelpTooltips = { Zerotorescue@51: order = 17, Zerotorescue@51: type = "toggle", Zerotorescue@51: name = "Display help tooltips at the mailbox buttons added by Mail Opener.", Zerotorescue@51: desc = "Display the help tooltips when hovering at any of the mailbox buttons added by Mail Opener.", Zerotorescue@51: width = "full", Zerotorescue@51: get = function() return MailOpener.db.profile.general.showHelpTooltips; end, Zerotorescue@51: set = function(i, v) MailOpener.db.profile.general.showHelpTooltips = v; end, Zerotorescue@51: }, Zerotorescue@0: autoDisableQAAutoMail = { Zerotorescue@0: order = 20, Zerotorescue@0: type = "toggle", Zerotorescue@39: name = "Turn Quick Auction's auto mail status |cffff0000off|r when opening mail", Zerotorescue@39: desc = "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.\n\nTo solve this you must disable Quick Auction's auto mail while opening mail and you can re-enable it when mail opening is finished.", Zerotorescue@0: width = "full", Zerotorescue@0: get = function() return MailOpener.db.profile.general.autoDisableQAAutoMail; end, Zerotorescue@0: set = function(i, v) MailOpener.db.profile.general.autoDisableQAAutoMail = v; end, Zerotorescue@0: hidden = (not MailOpener.QuickAuctionsEnabled), Zerotorescue@0: }, Zerotorescue@0: autoReenableQAAutoMail = { Zerotorescue@0: order = 30, Zerotorescue@0: type = "toggle", Zerotorescue@39: name = "Turn Quick Auction's auto mail status |cff00ff00on|r after opening mail has finished", Zerotorescue@39: desc = "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.\n\nTo solve this you must disable Quick Auction's auto mail while opening mail and you can re-enable it when mail opening is finished.", Zerotorescue@0: width = "full", Zerotorescue@0: get = function() return MailOpener.db.profile.general.autoReenableQAAutoMail; end, Zerotorescue@0: set = function(i, v) MailOpener.db.profile.general.autoReenableQAAutoMail = v; end, Zerotorescue@0: hidden = (not MailOpener.QuickAuctionsEnabled), Zerotorescue@0: disabled = function() return (MailOpener.db.profile.general.autoSetBackQAAutoMail and not MailOpener.db.profile.general.autoReenableQAAutoMail); end, Zerotorescue@0: }, Zerotorescue@0: autoSetBackQAAutoMail = { Zerotorescue@0: order = 40, Zerotorescue@0: type = "toggle", Zerotorescue@39: name = "Set Quick Auction's auto mail status |cff00ffffback|r after opening mail has finished (remember it)", Zerotorescue@0: desc = "Instead of always turning Quick Auction's auto mail on after mail opening you can choose to set it back to the value it was prior to opening mail.", Zerotorescue@0: width = "full", Zerotorescue@0: get = function() return MailOpener.db.profile.general.autoSetBackQAAutoMail; end, Zerotorescue@0: set = function(i, v) MailOpener.db.profile.general.autoSetBackQAAutoMail = v; end, Zerotorescue@0: hidden = (not MailOpener.QuickAuctionsEnabled), Zerotorescue@0: disabled = function() return (MailOpener.db.profile.general.autoReenableQAAutoMail and not MailOpener.db.profile.general.autoSetBackQAAutoMail); end, Zerotorescue@0: }, Zerotorescue@0: }, Zerotorescue@0: }, -- end General config inline group Zerotorescue@0: -- Profile config inline group Zerotorescue@0: profileConfig = { Zerotorescue@0: order = 15, Zerotorescue@0: type = "group", Zerotorescue@0: inline = true, Zerotorescue@0: name = "New Character Specfic Profile", Zerotorescue@0: args = { Zerotorescue@0: description = { Zerotorescue@0: order = 10, Zerotorescue@0: type = "description", Zerotorescue@0: name = "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.", Zerotorescue@0: }, Zerotorescue@0: header = { Zerotorescue@0: order = 15, Zerotorescue@0: type = "header", Zerotorescue@0: name = "", Zerotorescue@0: }, Zerotorescue@0: createNewProfile = { Zerotorescue@0: order = 20, Zerotorescue@0: type = "execute", Zerotorescue@0: name = "Create a new character specific profile", Zerotorescue@0: desc = "Create a new profile for this user. You can also make profile groups at the profiles tab to the left.", Zerotorescue@0: width = "double", Zerotorescue@0: func = function() Zerotorescue@0: MailOpener.db:SetProfile(UnitName("player") .. " - " .. GetRealmName()); Zerotorescue@0: end, Zerotorescue@0: }, Zerotorescue@0: }, Zerotorescue@0: }, -- end Profile config inline group Zerotorescue@60: -- Tip Zerotorescue@60: tipConfig = { Zerotorescue@60: order = 20, Zerotorescue@60: type = "group", Zerotorescue@60: inline = true, Zerotorescue@60: name = "Mail Opening Tip", Zerotorescue@60: args = { Zerotorescue@60: description = { Zerotorescue@60: order = 10, Zerotorescue@60: type = "description", Zerotorescue@60: fontSize = "medium", Zerotorescue@60: name = function() return tip; end, Zerotorescue@60: }, Zerotorescue@60: nextTip = { Zerotorescue@60: order = 20, Zerotorescue@60: type = "execute", Zerotorescue@60: name = "Next Tip", Zerotorescue@60: width = "half", Zerotorescue@60: func = function() self:NextTip(); self:GetTip(); end, Zerotorescue@60: }, Zerotorescue@60: }, Zerotorescue@60: }, -- end Tip Zerotorescue@0: }, Zerotorescue@0: }; Zerotorescue@0: Zerotorescue@0: return generalConfigGroup; Zerotorescue@0: end Zerotorescue@0: Zerotorescue@31: function mod:GetNotificationsOptions() Zerotorescue@0: local notificationsConfigGroup = { Zerotorescue@0: order = 200, Zerotorescue@0: type = "group", Zerotorescue@0: name = "Notifications", Zerotorescue@0: desc = "Toggle notifications.", Zerotorescue@0: args = { Zerotorescue@0: -- Notifications config inline group Zerotorescue@0: nofitications = { Zerotorescue@0: order = 10, Zerotorescue@0: type = "group", Zerotorescue@0: inline = true, Zerotorescue@0: name = "Notifications", Zerotorescue@0: args = { Zerotorescue@0: description = { Zerotorescue@0: order = 10, Zerotorescue@0: type = "description", Zerotorescue@0: name = "Toggle which notification you wish to see.", Zerotorescue@0: }, Zerotorescue@0: }, Zerotorescue@0: }, -- end Notifications config inline group Zerotorescue@0: Zerotorescue@0: -- General Notifications config inline group Zerotorescue@0: general = { Zerotorescue@0: order = 20, Zerotorescue@0: type = "group", Zerotorescue@0: inline = true, Zerotorescue@0: name = "General Notifications", Zerotorescue@0: args = { Zerotorescue@62: --[[welcome = { Zerotorescue@0: order = 20, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Show message when |cfffed000opening the mailbox|r", Zerotorescue@0: desc = "Print the welcome message whenever you open the mailbox.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.welcome = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.welcome; end, Zerotorescue@0: width = "double", Zerotorescue@0: }, Zerotorescue@0: bye = { Zerotorescue@0: order = 21, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Show message when |cfffed000closing the mailbox|r", Zerotorescue@0: desc = "Print the bye message whenever you close the mailbox.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.bye = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.bye; end, Zerotorescue@0: width = "double", Zerotorescue@62: },]] Zerotorescue@0: fishedOpeningBatch = { Zerotorescue@0: order = 22, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Announce when |cfffed000finished opening the current batch|r", Zerotorescue@54: desc = "Announce when opening of the current batch of mail has been completed.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.finishedCurrentBatch = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.finishedCurrentBatch; end, Zerotorescue@0: width = "double", Zerotorescue@0: }, Zerotorescue@0: noMoreMailAvailable = { Zerotorescue@0: order = 23, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Announce when |cfffed000the mailbox is completely empty|r", Zerotorescue@0: desc = "Announce when there is nothing left for Mail Opener to open.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.mailboxIsEmpty = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.mailboxIsEmpty; end, Zerotorescue@0: width = "double", Zerotorescue@0: }, Zerotorescue@0: }, Zerotorescue@0: }, -- end General Notifications config inline group Zerotorescue@0: Zerotorescue@0: -- Mail Skipped Notifications config inline group Zerotorescue@0: mailSkipped = { Zerotorescue@0: order = 30, Zerotorescue@0: type = "group", Zerotorescue@0: inline = true, Zerotorescue@0: name = "Mail Skipped Notifications", Zerotorescue@0: args = { Zerotorescue@0: descriptionMailSkipped = { Zerotorescue@0: order = 31, Zerotorescue@0: type = "description", Zerotorescue@0: name = "Announce when mail is skipped because...", Zerotorescue@0: }, Zerotorescue@0: Zerotorescue@0: skippedToggleAll = { Zerotorescue@0: order = 35, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Toggle everything", Zerotorescue@0: desc = "Announce when mail is skipped for |cfffed000any|r reason.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.all = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.all; end, Zerotorescue@0: }, Zerotorescue@0: skippedInventoryFull = { Zerotorescue@0: order = 36, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Your inventory is full", Zerotorescue@0: desc = "Announce when mail is skipped because |cfffed000your inventory is full|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.inventoryFull = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.inventoryFull; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedKeepFreeSpaceLimit = { Zerotorescue@0: order = 37, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Keep free space limit reached", Zerotorescue@0: desc = "Announce when mail is skipped because |cfffed000the keep free space limit has been reached|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedGMMail = { Zerotorescue@0: order = 38, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "GM mail", Zerotorescue@0: desc = "Announce when mail is skipped because it's |cfffed000mail sent by a Game Master|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.GMMail = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.GMMail; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedCOD = { Zerotorescue@0: order = 39, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "C.O.D. mail", Zerotorescue@0: desc = "Announce when mail is skipped because it's |cfffed000a Cost On Delivery mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.COD = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.COD; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedNormalGoldMail = { Zerotorescue@0: order = 40, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Normal mail with gold", Zerotorescue@0: desc = "Announce when mail is skipped because it's |cfffed000normal mail containing gold|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.normalGoldMail = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.normalGoldMail; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedNormalItemsMail = { Zerotorescue@0: order = 41, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Normal mail with attachments", Zerotorescue@0: desc = "Announce when mail is skipped because it's |cfffed000normal mail containing items|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.normalItemsMail = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.normalItemsMail; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedAHExpired = { Zerotorescue@0: order = 42, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Auction expired mail", Zerotorescue@0: desc = "Announce when mail is skipped because it's |cfffed000auction expired mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.AHexpired = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.AHexpired; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedAHSuccessful = { Zerotorescue@0: order = 43, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Auction successful mail", Zerotorescue@0: desc = "Announce when mail is skipped because it's |cfffed000auction successful mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.AHsuccess = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.AHsuccess; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedAHWon = { Zerotorescue@0: order = 44, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Auction won mail", Zerotorescue@0: desc = "Announce when mail is skipped because it's |cfffed000auction won mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.AHwon = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.AHwon; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedAHCanceled = { Zerotorescue@0: order = 45, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Auction canceled mail", Zerotorescue@0: desc = "Announce when mail is skipped because it's |cfffed000auction canceled mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.AHcanceled = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.AHcanceled; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedAHOutbid = { Zerotorescue@0: order = 46, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Auction outbid mail", Zerotorescue@0: desc = "Announce when mail is skipped because it's |cfffed000auction outbid mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.AHoutbid = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.AHoutbid; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: skippedOther = { Zerotorescue@0: order = 47, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Other mail (e.g. plain text)", Zerotorescue@0: desc = "Announce when mail is skipped because it's |cfffed000any other kind of mail|r (e.g. plain text).", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.skipped.other = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.skipped.other; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, Zerotorescue@0: }, Zerotorescue@0: }, Zerotorescue@0: }, -- end Mail Skipped Notifications config inline group Zerotorescue@0: Zerotorescue@0: -- Mail Processed Notifications config inline group Zerotorescue@0: mailProcessed = { Zerotorescue@0: order = 40, Zerotorescue@0: type = "group", Zerotorescue@0: inline = true, Zerotorescue@0: name = "Mail Processed Notifications", Zerotorescue@0: args = { Zerotorescue@0: descriptionMailProcessed = { Zerotorescue@0: order = 61, Zerotorescue@0: type = "description", Zerotorescue@0: name = "Announce when mail is processed because...", Zerotorescue@0: }, Zerotorescue@0: Zerotorescue@0: processedToggleAll = { Zerotorescue@0: order = 65, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Toggle everything", Zerotorescue@0: desc = "Announce when mail is processed for |cfffed000any|r reason.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.processed.all = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.processed.all; end, Zerotorescue@0: }, Zerotorescue@0: processedNormalGoldMail = { Zerotorescue@0: order = 70, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Normal mail with gold", Zerotorescue@0: desc = "Announce when mail is processed because it's |cfffed000normal mail containing gold|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.processed.normalGoldMail = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.processed.normalGoldMail; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, Zerotorescue@0: }, Zerotorescue@0: processedNormalItemsMail = { Zerotorescue@0: order = 71, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Normal mail with attachments", Zerotorescue@0: desc = "Announce when mail is processed because it's |cfffed000normal mail containing items|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.processed.normalItemsMail = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.processed.normalItemsMail; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, Zerotorescue@0: }, Zerotorescue@0: processedAHExpired = { Zerotorescue@0: order = 72, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Auction expired mail", Zerotorescue@0: desc = "Announce when mail is processed because it's |cfffed000auction expired mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.processed.AHexpired = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.processed.AHexpired; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, Zerotorescue@0: }, Zerotorescue@0: processedAHSuccessful = { Zerotorescue@0: order = 73, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Auction successful mail", Zerotorescue@0: desc = "Announce when mail is processed because it's |cfffed000auction successful mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.processed.AHsuccess = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.processed.AHsuccess; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, Zerotorescue@0: }, Zerotorescue@0: processedAHWon = { Zerotorescue@0: order = 74, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Auction won mail", Zerotorescue@0: desc = "Announce when mail is processed because it's |cfffed000auction won mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.processed.AHwon = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.processed.AHwon; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, Zerotorescue@0: }, Zerotorescue@0: processedAHCanceled = { Zerotorescue@0: order = 75, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Auction canceled mail", Zerotorescue@0: desc = "Announce when mail is processed because it's |cfffed000auction canceled mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.processed.AHcanceled = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.processed.AHcanceled; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, Zerotorescue@0: }, Zerotorescue@0: processedAHOutbid = { Zerotorescue@0: order = 76, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Auction outbid mail", Zerotorescue@0: desc = "Announce when mail is processed because it's |cfffed000auction outbid mail|r.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.processed.AHoutbid = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.processed.AHoutbid; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, Zerotorescue@0: }, Zerotorescue@0: processedOther = { Zerotorescue@0: order = 77, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Other mail (e.g. plain text)", Zerotorescue@0: desc = "Announce when mail is processed because it's |cfffed000any other kind of mail|r (e.g. plain text).", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.processed.other = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.processed.other; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, Zerotorescue@0: }, Zerotorescue@0: }, Zerotorescue@0: }, -- end Mail Processed Notifications config inline group Zerotorescue@0: Zerotorescue@0: -- Sound Notifications config inline group Zerotorescue@0: sound = { Zerotorescue@0: order = 50, Zerotorescue@0: type = "group", Zerotorescue@0: inline = true, Zerotorescue@0: name = "Sound Notifications", Zerotorescue@0: args = { Zerotorescue@42: descriptionMailProcessed = { Zerotorescue@42: order = 61, Zerotorescue@42: type = "description", Zerotorescue@42: name = "Play a sound when...", Zerotorescue@42: }, Zerotorescue@0: bagsFullSound = { Zerotorescue@0: order = 100, Zerotorescue@0: type = "toggle", Zerotorescue@42: name = "Inventory is full", Zerotorescue@0: desc = "Play a sound when your inventory is full. You can select what sound in the select box next to this.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.bagsFullSound = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.bagsFullSound; end, Zerotorescue@42: width = "medium", Zerotorescue@0: }, Zerotorescue@0: bagsFullSoundFile = { Zerotorescue@0: order = 101, Zerotorescue@0: type = "select", Zerotorescue@0: name = "Sound File", Zerotorescue@0: desc = "Sound file to play when your bags are full.", Zerotorescue@0: dialogControl = "LSM30_Sound", Zerotorescue@0: set = function(i, v) Zerotorescue@0: MailOpener.db.profile.notifications.bagsFullSoundFile = Media:Fetch("sound", v); Zerotorescue@0: MailOpener.db.profile.notifications.bagsFullSoundFileName = v; Zerotorescue@0: Zerotorescue@0: PlaySoundFile(MailOpener.db.profile.notifications.bagsFullSoundFile); Zerotorescue@0: Zerotorescue@0: print("|cff15ff00Mail Opener|r: You may have to increase the mail opening interval if this sound effect gets spammy. The recommended value is 10 seconds."); Zerotorescue@0: end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.bagsFullSoundFileName end, Zerotorescue@0: values = function () return (Media:HashTable("sound") or nil); end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound); end, Zerotorescue@0: }, Zerotorescue@0: bagsFullSoundOnlyOnce = { Zerotorescue@0: order = 102, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Only once", Zerotorescue@42: desc = "Only play this sound once each time new mail has been arrived or your bags are updated.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound); end, Zerotorescue@42: --width = "half", Zerotorescue@42: }, Zerotorescue@42: bagsFullSoundOnlyOncePerMailboxVisit = { Zerotorescue@42: order = 103, Zerotorescue@42: type = "toggle", Zerotorescue@42: name = "...per mailbox visit", Zerotorescue@42: desc = "Only play this sound once each time you visit the mailbox.", Zerotorescue@42: set = function(i, v) MailOpener.db.profile.notifications.bagsFullSoundOnlyOncePerMailboxVisit = v; end, Zerotorescue@42: get = function() return MailOpener.db.profile.notifications.bagsFullSoundOnlyOncePerMailboxVisit; end, Zerotorescue@42: disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound or not MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce); end, Zerotorescue@0: }, Zerotorescue@0: mailboxEmptySound = { Zerotorescue@0: order = 110, Zerotorescue@0: type = "toggle", Zerotorescue@42: name = "No more mail can be opened", Zerotorescue@0: desc = "Play a sound when no more mail can be opened. You can select what sound in the select box next to this.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySound = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.mailboxEmptySound; end, Zerotorescue@42: --width = "double", Zerotorescue@0: }, Zerotorescue@0: mailboxEmptySoundFile = { Zerotorescue@0: order = 111, Zerotorescue@0: type = "select", Zerotorescue@0: name = "Sound File", Zerotorescue@0: desc = "Sound file to play when Mail Opener can't open any more mail.", Zerotorescue@0: dialogControl = "LSM30_Sound", Zerotorescue@0: set = function(i, v) Zerotorescue@0: MailOpener.db.profile.notifications.mailboxEmptySoundFile = Media:Fetch("sound", v); Zerotorescue@0: MailOpener.db.profile.notifications.mailboxEmptySoundFileName = v; Zerotorescue@0: Zerotorescue@0: PlaySoundFile(MailOpener.db.profile.notifications.mailboxEmptySoundFile); Zerotorescue@0: Zerotorescue@0: print("|cff15ff00Mail Opener|r: You may have to increase the mail opening interval if this sound effect gets spammy. The recommended value is 10 seconds."); Zerotorescue@0: end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundFileName end, Zerotorescue@0: values = function () return (Media:HashTable("sound") or nil); end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.mailboxEmptySound); end, Zerotorescue@0: }, Zerotorescue@0: mailboxEmptySoundOnlyOnce = { Zerotorescue@0: order = 112, Zerotorescue@0: type = "toggle", Zerotorescue@0: name = "Only once", Zerotorescue@0: desc = "Only play this sound once each time new mail has been arrived.", Zerotorescue@0: set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce = v; end, Zerotorescue@0: get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce; end, Zerotorescue@0: disabled = function() return (not MailOpener.db.profile.notifications.mailboxEmptySound); end, Zerotorescue@42: --width = "half", Zerotorescue@42: }, Zerotorescue@42: mailboxEmptySoundOnlyOncePerMailboxVisit = { Zerotorescue@42: order = 113, Zerotorescue@42: type = "toggle", Zerotorescue@42: name = "...per mailbox visit", Zerotorescue@42: desc = "Only play this sound once each time you visit the mailbox.", Zerotorescue@42: set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOncePerMailboxVisit = v; end, Zerotorescue@42: get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOncePerMailboxVisit; end, Zerotorescue@42: disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound or not MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce); end, Zerotorescue@0: }, Zerotorescue@0: }, Zerotorescue@0: }, -- end Sound Notifications config inline group Zerotorescue@0: }, Zerotorescue@0: }; Zerotorescue@0: Zerotorescue@0: return notificationsConfigGroup; Zerotorescue@0: end