annotate Modules/Config.lua @ 161:34e22d3cd73e

hasOpenedMailAlready is now set to true when shift is held while opening the mailbox so that CheckInbox may still work.
author Zerotorescue
date Mon, 19 Dec 2011 13:30:59 +0100
parents 42d8e16e8483
children
rev   line source
Zerotorescue@0 1 local MailOpener = LibStub("AceAddon-3.0"):GetAddon("MailOpener");
Zerotorescue@31 2 local mod = MailOpener:NewModule("Config", "AceEvent-3.0", "AceTimer-3.0");
Zerotorescue@70 3 local L = LibStub("AceLocale-3.0"):GetLocale("MailOpener");
Zerotorescue@0 4
Zerotorescue@68 5 mod.moduleDescription = L["Builds and loads the config frame(s) and handles the slash commands. Automatically loaded when needed."];
Zerotorescue@31 6 mod.moduleRequired = false;
Zerotorescue@4 7
Zerotorescue@0 8 local Media = LibStub("LibSharedMedia-3.0");
Zerotorescue@0 9 Media:Register("sound", "Cartoon FX", [[Sound\Doodad\Goblin_Lottery_Open03.wav]]);
Zerotorescue@0 10 Media:Register("sound", "Cheer", [[Sound\Event Sounds\OgreEventCheerUnique.wav]]);
Zerotorescue@0 11 Media:Register("sound", "Explosion", [[Sound\Doodad\Hellfire_Raid_FX_Explosion05.wav]]);
Zerotorescue@0 12 Media:Register("sound", "Fel Nova", [[Sound\Spells\SeepingGaseous_Fel_Nova.wav]]);
Zerotorescue@0 13 Media:Register("sound", "Fel Portal", [[Sound\Spells\Sunwell_Fel_PortalStand.wav]]);
Zerotorescue@0 14 Media:Register("sound", "Magic Click", [[Sound\interface\MagicClick.wav]]);
Zerotorescue@0 15 Media:Register("sound", "Rubber Ducky", [[Sound\Doodad\Goblin_Lottery_Open01.wav]]);
Zerotorescue@0 16 Media:Register("sound", "Shing!", [[Sound\Doodad\PortcullisActive_Closed.wav]]);
Zerotorescue@0 17 Media:Register("sound", "Simon Chime", [[Sound\Doodad\SimonGame_LargeBlueTree.wav]]);
Zerotorescue@0 18 Media:Register("sound", "Simon Error", [[Sound\Spells\SimonGame_Visual_BadPress.wav]]);
Zerotorescue@0 19 Media:Register("sound", "Simon Start", [[Sound\Spells\SimonGame_Visual_GameStart.wav]]);
Zerotorescue@0 20 Media:Register("sound", "War Drums", [[Sound\Event Sounds\Event_wardrum_ogre.wav]]);
Zerotorescue@0 21 Media:Register("sound", "Wham!", [[Sound\Doodad\PVP_Lordaeron_Door_Open.wav]]);
Zerotorescue@0 22 Media:Register("sound", "Whisper Ping", [[Sound\interface\iTellMessage.wav]]);
Zerotorescue@0 23 Media:Register("sound", "You Will Die!", [[Sound\Creature\CThun\CThunYouWillDIe.wav]]);
Zerotorescue@0 24
Zerotorescue@0 25 local AceConfigDialog;
Zerotorescue@60 26
Zerotorescue@77 27 local tip, tipLink; -- if "tip" 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 28
Zerotorescue@31 29 function mod:OnEnable()
Zerotorescue@0 30 MailOpener:Debug("Enabling |cff00ffffConfig|r module.");
Zerotorescue@60 31
Zerotorescue@60 32 if MailOpener.db.global.currentTip == -1 and MailOpener.db.profile.general.continueOpening == false then
Zerotorescue@60 33 StaticPopupDialogs["MailOpenerFirstConfigUseConfirmBox"] = {
Zerotorescue@68 34 text = L["Do you wish to enable \"continue opening mail\"? Read the tip at the bottom of the \"General\" config for more information."],
Zerotorescue@68 35 button1 = L["Yes"],
Zerotorescue@68 36 button2 = L["No"],
Zerotorescue@60 37 OnAccept = function()
Zerotorescue@60 38 MailOpener.db.profile.general.continueOpening = true;
Zerotorescue@60 39
Zerotorescue@68 40 MailOpener:Print(L["Enabling the functionality. Remember you can always change this setting in the \"Open All\" config (|cff00ffff/mo c|r)."]);
Zerotorescue@60 41 end,
Zerotorescue@60 42 OnCancel = function (_,reason)
Zerotorescue@68 43 MailOpener:Print(L["You can always change this setting in the \"Open All\" config (|cff00ffff/mo c|r)."]);
Zerotorescue@60 44 end,
Zerotorescue@60 45 timeout = 0,
Zerotorescue@60 46 whileDead = 1,
Zerotorescue@60 47 hideOnEscape = 1,
Zerotorescue@60 48 };
Zerotorescue@60 49 StaticPopup_Show("MailOpenerFirstConfigUseConfirmBox");
Zerotorescue@60 50 end
Zerotorescue@60 51
Zerotorescue@60 52 if tip == nil then
Zerotorescue@60 53 self:NextTip();
Zerotorescue@60 54
Zerotorescue@60 55 self:GetTip();
Zerotorescue@60 56 end
Zerotorescue@60 57 end
Zerotorescue@60 58
Zerotorescue@60 59 function mod:GetTip()
Zerotorescue@60 60 -- First we fill the global "tip" with our table
Zerotorescue@60 61 -- Then we erase tips that are irrelevant to us
Zerotorescue@60 62 -- and finally the table will be replaced with the currently selected tip
Zerotorescue@60 63
Zerotorescue@60 64 -- Can't put this in the abive scope as the ADDONEnable vars would then always be empty
Zerotorescue@60 65 tip = {
Zerotorescue@68 66 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)."],
Zerotorescue@68 67 L["You can |cfffed000shift-click|r a mail icon to loot all attachments from that single mail."],
Zerotorescue@62 68 {
Zerotorescue@68 69 txt = L["|cfffed000Postal|r allows you to return mail by |cfffed000alt-clicking|r the mail icon."],
Zerotorescue@62 70 shown = (MailOpener.PostalEnabled),
Zerotorescue@62 71 },
Zerotorescue@62 72 {
Zerotorescue@68 73 txt = 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."],
Zerotorescue@62 74 shown = (MailOpener.PostalEnabled),
Zerotorescue@62 75 },
Zerotorescue@68 76 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."],
Zerotorescue@60 77 {
Zerotorescue@77 78 txt = L["If you are looking for an addon with many handy modifications for |cfffed000sending|r mail, you might want to consider |cfffed000Postal|r (click the button below for a download link)."],
Zerotorescue@60 79 shown = (not MailOpener.PostalEnabled),
Zerotorescue@77 80 url = "http://wow.curse.com/downloads/wow-addons/details/postal.aspx",
Zerotorescue@60 81 },
Zerotorescue@68 82 L["|cfffed000Cost on Delivery|r and |cfffed000Blizzard|r mail will always be skipped, regardless of any filters."],
Zerotorescue@68 83 L["|cfffed000Right-click|r the |cfffed000open all|r button to quickly adjust your mail opening filters."],
Zerotorescue@68 84 L["|cfffed000Shift-click|r the |cfffed000open all|r button to temporarily override your filters and loot every single mail containing attachments and/or gold."],
Zerotorescue@77 85 {
Zerotorescue@77 86 txt = 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)."],
Zerotorescue@77 87 url = "http://wow.curseforge.com/addons/mailopener/tickets/",
Zerotorescue@77 88 },
Zerotorescue@77 89 {
Zerotorescue@77 90 txt = 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."],
Zerotorescue@77 91 url = "http://wow.curseforge.com/addons/mailopener/localization/",
Zerotorescue@77 92 },
Zerotorescue@60 93 };
Zerotorescue@77 94 tipLink = nil;
Zerotorescue@60 95
Zerotorescue@60 96 -- Remove any "hidden" tips
Zerotorescue@60 97 for i = table.getn(tip), 1 do
Zerotorescue@60 98 local val = tip[i];
Zerotorescue@60 99
Zerotorescue@60 100 if type(val) == "table" and val.shown == false then
Zerotorescue@60 101 table.remove(tip, i);
Zerotorescue@60 102 end
Zerotorescue@60 103 end
Zerotorescue@60 104
Zerotorescue@60 105 -- Find our current tip
Zerotorescue@60 106 local tipsAvailable = table.getn(tip);
Zerotorescue@60 107 local selectedTip = ( ( MailOpener.db.global.currentTip % tipsAvailable ) + 1 ); -- this should return a value between 1 and tipsAvailable
Zerotorescue@60 108
Zerotorescue@60 109 if selectedTip < 1 then
Zerotorescue@60 110 -- If we're going under zero, we'll use the last tip available instead
Zerotorescue@60 111 MailOpener.db.global.currentTip = tipsAvailable;
Zerotorescue@60 112 end
Zerotorescue@60 113
Zerotorescue@60 114 -- We don't need to leave the tip-table in memory, so overwrite it
Zerotorescue@60 115 if type(tip[selectedTip]) == "table" then
Zerotorescue@77 116 if tip[selectedTip]['url'] then
Zerotorescue@77 117 tipLink = tip[selectedTip]['url'];
Zerotorescue@77 118 end
Zerotorescue@77 119
Zerotorescue@60 120 tip = tip[selectedTip]['txt'];
Zerotorescue@60 121 else
Zerotorescue@60 122 tip = tip[selectedTip];
Zerotorescue@60 123 end
Zerotorescue@60 124 end
Zerotorescue@60 125
Zerotorescue@60 126 function mod:NextTip()
Zerotorescue@60 127 MailOpener.db.global.currentTip = ( MailOpener.db.global.currentTip + 1 );
Zerotorescue@0 128 end
Zerotorescue@0 129
Zerotorescue@31 130 function mod:CommandHandler(message)
Zerotorescue@0 131 local cmd, arg = string.split(" ", (message or ""), 2);
Zerotorescue@0 132 cmd = string.lower(cmd);
Zerotorescue@0 133
Zerotorescue@0 134 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 135 self:Show();
Zerotorescue@0 136 elseif cmd == "d" or cmd == "debug" then
Zerotorescue@0 137 MailOpener.debugChannel = false;
Zerotorescue@0 138 for i = 1, NUM_CHAT_WINDOWS do
Zerotorescue@0 139 local name = GetChatWindowInfo(i);
Zerotorescue@0 140
Zerotorescue@0 141 if name:upper() == "DEBUG" then
Zerotorescue@0 142 MailOpener.debugChannel = _G["ChatFrame" .. i];
Zerotorescue@0 143
Zerotorescue@46 144 print("A debug channel already exists, used the old one. (" .. i .. ")");
Zerotorescue@0 145 return;
Zerotorescue@0 146 end
Zerotorescue@0 147 end
Zerotorescue@0 148
Zerotorescue@0 149 if not MailOpener.debugChannel then
Zerotorescue@0 150 -- Create a new debug channel
Zerotorescue@0 151 local chatFrame = FCF_OpenNewWindow('Debug');
Zerotorescue@0 152 ChatFrame_RemoveAllMessageGroups(chatFrame);
Zerotorescue@0 153 MailOpener.debugChannel = chatFrame;
Zerotorescue@0 154
Zerotorescue@0 155 print("New debug channel created.");
Zerotorescue@0 156 end
Zerotorescue@0 157 else
Zerotorescue@68 158 print(L["Wrong command, available: /mo config (or /mo c)"]);
Zerotorescue@0 159 end
Zerotorescue@0 160 end
Zerotorescue@0 161
Zerotorescue@31 162 function mod:Load()
Zerotorescue@0 163 if not AceConfigDialog then
Zerotorescue@0 164 local options = self:GetOptions();
Zerotorescue@0 165
Zerotorescue@47 166 -- 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 167 -- Instead, do a garbage collection
Zerotorescue@47 168 collectgarbage();
Zerotorescue@47 169
Zerotorescue@0 170 -- Build options dialog
Zerotorescue@0 171 AceConfigDialog = LibStub("AceConfigDialog-3.0");
Zerotorescue@0 172 -- Register options table
Zerotorescue@0 173 LibStub("AceConfig-3.0"):RegisterOptionsTable("Mail Opener", options);
Zerotorescue@0 174 -- Set a nice default size
Zerotorescue@0 175 AceConfigDialog:SetDefaultSize("Mail Opener", 950, 600);
Zerotorescue@0 176
Zerotorescue@140 177 -- Remove our old config tab
Zerotorescue@140 178 for k, f in ipairs(INTERFACEOPTIONS_ADDONCATEGORIES) do
Zerotorescue@140 179 if f == "Mail Opener" or f.name == "Mail Opener" then
Zerotorescue@140 180 tremove(INTERFACEOPTIONS_ADDONCATEGORIES, k);
Zerotorescue@140 181 break;
Zerotorescue@140 182 end
Zerotorescue@0 183 end
Zerotorescue@0 184
Zerotorescue@0 185 -- Add to the blizzard addons options thing
Zerotorescue@0 186 AceConfigDialog:AddToBlizOptions("Mail Opener");
Zerotorescue@0 187 end
Zerotorescue@0 188 end
Zerotorescue@0 189
Zerotorescue@31 190 function mod:Show()
Zerotorescue@0 191 self:Load();
Zerotorescue@0 192
Zerotorescue@0 193 AceConfigDialog:Open("Mail Opener");
Zerotorescue@0 194 end
Zerotorescue@0 195
Zerotorescue@31 196 function mod:GetOptions()
Zerotorescue@0 197 local options = {
Zerotorescue@0 198 type = "group",
Zerotorescue@68 199 name = L["Mail Opener"],
Zerotorescue@0 200 childGroups = "tree",
Zerotorescue@0 201 args = {
Zerotorescue@0 202 },
Zerotorescue@0 203 };
Zerotorescue@0 204
Zerotorescue@0 205 options.args.general = self:GetGeneralOptions();
Zerotorescue@0 206
Zerotorescue@0 207 options.args.notifications = self:GetNotificationsOptions();
Zerotorescue@0 208
Zerotorescue@0 209 options = self:GetModuleOptions(options);
Zerotorescue@0 210
Zerotorescue@0 211 options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(MailOpener.db, true);
Zerotorescue@0 212 options.args.profiles.order = 1000; -- we want this as last group
Zerotorescue@0 213
Zerotorescue@0 214 return options;
Zerotorescue@0 215 end
Zerotorescue@0 216
Zerotorescue@31 217 -- Get the options group for every one of our modules
Zerotorescue@31 218 function mod:GetModuleOptions(options)
Zerotorescue@31 219 -- Go through all our modules
Zerotorescue@0 220 for name, module in MailOpener:IterateModules() do
Zerotorescue@31 221 -- Look if they even have an options group
Zerotorescue@0 222 if module.GetOptionsGroup then
Zerotorescue@31 223 -- Get that options group
Zerotorescue@31 224 local moduleGroup = module:GetOptionsGroup();
Zerotorescue@31 225
Zerotorescue@31 226 -- If it's set to be a subgroup of the modules group, put it there
Zerotorescue@31 227 if moduleGroup['type'] == "modulesSubGroup" then
Zerotorescue@31 228 moduleGroup['type'] = "group";
Zerotorescue@31 229
Zerotorescue@31 230 -- If the modules group doesn't exist yet, make it
Zerotorescue@31 231 if options.args.Modules == nil then
Zerotorescue@31 232 options.args.Modules = self:GetModuleGroupsContainer();
Zerotorescue@31 233 end
Zerotorescue@31 234
Zerotorescue@31 235 -- Add to the modules sub group
Zerotorescue@31 236 options.args.Modules.args[name] = moduleGroup;
Zerotorescue@31 237 else
Zerotorescue@31 238 options.args[name] = moduleGroup;
Zerotorescue@31 239 end
Zerotorescue@31 240
Zerotorescue@0 241 end
Zerotorescue@0 242 end
Zerotorescue@0 243
Zerotorescue@0 244 return options;
Zerotorescue@0 245 end
Zerotorescue@0 246
Zerotorescue@31 247 function mod:GetModuleGroupsContainer()
Zerotorescue@31 248 local modulesConfigGroup = {
Zerotorescue@31 249 order = 400,
Zerotorescue@31 250 type = "group",
Zerotorescue@31 251 childGroups = "tree",
Zerotorescue@68 252 name = L["Modules"],
Zerotorescue@68 253 desc = L["Change settings for modules or toggle them on or off."],
Zerotorescue@31 254 args = {
Zerotorescue@31 255 General = {
Zerotorescue@31 256 order = 10,
Zerotorescue@31 257 type = "group",
Zerotorescue@31 258 inline = true,
Zerotorescue@68 259 name = L["Modules Status"],
Zerotorescue@31 260 args = {
Zerotorescue@31 261 headerName = {
Zerotorescue@31 262 order = 0,
Zerotorescue@31 263 width = "normal",
Zerotorescue@31 264 type = "description",
Zerotorescue@31 265 fontSize = "medium",
Zerotorescue@68 266 name = L["|cfffed000Module Name|r"],
Zerotorescue@31 267 },
Zerotorescue@31 268 headerStatus = {
Zerotorescue@31 269 order = 1,
Zerotorescue@31 270 width = "half",
Zerotorescue@31 271 type = "description",
Zerotorescue@31 272 fontSize = "medium",
Zerotorescue@68 273 name = L["|cfffed000Status|r"],
Zerotorescue@31 274 },
Zerotorescue@31 275 headerDefault = {
Zerotorescue@31 276 order = 2,
Zerotorescue@43 277 width = "double",
Zerotorescue@31 278 type = "description",
Zerotorescue@31 279 fontSize = "medium",
Zerotorescue@68 280 name = L["|cfffed000Default Status|r"],
Zerotorescue@31 281 },
Zerotorescue@31 282 headerseperator = {
Zerotorescue@31 283 order = 3,
Zerotorescue@31 284 type = "description",
Zerotorescue@31 285 name = "",
Zerotorescue@31 286 },
Zerotorescue@31 287 },
Zerotorescue@31 288 },
Zerotorescue@31 289 },
Zerotorescue@31 290 };
Zerotorescue@31 291
Zerotorescue@31 292 -- Make a list of modules and their statuses
Zerotorescue@31 293 local orderNo = 5;
Zerotorescue@31 294 for moduleName, module in MailOpener:IterateModules() do
Zerotorescue@31 295 -- Display each module as NAME CURRENT STATUS DEFAULT STATUS
Zerotorescue@31 296
Zerotorescue@31 297 -- Name
Zerotorescue@31 298 modulesConfigGroup.args.General.args[moduleName .. "name"] = {
Zerotorescue@31 299 order = orderNo,
Zerotorescue@31 300 width = "normal",
Zerotorescue@31 301 type = "description",
Zerotorescue@31 302 fontSize = "medium",
Zerotorescue@31 303 name = function()
Zerotorescue@31 304 return moduleName;
Zerotorescue@31 305 end,
Zerotorescue@31 306 };
Zerotorescue@31 307 -- Current status
Zerotorescue@31 308 modulesConfigGroup.args.General.args[moduleName .. "status"] = {
Zerotorescue@31 309 order = ( orderNo + 1 ),
Zerotorescue@31 310 width = "half",
Zerotorescue@31 311 type = "description",
Zerotorescue@31 312 fontSize = "medium",
Zerotorescue@31 313 name = function()
Zerotorescue@31 314 if module:IsEnabled() then
Zerotorescue@68 315 return L["|cff00ff00Enabled|r"];
Zerotorescue@31 316 else
Zerotorescue@68 317 return L["|cffff0000Disabled|r"];
Zerotorescue@31 318 end
Zerotorescue@31 319 end,
Zerotorescue@31 320 };
Zerotorescue@31 321 -- Default status
Zerotorescue@31 322 modulesConfigGroup.args.General.args[moduleName .. "default"] = {
Zerotorescue@31 323 order = ( orderNo + 2 ),
Zerotorescue@43 324 width = "double",
Zerotorescue@31 325 type = "description",
Zerotorescue@31 326 fontSize = "medium",
Zerotorescue@31 327 name = function()
Zerotorescue@31 328 local desc = "";
Zerotorescue@31 329 if MailOpener.db.profile.modules[moduleName] == nil or MailOpener.db.profile.modules[moduleName] == true then
Zerotorescue@68 330 desc = L["|cff00ff00Enabled|r"];
Zerotorescue@31 331 else
Zerotorescue@68 332 desc = L["|cffff0000Disabled|r"];
Zerotorescue@31 333 end
Zerotorescue@31 334
Zerotorescue@31 335 if module.moduleRequired then
Zerotorescue@68 336 desc = desc .. " " .. L["(Required module)"];
Zerotorescue@31 337 end
Zerotorescue@31 338
Zerotorescue@31 339 return desc;
Zerotorescue@31 340 end,
Zerotorescue@31 341 };
Zerotorescue@31 342
Zerotorescue@31 343 -- Seperator
Zerotorescue@31 344 modulesConfigGroup.args.General.args[moduleName .. "seperator"] = {
Zerotorescue@31 345 order = ( orderNo + 3 ),
Zerotorescue@31 346 type = "description",
Zerotorescue@31 347 name = "",
Zerotorescue@31 348 };
Zerotorescue@31 349
Zerotorescue@31 350 if module.moduleDescription then
Zerotorescue@31 351 -- Description
Zerotorescue@31 352 modulesConfigGroup.args.General.args[moduleName .. "description"] = {
Zerotorescue@31 353 order = ( orderNo + 4 ),
Zerotorescue@31 354 type = "description",
Zerotorescue@31 355 name = function()
Zerotorescue@31 356 return "|cfffed000" .. module.moduleDescription .. "|r";
Zerotorescue@31 357 end,
Zerotorescue@31 358 };
Zerotorescue@31 359 end
Zerotorescue@31 360
Zerotorescue@31 361 orderNo = orderNo + 5;
Zerotorescue@31 362 end
Zerotorescue@31 363
Zerotorescue@31 364 return modulesConfigGroup;
Zerotorescue@31 365 end
Zerotorescue@31 366
Zerotorescue@31 367 function mod:GetGeneralOptions()
Zerotorescue@0 368 local generalConfigGroup = {
Zerotorescue@0 369 order = 100,
Zerotorescue@0 370 type = "group",
Zerotorescue@68 371 name = L["General"],
Zerotorescue@68 372 desc = L["Change general Mail Opener settings."],
Zerotorescue@0 373 args = {
Zerotorescue@0 374 -- General config inline group
Zerotorescue@0 375 generalConfig = {
Zerotorescue@0 376 order = 10,
Zerotorescue@0 377 type = "group",
Zerotorescue@0 378 inline = true,
Zerotorescue@68 379 name = L["General"],
Zerotorescue@0 380 args = {
Zerotorescue@0 381 defaultStatus = {
Zerotorescue@0 382 order = 0,
Zerotorescue@0 383 type = "select",
Zerotorescue@68 384 name = L["Default mail opener status"],
Zerotorescue@68 385 desc = L["Select the default Mail Opener status when you open a mailbox for the first time since your log on."],
Zerotorescue@0 386 values = {
Zerotorescue@68 387 _enabled = L["Completely enabled"],
Zerotorescue@68 388 disabled = L["Auto opening disabled"],
Zerotorescue@68 389 xdisabled = L["Addon Disabled"],
Zerotorescue@0 390 },
Zerotorescue@0 391 get = function() return MailOpener.db.profile.general.defaultStatus; end,
Zerotorescue@0 392 set = function(i, v) MailOpener.db.profile.general.defaultStatus = v; end,
Zerotorescue@0 393 },
Zerotorescue@0 394 defaultQAStatus = {
Zerotorescue@0 395 order = 10,
Zerotorescue@0 396 type = "select",
Zerotorescue@68 397 name = L["Default QA Auto Mail status"],
Zerotorescue@68 398 desc = L["Select the default Quick Auctions auto mail status whenever you open a mailbox."],
Zerotorescue@0 399 values = {
Zerotorescue@68 400 __remember = L["Remember"],
Zerotorescue@68 401 _enabled = L["Enabled"],
Zerotorescue@68 402 disabled = L["Disabled"],
Zerotorescue@0 403 },
Zerotorescue@0 404 get = function() return MailOpener.db.profile.general.defaultQAStatus; end,
Zerotorescue@0 405 set = function(i, v) MailOpener.db.profile.general.defaultQAStatus = v; end,
Zerotorescue@123 406 hidden = (not MailOpener.ZeroAuctionsEnabled),
Zerotorescue@0 407 },
Zerotorescue@108 408 overrideCheckInbox = {
Zerotorescue@108 409 order = 12,
Zerotorescue@108 410 type = "toggle",
Zerotorescue@111 411 name = L["Don't refresh the mailbox while there is still mail waiting to be opened"],
Zerotorescue@111 412 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."],
Zerotorescue@108 413 width = "full",
Zerotorescue@108 414 get = function() return MailOpener.db.profile.general.overrideCheckInbox; end,
Zerotorescue@108 415 set = function(i, v) MailOpener.db.profile.general.overrideCheckInbox = v; end,
Zerotorescue@108 416 },
Zerotorescue@0 417 continueOpeningStackableItems = {
Zerotorescue@0 418 order = 15,
Zerotorescue@0 419 type = "toggle",
Zerotorescue@68 420 name = L["Continue trying to open mail after your bags are full"],
Zerotorescue@68 421 desc = L["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 422 width = "full",
Zerotorescue@0 423 get = function() return MailOpener.db.profile.general.continueOpeningStackableItems; end,
Zerotorescue@0 424 set = function(i, v) MailOpener.db.profile.general.continueOpeningStackableItems = v; end,
Zerotorescue@0 425 },
Zerotorescue@51 426 showHelpTooltips = {
Zerotorescue@51 427 order = 17,
Zerotorescue@51 428 type = "toggle",
Zerotorescue@68 429 name = L["Display help tooltips at the mailbox buttons added by Mail Opener."],
Zerotorescue@68 430 desc = L["Display the help tooltips when hovering at any of the mailbox buttons added by Mail Opener."],
Zerotorescue@51 431 width = "full",
Zerotorescue@51 432 get = function() return MailOpener.db.profile.general.showHelpTooltips; end,
Zerotorescue@51 433 set = function(i, v) MailOpener.db.profile.general.showHelpTooltips = v; end,
Zerotorescue@51 434 },
Zerotorescue@0 435 autoDisableQAAutoMail = {
Zerotorescue@0 436 order = 20,
Zerotorescue@0 437 type = "toggle",
Zerotorescue@68 438 name = L["Turn Quick Auction's auto mail status |cffff0000off|r when opening mail"],
Zerotorescue@68 439 desc = 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.\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 440 width = "full",
Zerotorescue@0 441 get = function() return MailOpener.db.profile.general.autoDisableQAAutoMail; end,
Zerotorescue@0 442 set = function(i, v) MailOpener.db.profile.general.autoDisableQAAutoMail = v; end,
Zerotorescue@123 443 hidden = (not MailOpener.ZeroAuctionsEnabled),
Zerotorescue@0 444 },
Zerotorescue@0 445 autoReenableQAAutoMail = {
Zerotorescue@0 446 order = 30,
Zerotorescue@0 447 type = "toggle",
Zerotorescue@68 448 name = L["Turn Quick Auction's auto mail status |cff00ff00on|r after opening mail has finished"],
Zerotorescue@68 449 desc = 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.\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 450 width = "full",
Zerotorescue@0 451 get = function() return MailOpener.db.profile.general.autoReenableQAAutoMail; end,
Zerotorescue@0 452 set = function(i, v) MailOpener.db.profile.general.autoReenableQAAutoMail = v; end,
Zerotorescue@123 453 hidden = (not MailOpener.ZeroAuctionsEnabled),
Zerotorescue@0 454 disabled = function() return (MailOpener.db.profile.general.autoSetBackQAAutoMail and not MailOpener.db.profile.general.autoReenableQAAutoMail); end,
Zerotorescue@0 455 },
Zerotorescue@0 456 autoSetBackQAAutoMail = {
Zerotorescue@0 457 order = 40,
Zerotorescue@0 458 type = "toggle",
Zerotorescue@68 459 name = L["Set Quick Auction's auto mail status |cff00ffffback|r after opening mail has finished (remember it)"],
Zerotorescue@68 460 desc = L["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 461 width = "full",
Zerotorescue@0 462 get = function() return MailOpener.db.profile.general.autoSetBackQAAutoMail; end,
Zerotorescue@0 463 set = function(i, v) MailOpener.db.profile.general.autoSetBackQAAutoMail = v; end,
Zerotorescue@123 464 hidden = (not MailOpener.ZeroAuctionsEnabled),
Zerotorescue@0 465 disabled = function() return (MailOpener.db.profile.general.autoReenableQAAutoMail and not MailOpener.db.profile.general.autoSetBackQAAutoMail); end,
Zerotorescue@0 466 },
Zerotorescue@0 467 },
Zerotorescue@0 468 }, -- end General config inline group
Zerotorescue@0 469 -- Profile config inline group
Zerotorescue@0 470 profileConfig = {
Zerotorescue@0 471 order = 15,
Zerotorescue@0 472 type = "group",
Zerotorescue@0 473 inline = true,
Zerotorescue@68 474 name = L["New Character Specific Profile"],
Zerotorescue@0 475 args = {
Zerotorescue@0 476 description = {
Zerotorescue@0 477 order = 10,
Zerotorescue@0 478 type = "description",
Zerotorescue@68 479 name = 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."],
Zerotorescue@0 480 },
Zerotorescue@0 481 header = {
Zerotorescue@0 482 order = 15,
Zerotorescue@0 483 type = "header",
Zerotorescue@0 484 name = "",
Zerotorescue@0 485 },
Zerotorescue@0 486 createNewProfile = {
Zerotorescue@0 487 order = 20,
Zerotorescue@0 488 type = "execute",
Zerotorescue@68 489 name = L["Create a new character specific profile"],
Zerotorescue@68 490 desc = L["Create a new profile for this user. You can also make profile groups at the profiles tab to the left."],
Zerotorescue@0 491 width = "double",
Zerotorescue@0 492 func = function()
Zerotorescue@0 493 MailOpener.db:SetProfile(UnitName("player") .. " - " .. GetRealmName());
Zerotorescue@0 494 end,
Zerotorescue@0 495 },
Zerotorescue@0 496 },
Zerotorescue@0 497 }, -- end Profile config inline group
Zerotorescue@60 498 -- Tip
Zerotorescue@60 499 tipConfig = {
Zerotorescue@60 500 order = 20,
Zerotorescue@60 501 type = "group",
Zerotorescue@60 502 inline = true,
Zerotorescue@68 503 name = L["Mail Opening Tip"],
Zerotorescue@60 504 args = {
Zerotorescue@60 505 description = {
Zerotorescue@60 506 order = 10,
Zerotorescue@60 507 type = "description",
Zerotorescue@60 508 fontSize = "medium",
Zerotorescue@60 509 name = function() return tip; end,
Zerotorescue@60 510 },
Zerotorescue@60 511 nextTip = {
Zerotorescue@60 512 order = 20,
Zerotorescue@60 513 type = "execute",
Zerotorescue@68 514 name = L["Next Tip"],
Zerotorescue@60 515 width = "half",
Zerotorescue@60 516 func = function() self:NextTip(); self:GetTip(); end,
Zerotorescue@60 517 },
Zerotorescue@77 518 tipLink = {
Zerotorescue@77 519 order = 30,
Zerotorescue@77 520 type = "execute",
Zerotorescue@77 521 name = L["Copy URL"],
Zerotorescue@77 522 width = "half",
Zerotorescue@77 523 func = function()
Zerotorescue@77 524 MailOpener.currentPopupContents = tipLink;
Zerotorescue@77 525
Zerotorescue@77 526 StaticPopup_Show("MailOpenerCopyWindow");
Zerotorescue@77 527 end,
Zerotorescue@77 528 hidden = function() return tipLink == nil; end,
Zerotorescue@77 529 },
Zerotorescue@60 530 },
Zerotorescue@60 531 }, -- end Tip
Zerotorescue@0 532 },
Zerotorescue@0 533 };
Zerotorescue@0 534
Zerotorescue@0 535 return generalConfigGroup;
Zerotorescue@0 536 end
Zerotorescue@0 537
Zerotorescue@31 538 function mod:GetNotificationsOptions()
Zerotorescue@0 539 local notificationsConfigGroup = {
Zerotorescue@0 540 order = 200,
Zerotorescue@0 541 type = "group",
Zerotorescue@68 542 name = L["Notifications"],
Zerotorescue@68 543 desc = L["Toggle notifications."],
Zerotorescue@0 544 args = {
Zerotorescue@0 545 -- Notifications config inline group
Zerotorescue@0 546 nofitications = {
Zerotorescue@0 547 order = 10,
Zerotorescue@0 548 type = "group",
Zerotorescue@0 549 inline = true,
Zerotorescue@68 550 name = L["Notifications"],
Zerotorescue@0 551 args = {
Zerotorescue@0 552 description = {
Zerotorescue@0 553 order = 10,
Zerotorescue@0 554 type = "description",
Zerotorescue@68 555 name = L["Notifications"],
Zerotorescue@0 556 },
Zerotorescue@0 557 },
Zerotorescue@0 558 }, -- end Notifications config inline group
Zerotorescue@0 559
Zerotorescue@0 560 -- General Notifications config inline group
Zerotorescue@0 561 general = {
Zerotorescue@0 562 order = 20,
Zerotorescue@0 563 type = "group",
Zerotorescue@0 564 inline = true,
Zerotorescue@68 565 name = L["General Notifications"],
Zerotorescue@0 566 args = {
Zerotorescue@0 567 fishedOpeningBatch = {
Zerotorescue@0 568 order = 22,
Zerotorescue@0 569 type = "toggle",
Zerotorescue@68 570 name = L["Announce when |cfffed000finished opening the current batch|r"],
Zerotorescue@68 571 desc = L["Announce when opening of the current batch of mail has been completed."],
Zerotorescue@0 572 set = function(i, v) MailOpener.db.profile.notifications.finishedCurrentBatch = v; end,
Zerotorescue@0 573 get = function() return MailOpener.db.profile.notifications.finishedCurrentBatch; end,
Zerotorescue@0 574 width = "double",
Zerotorescue@0 575 },
Zerotorescue@0 576 noMoreMailAvailable = {
Zerotorescue@0 577 order = 23,
Zerotorescue@0 578 type = "toggle",
Zerotorescue@68 579 name = L["Announce when |cfffed000the mailbox is completely empty|r"],
Zerotorescue@68 580 desc = L["Announce when there is nothing left for Mail Opener to open."],
Zerotorescue@0 581 set = function(i, v) MailOpener.db.profile.notifications.mailboxIsEmpty = v; end,
Zerotorescue@0 582 get = function() return MailOpener.db.profile.notifications.mailboxIsEmpty; end,
Zerotorescue@0 583 width = "double",
Zerotorescue@0 584 },
Zerotorescue@0 585 },
Zerotorescue@0 586 }, -- end General Notifications config inline group
Zerotorescue@0 587
Zerotorescue@0 588 -- Mail Skipped Notifications config inline group
Zerotorescue@0 589 mailSkipped = {
Zerotorescue@0 590 order = 30,
Zerotorescue@0 591 type = "group",
Zerotorescue@0 592 inline = true,
Zerotorescue@68 593 name = L["Mail Skipped Notifications"],
Zerotorescue@0 594 args = {
Zerotorescue@0 595 descriptionMailSkipped = {
Zerotorescue@0 596 order = 31,
Zerotorescue@0 597 type = "description",
Zerotorescue@68 598 name = L["Announce when mail is skipped because..."],
Zerotorescue@0 599 },
Zerotorescue@0 600
Zerotorescue@0 601 skippedToggleAll = {
Zerotorescue@0 602 order = 35,
Zerotorescue@0 603 type = "toggle",
Zerotorescue@68 604 name = L["Toggle everything"],
Zerotorescue@68 605 desc = L["Announce when mail is skipped for |cfffed000any|r reason."],
Zerotorescue@0 606 set = function(i, v) MailOpener.db.profile.notifications.skipped.all = v; end,
Zerotorescue@0 607 get = function() return MailOpener.db.profile.notifications.skipped.all; end,
Zerotorescue@0 608 },
Zerotorescue@0 609 skippedInventoryFull = {
Zerotorescue@0 610 order = 36,
Zerotorescue@0 611 type = "toggle",
Zerotorescue@68 612 name = L["Your inventory is full"],
Zerotorescue@68 613 desc = L["Announce when mail is skipped because |cfffed000your inventory is full|r."],
Zerotorescue@0 614 set = function(i, v) MailOpener.db.profile.notifications.skipped.inventoryFull = v; end,
Zerotorescue@0 615 get = function() return MailOpener.db.profile.notifications.skipped.inventoryFull; end,
Zerotorescue@0 616 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 617 },
Zerotorescue@0 618 skippedKeepFreeSpaceLimit = {
Zerotorescue@0 619 order = 37,
Zerotorescue@0 620 type = "toggle",
Zerotorescue@68 621 name = L["Keep free space limit reached"],
Zerotorescue@68 622 desc = L["Announce when mail is skipped because |cfffed000the keep free space limit has been reached|r."],
Zerotorescue@0 623 set = function(i, v) MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit = v; end,
Zerotorescue@0 624 get = function() return MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit; end,
Zerotorescue@0 625 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 626 },
Zerotorescue@0 627 skippedGMMail = {
Zerotorescue@0 628 order = 38,
Zerotorescue@0 629 type = "toggle",
Zerotorescue@68 630 name = L["Blizzard mail"],
Zerotorescue@68 631 desc = L["Announce when mail is skipped because it's |cfffed000mail sent by Blizzard|r."],
Zerotorescue@0 632 set = function(i, v) MailOpener.db.profile.notifications.skipped.GMMail = v; end,
Zerotorescue@0 633 get = function() return MailOpener.db.profile.notifications.skipped.GMMail; end,
Zerotorescue@0 634 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 635 },
Zerotorescue@0 636 skippedCOD = {
Zerotorescue@0 637 order = 39,
Zerotorescue@0 638 type = "toggle",
Zerotorescue@68 639 name = L["C.O.D. mail"],
Zerotorescue@68 640 desc = L["Announce when mail is skipped because it's |cfffed000a Cost On Delivery mail|r."],
Zerotorescue@0 641 set = function(i, v) MailOpener.db.profile.notifications.skipped.COD = v; end,
Zerotorescue@0 642 get = function() return MailOpener.db.profile.notifications.skipped.COD; end,
Zerotorescue@0 643 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 644 },
Zerotorescue@0 645 skippedNormalGoldMail = {
Zerotorescue@0 646 order = 40,
Zerotorescue@0 647 type = "toggle",
Zerotorescue@68 648 name = L["Normal mail with gold"],
Zerotorescue@68 649 desc = L["Announce when mail is skipped because it's |cfffed000normal mail containing gold|r."],
Zerotorescue@0 650 set = function(i, v) MailOpener.db.profile.notifications.skipped.normalGoldMail = v; end,
Zerotorescue@0 651 get = function() return MailOpener.db.profile.notifications.skipped.normalGoldMail; end,
Zerotorescue@0 652 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 653 },
Zerotorescue@0 654 skippedNormalItemsMail = {
Zerotorescue@0 655 order = 41,
Zerotorescue@0 656 type = "toggle",
Zerotorescue@68 657 name = L["Normal mail with attachments"],
Zerotorescue@68 658 desc = L["Announce when mail is skipped because it's |cfffed000normal mail containing items|r."],
Zerotorescue@0 659 set = function(i, v) MailOpener.db.profile.notifications.skipped.normalItemsMail = v; end,
Zerotorescue@0 660 get = function() return MailOpener.db.profile.notifications.skipped.normalItemsMail; end,
Zerotorescue@0 661 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 662 },
Zerotorescue@0 663 skippedAHExpired = {
Zerotorescue@0 664 order = 42,
Zerotorescue@0 665 type = "toggle",
Zerotorescue@68 666 name = L["Auction expired mail"],
Zerotorescue@68 667 desc = L["Announce when mail is skipped because it's |cfffed000auction expired mail|r."],
Zerotorescue@0 668 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHexpired = v; end,
Zerotorescue@0 669 get = function() return MailOpener.db.profile.notifications.skipped.AHexpired; end,
Zerotorescue@0 670 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 671 },
Zerotorescue@0 672 skippedAHSuccessful = {
Zerotorescue@0 673 order = 43,
Zerotorescue@0 674 type = "toggle",
Zerotorescue@68 675 name = L["Auction successful mail"],
Zerotorescue@68 676 desc = L["Announce when mail is skipped because it's |cfffed000auction successful mail|r."],
Zerotorescue@0 677 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHsuccess = v; end,
Zerotorescue@0 678 get = function() return MailOpener.db.profile.notifications.skipped.AHsuccess; end,
Zerotorescue@0 679 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 680 },
Zerotorescue@0 681 skippedAHWon = {
Zerotorescue@0 682 order = 44,
Zerotorescue@0 683 type = "toggle",
Zerotorescue@68 684 name = L["Auction won mail"],
Zerotorescue@68 685 desc = L["Announce when mail is skipped because it's |cfffed000auction won mail|r."],
Zerotorescue@0 686 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHwon = v; end,
Zerotorescue@0 687 get = function() return MailOpener.db.profile.notifications.skipped.AHwon; end,
Zerotorescue@0 688 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 689 },
Zerotorescue@0 690 skippedAHCanceled = {
Zerotorescue@0 691 order = 45,
Zerotorescue@0 692 type = "toggle",
Zerotorescue@68 693 name = L["Auction canceled mail"],
Zerotorescue@68 694 desc = L["Announce when mail is skipped because it's |cfffed000auction canceled mail|r."],
Zerotorescue@0 695 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHcanceled = v; end,
Zerotorescue@0 696 get = function() return MailOpener.db.profile.notifications.skipped.AHcanceled; end,
Zerotorescue@0 697 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 698 },
Zerotorescue@0 699 skippedAHOutbid = {
Zerotorescue@0 700 order = 46,
Zerotorescue@0 701 type = "toggle",
Zerotorescue@68 702 name = L["Auction outbid mail"],
Zerotorescue@68 703 desc = L["Announce when mail is skipped because it's |cfffed000auction outbid mail|r."],
Zerotorescue@0 704 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHoutbid = v; end,
Zerotorescue@0 705 get = function() return MailOpener.db.profile.notifications.skipped.AHoutbid; end,
Zerotorescue@0 706 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 707 },
Zerotorescue@0 708 skippedOther = {
Zerotorescue@0 709 order = 47,
Zerotorescue@0 710 type = "toggle",
Zerotorescue@68 711 name = L["Other mail (e.g. plain text)"],
Zerotorescue@68 712 desc = L["Announce when mail is skipped because it's |cfffed000any other kind of mail|r (e.g. plain text)."],
Zerotorescue@0 713 set = function(i, v) MailOpener.db.profile.notifications.skipped.other = v; end,
Zerotorescue@0 714 get = function() return MailOpener.db.profile.notifications.skipped.other; end,
Zerotorescue@0 715 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 716 },
Zerotorescue@0 717 },
Zerotorescue@0 718 }, -- end Mail Skipped Notifications config inline group
Zerotorescue@0 719
Zerotorescue@0 720 -- Mail Processed Notifications config inline group
Zerotorescue@0 721 mailProcessed = {
Zerotorescue@0 722 order = 40,
Zerotorescue@0 723 type = "group",
Zerotorescue@0 724 inline = true,
Zerotorescue@68 725 name = L["Mail Processed Notifications"],
Zerotorescue@0 726 args = {
Zerotorescue@0 727 descriptionMailProcessed = {
Zerotorescue@0 728 order = 61,
Zerotorescue@0 729 type = "description",
Zerotorescue@68 730 name = L["Announce when mail is processed because..."],
Zerotorescue@0 731 },
Zerotorescue@0 732
Zerotorescue@0 733 processedToggleAll = {
Zerotorescue@0 734 order = 65,
Zerotorescue@0 735 type = "toggle",
Zerotorescue@68 736 name = L["Toggle everything"],
Zerotorescue@68 737 desc = L["Announce when mail is processed for |cfffed000any|r reason."],
Zerotorescue@0 738 set = function(i, v) MailOpener.db.profile.notifications.processed.all = v; end,
Zerotorescue@0 739 get = function() return MailOpener.db.profile.notifications.processed.all; end,
Zerotorescue@0 740 },
Zerotorescue@0 741 processedNormalGoldMail = {
Zerotorescue@0 742 order = 70,
Zerotorescue@0 743 type = "toggle",
Zerotorescue@68 744 name = L["Normal mail with gold"],
Zerotorescue@68 745 desc = L["Announce when mail is processed because it's |cfffed000normal mail containing gold|r."],
Zerotorescue@0 746 set = function(i, v) MailOpener.db.profile.notifications.processed.normalGoldMail = v; end,
Zerotorescue@0 747 get = function() return MailOpener.db.profile.notifications.processed.normalGoldMail; end,
Zerotorescue@0 748 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 749 },
Zerotorescue@0 750 processedNormalItemsMail = {
Zerotorescue@0 751 order = 71,
Zerotorescue@0 752 type = "toggle",
Zerotorescue@68 753 name = L["Normal mail with attachments"],
Zerotorescue@68 754 desc = L["Announce when mail is processed because it's |cfffed000normal mail containing items|r."],
Zerotorescue@0 755 set = function(i, v) MailOpener.db.profile.notifications.processed.normalItemsMail = v; end,
Zerotorescue@0 756 get = function() return MailOpener.db.profile.notifications.processed.normalItemsMail; end,
Zerotorescue@0 757 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 758 },
Zerotorescue@0 759 processedAHExpired = {
Zerotorescue@0 760 order = 72,
Zerotorescue@0 761 type = "toggle",
Zerotorescue@68 762 name = L["Auction expired mail"],
Zerotorescue@68 763 desc = L["Announce when mail is processed because it's |cfffed000auction expired mail|r."],
Zerotorescue@0 764 set = function(i, v) MailOpener.db.profile.notifications.processed.AHexpired = v; end,
Zerotorescue@0 765 get = function() return MailOpener.db.profile.notifications.processed.AHexpired; end,
Zerotorescue@0 766 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 767 },
Zerotorescue@0 768 processedAHSuccessful = {
Zerotorescue@0 769 order = 73,
Zerotorescue@0 770 type = "toggle",
Zerotorescue@68 771 name = L["Auction successful mail"],
Zerotorescue@68 772 desc = L["Announce when mail is processed because it's |cfffed000auction successful mail|r."],
Zerotorescue@0 773 set = function(i, v) MailOpener.db.profile.notifications.processed.AHsuccess = v; end,
Zerotorescue@0 774 get = function() return MailOpener.db.profile.notifications.processed.AHsuccess; end,
Zerotorescue@0 775 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 776 },
Zerotorescue@0 777 processedAHWon = {
Zerotorescue@0 778 order = 74,
Zerotorescue@0 779 type = "toggle",
Zerotorescue@68 780 name = L["Auction won mail"],
Zerotorescue@68 781 desc = L["Announce when mail is processed because it's |cfffed000auction won mail|r."],
Zerotorescue@0 782 set = function(i, v) MailOpener.db.profile.notifications.processed.AHwon = v; end,
Zerotorescue@0 783 get = function() return MailOpener.db.profile.notifications.processed.AHwon; end,
Zerotorescue@0 784 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 785 },
Zerotorescue@0 786 processedAHCanceled = {
Zerotorescue@0 787 order = 75,
Zerotorescue@0 788 type = "toggle",
Zerotorescue@68 789 name = L["Auction canceled mail"],
Zerotorescue@68 790 desc = L["Announce when mail is processed because it's |cfffed000auction canceled mail|r."],
Zerotorescue@0 791 set = function(i, v) MailOpener.db.profile.notifications.processed.AHcanceled = v; end,
Zerotorescue@0 792 get = function() return MailOpener.db.profile.notifications.processed.AHcanceled; end,
Zerotorescue@0 793 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 794 },
Zerotorescue@0 795 processedAHOutbid = {
Zerotorescue@0 796 order = 76,
Zerotorescue@0 797 type = "toggle",
Zerotorescue@68 798 name = L["Auction outbid mail"],
Zerotorescue@68 799 desc = L["Announce when mail is processed because it's |cfffed000auction outbid mail|r."],
Zerotorescue@0 800 set = function(i, v) MailOpener.db.profile.notifications.processed.AHoutbid = v; end,
Zerotorescue@0 801 get = function() return MailOpener.db.profile.notifications.processed.AHoutbid; end,
Zerotorescue@0 802 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 803 },
Zerotorescue@0 804 processedOther = {
Zerotorescue@0 805 order = 77,
Zerotorescue@0 806 type = "toggle",
Zerotorescue@68 807 name = L["Other mail (e.g. plain text)"],
Zerotorescue@68 808 desc = L["Announce when mail is processed because it's |cfffed000any other kind of mail|r (e.g. plain text)."],
Zerotorescue@0 809 set = function(i, v) MailOpener.db.profile.notifications.processed.other = v; end,
Zerotorescue@0 810 get = function() return MailOpener.db.profile.notifications.processed.other; end,
Zerotorescue@0 811 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 812 },
Zerotorescue@0 813 },
Zerotorescue@0 814 }, -- end Mail Processed Notifications config inline group
Zerotorescue@0 815
Zerotorescue@0 816 -- Sound Notifications config inline group
Zerotorescue@0 817 sound = {
Zerotorescue@0 818 order = 50,
Zerotorescue@0 819 type = "group",
Zerotorescue@0 820 inline = true,
Zerotorescue@68 821 name = L["Sound Notifications"],
Zerotorescue@0 822 args = {
Zerotorescue@42 823 descriptionMailProcessed = {
Zerotorescue@42 824 order = 61,
Zerotorescue@42 825 type = "description",
Zerotorescue@68 826 name = L["Play a sound when..."],
Zerotorescue@42 827 },
Zerotorescue@0 828 bagsFullSound = {
Zerotorescue@0 829 order = 100,
Zerotorescue@0 830 type = "toggle",
Zerotorescue@68 831 name = L["Inventory is full"],
Zerotorescue@68 832 desc = L["Play a sound when your inventory is full. You can select what sound in the select box next to this."],
Zerotorescue@0 833 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSound = v; end,
Zerotorescue@0 834 get = function() return MailOpener.db.profile.notifications.bagsFullSound; end,
Zerotorescue@42 835 width = "medium",
Zerotorescue@0 836 },
Zerotorescue@0 837 bagsFullSoundFile = {
Zerotorescue@0 838 order = 101,
Zerotorescue@0 839 type = "select",
Zerotorescue@68 840 name = L["Sound File"],
Zerotorescue@68 841 desc = L["Sound file to play when your bags are full."],
Zerotorescue@0 842 dialogControl = "LSM30_Sound",
Zerotorescue@0 843 set = function(i, v)
Zerotorescue@0 844 MailOpener.db.profile.notifications.bagsFullSoundFile = Media:Fetch("sound", v);
Zerotorescue@0 845 MailOpener.db.profile.notifications.bagsFullSoundFileName = v;
Zerotorescue@0 846
Zerotorescue@0 847 PlaySoundFile(MailOpener.db.profile.notifications.bagsFullSoundFile);
Zerotorescue@0 848
Zerotorescue@68 849 MailOpener:Print(L["You may have to increase the mail opening interval if this sound effect gets spammy. The recommended value is 10 seconds."]);
Zerotorescue@0 850 end,
Zerotorescue@0 851 get = function() return MailOpener.db.profile.notifications.bagsFullSoundFileName end,
Zerotorescue@0 852 values = function () return (Media:HashTable("sound") or nil); end,
Zerotorescue@0 853 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound); end,
Zerotorescue@0 854 },
Zerotorescue@0 855 bagsFullSoundOnlyOnce = {
Zerotorescue@0 856 order = 102,
Zerotorescue@0 857 type = "toggle",
Zerotorescue@68 858 name = L["Only once"],
Zerotorescue@68 859 desc = L["Only play this sound once each time new mail has been arrived or your bags are updated."],
Zerotorescue@0 860 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce = v; end,
Zerotorescue@0 861 get = function() return MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce; end,
Zerotorescue@0 862 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound); end,
Zerotorescue@42 863 --width = "half",
Zerotorescue@42 864 },
Zerotorescue@42 865 bagsFullSoundOnlyOncePerMailboxVisit = {
Zerotorescue@42 866 order = 103,
Zerotorescue@42 867 type = "toggle",
Zerotorescue@68 868 name = L["...per mailbox visit"],
Zerotorescue@68 869 desc = L["Only play this sound once each time you visit the mailbox."],
Zerotorescue@42 870 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSoundOnlyOncePerMailboxVisit = v; end,
Zerotorescue@42 871 get = function() return MailOpener.db.profile.notifications.bagsFullSoundOnlyOncePerMailboxVisit; end,
Zerotorescue@42 872 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound or not MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce); end,
Zerotorescue@0 873 },
Zerotorescue@0 874 mailboxEmptySound = {
Zerotorescue@0 875 order = 110,
Zerotorescue@0 876 type = "toggle",
Zerotorescue@68 877 name = L["No more mail can be opened"],
Zerotorescue@68 878 desc = L["Play a sound when no more mail can be opened. You can select what sound in the select box next to this."],
Zerotorescue@0 879 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySound = v; end,
Zerotorescue@0 880 get = function() return MailOpener.db.profile.notifications.mailboxEmptySound; end,
Zerotorescue@42 881 --width = "double",
Zerotorescue@0 882 },
Zerotorescue@0 883 mailboxEmptySoundFile = {
Zerotorescue@0 884 order = 111,
Zerotorescue@0 885 type = "select",
Zerotorescue@68 886 name = L["Sound File"],
Zerotorescue@68 887 desc = L["Sound file to play when Mail Opener can't open any more mail."],
Zerotorescue@0 888 dialogControl = "LSM30_Sound",
Zerotorescue@0 889 set = function(i, v)
Zerotorescue@0 890 MailOpener.db.profile.notifications.mailboxEmptySoundFile = Media:Fetch("sound", v);
Zerotorescue@0 891 MailOpener.db.profile.notifications.mailboxEmptySoundFileName = v;
Zerotorescue@0 892
Zerotorescue@0 893 PlaySoundFile(MailOpener.db.profile.notifications.mailboxEmptySoundFile);
Zerotorescue@0 894
Zerotorescue@68 895 MailOpener:Print(L["You may have to increase the mail opening interval if this sound effect gets spammy. The recommended value is 10 seconds."]);
Zerotorescue@0 896 end,
Zerotorescue@0 897 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundFileName end,
Zerotorescue@0 898 values = function () return (Media:HashTable("sound") or nil); end,
Zerotorescue@0 899 disabled = function() return (not MailOpener.db.profile.notifications.mailboxEmptySound); end,
Zerotorescue@0 900 },
Zerotorescue@0 901 mailboxEmptySoundOnlyOnce = {
Zerotorescue@0 902 order = 112,
Zerotorescue@0 903 type = "toggle",
Zerotorescue@68 904 name = L["Only once"],
Zerotorescue@68 905 desc = L["Only play this sound once each time new mail has been arrived."],
Zerotorescue@0 906 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce = v; end,
Zerotorescue@0 907 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce; end,
Zerotorescue@0 908 disabled = function() return (not MailOpener.db.profile.notifications.mailboxEmptySound); end,
Zerotorescue@42 909 --width = "half",
Zerotorescue@42 910 },
Zerotorescue@42 911 mailboxEmptySoundOnlyOncePerMailboxVisit = {
Zerotorescue@42 912 order = 113,
Zerotorescue@42 913 type = "toggle",
Zerotorescue@68 914 name = L["...per mailbox visit"],
Zerotorescue@68 915 desc = L["Only play this sound once each time you visit the mailbox."],
Zerotorescue@42 916 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOncePerMailboxVisit = v; end,
Zerotorescue@42 917 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOncePerMailboxVisit; end,
Zerotorescue@42 918 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound or not MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce); end,
Zerotorescue@0 919 },
Zerotorescue@0 920 },
Zerotorescue@0 921 }, -- end Sound Notifications config inline group
Zerotorescue@0 922 },
Zerotorescue@0 923 };
Zerotorescue@0 924
Zerotorescue@0 925 return notificationsConfigGroup;
Zerotorescue@0 926 end