annotate Modules/Config.lua @ 51:fcc7112cc365

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