annotate Modules/Config.lua @ 61:7e332c7b599a

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