annotate Modules/Config.lua @ 72:bd12153b6c7a

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