annotate Modules/Config.lua @ 48:f630d882d008

Added a tooltip to the "Open all"-button showing the possible events (shift click and right click). Right clicking the "Open all"-button will now show a drop down menu with the possible filters, allowing you to quickly toggle them.
author Zerotorescue
date Sun, 12 Sep 2010 20:30:46 +0200
parents 1243c2d2b85e
children fcc7112cc365
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@0 314 autoDisableQAAutoMail = {
Zerotorescue@0 315 order = 20,
Zerotorescue@0 316 type = "toggle",
Zerotorescue@39 317 name = "Turn Quick Auction's auto mail status |cffff0000off|r when opening mail",
Zerotorescue@39 318 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 319 width = "full",
Zerotorescue@0 320 get = function() return MailOpener.db.profile.general.autoDisableQAAutoMail; end,
Zerotorescue@0 321 set = function(i, v) MailOpener.db.profile.general.autoDisableQAAutoMail = v; end,
Zerotorescue@0 322 hidden = (not MailOpener.QuickAuctionsEnabled),
Zerotorescue@0 323 },
Zerotorescue@0 324 autoReenableQAAutoMail = {
Zerotorescue@0 325 order = 30,
Zerotorescue@0 326 type = "toggle",
Zerotorescue@39 327 name = "Turn Quick Auction's auto mail status |cff00ff00on|r after opening mail has finished",
Zerotorescue@39 328 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 329 width = "full",
Zerotorescue@0 330 get = function() return MailOpener.db.profile.general.autoReenableQAAutoMail; end,
Zerotorescue@0 331 set = function(i, v) MailOpener.db.profile.general.autoReenableQAAutoMail = v; end,
Zerotorescue@0 332 hidden = (not MailOpener.QuickAuctionsEnabled),
Zerotorescue@0 333 disabled = function() return (MailOpener.db.profile.general.autoSetBackQAAutoMail and not MailOpener.db.profile.general.autoReenableQAAutoMail); end,
Zerotorescue@0 334 },
Zerotorescue@0 335 autoSetBackQAAutoMail = {
Zerotorescue@0 336 order = 40,
Zerotorescue@0 337 type = "toggle",
Zerotorescue@39 338 name = "Set Quick Auction's auto mail status |cff00ffffback|r after opening mail has finished (remember it)",
Zerotorescue@0 339 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 340 width = "full",
Zerotorescue@0 341 get = function() return MailOpener.db.profile.general.autoSetBackQAAutoMail; end,
Zerotorescue@0 342 set = function(i, v) MailOpener.db.profile.general.autoSetBackQAAutoMail = v; end,
Zerotorescue@0 343 hidden = (not MailOpener.QuickAuctionsEnabled),
Zerotorescue@0 344 disabled = function() return (MailOpener.db.profile.general.autoReenableQAAutoMail and not MailOpener.db.profile.general.autoSetBackQAAutoMail); end,
Zerotorescue@0 345 },
Zerotorescue@0 346 },
Zerotorescue@0 347 }, -- end General config inline group
Zerotorescue@0 348 -- Profile config inline group
Zerotorescue@0 349 profileConfig = {
Zerotorescue@0 350 order = 15,
Zerotorescue@0 351 type = "group",
Zerotorescue@0 352 inline = true,
Zerotorescue@0 353 name = "New Character Specfic Profile",
Zerotorescue@0 354 args = {
Zerotorescue@0 355 description = {
Zerotorescue@0 356 order = 10,
Zerotorescue@0 357 type = "description",
Zerotorescue@0 358 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 359 },
Zerotorescue@0 360 header = {
Zerotorescue@0 361 order = 15,
Zerotorescue@0 362 type = "header",
Zerotorescue@0 363 name = "",
Zerotorescue@0 364 },
Zerotorescue@0 365 createNewProfile = {
Zerotorescue@0 366 order = 20,
Zerotorescue@0 367 type = "execute",
Zerotorescue@0 368 name = "Create a new character specific profile",
Zerotorescue@0 369 desc = "Create a new profile for this user. You can also make profile groups at the profiles tab to the left.",
Zerotorescue@0 370 width = "double",
Zerotorescue@0 371 func = function()
Zerotorescue@0 372 MailOpener.db:SetProfile(UnitName("player") .. " - " .. GetRealmName());
Zerotorescue@0 373 end,
Zerotorescue@0 374 },
Zerotorescue@0 375 },
Zerotorescue@0 376 }, -- end Profile config inline group
Zerotorescue@0 377 },
Zerotorescue@0 378 };
Zerotorescue@0 379
Zerotorescue@0 380 return generalConfigGroup;
Zerotorescue@0 381 end
Zerotorescue@0 382
Zerotorescue@31 383 function mod:GetNotificationsOptions()
Zerotorescue@0 384 local notificationsConfigGroup = {
Zerotorescue@0 385 order = 200,
Zerotorescue@0 386 type = "group",
Zerotorescue@0 387 name = "Notifications",
Zerotorescue@0 388 desc = "Toggle notifications.",
Zerotorescue@0 389 args = {
Zerotorescue@0 390 -- Notifications config inline group
Zerotorescue@0 391 nofitications = {
Zerotorescue@0 392 order = 10,
Zerotorescue@0 393 type = "group",
Zerotorescue@0 394 inline = true,
Zerotorescue@0 395 name = "Notifications",
Zerotorescue@0 396 args = {
Zerotorescue@0 397 description = {
Zerotorescue@0 398 order = 10,
Zerotorescue@0 399 type = "description",
Zerotorescue@0 400 name = "Toggle which notification you wish to see.",
Zerotorescue@0 401 },
Zerotorescue@0 402 },
Zerotorescue@0 403 }, -- end Notifications config inline group
Zerotorescue@0 404
Zerotorescue@0 405 -- General Notifications config inline group
Zerotorescue@0 406 general = {
Zerotorescue@0 407 order = 20,
Zerotorescue@0 408 type = "group",
Zerotorescue@0 409 inline = true,
Zerotorescue@0 410 name = "General Notifications",
Zerotorescue@0 411 args = {
Zerotorescue@0 412 welcome = {
Zerotorescue@0 413 order = 20,
Zerotorescue@0 414 type = "toggle",
Zerotorescue@0 415 name = "Show message when |cfffed000opening the mailbox|r",
Zerotorescue@0 416 desc = "Print the welcome message whenever you open the mailbox.",
Zerotorescue@0 417 set = function(i, v) MailOpener.db.profile.notifications.welcome = v; end,
Zerotorescue@0 418 get = function() return MailOpener.db.profile.notifications.welcome; end,
Zerotorescue@0 419 width = "double",
Zerotorescue@0 420 },
Zerotorescue@0 421 bye = {
Zerotorescue@0 422 order = 21,
Zerotorescue@0 423 type = "toggle",
Zerotorescue@0 424 name = "Show message when |cfffed000closing the mailbox|r",
Zerotorescue@0 425 desc = "Print the bye message whenever you close the mailbox.",
Zerotorescue@0 426 set = function(i, v) MailOpener.db.profile.notifications.bye = v; end,
Zerotorescue@0 427 get = function() return MailOpener.db.profile.notifications.bye; end,
Zerotorescue@0 428 width = "double",
Zerotorescue@0 429 },
Zerotorescue@0 430 fishedOpeningBatch = {
Zerotorescue@0 431 order = 22,
Zerotorescue@0 432 type = "toggle",
Zerotorescue@0 433 name = "Announce when |cfffed000finished opening the current batch|r",
Zerotorescue@0 434 desc = "Announce when opening of the current batch of mails has been completed.",
Zerotorescue@0 435 set = function(i, v) MailOpener.db.profile.notifications.finishedCurrentBatch = v; end,
Zerotorescue@0 436 get = function() return MailOpener.db.profile.notifications.finishedCurrentBatch; end,
Zerotorescue@0 437 width = "double",
Zerotorescue@0 438 },
Zerotorescue@0 439 noMoreMailAvailable = {
Zerotorescue@0 440 order = 23,
Zerotorescue@0 441 type = "toggle",
Zerotorescue@0 442 name = "Announce when |cfffed000the mailbox is completely empty|r",
Zerotorescue@0 443 desc = "Announce when there is nothing left for Mail Opener to open.",
Zerotorescue@0 444 set = function(i, v) MailOpener.db.profile.notifications.mailboxIsEmpty = v; end,
Zerotorescue@0 445 get = function() return MailOpener.db.profile.notifications.mailboxIsEmpty; end,
Zerotorescue@0 446 width = "double",
Zerotorescue@0 447 },
Zerotorescue@0 448 },
Zerotorescue@0 449 }, -- end General Notifications config inline group
Zerotorescue@0 450
Zerotorescue@0 451 -- Mail Skipped Notifications config inline group
Zerotorescue@0 452 mailSkipped = {
Zerotorescue@0 453 order = 30,
Zerotorescue@0 454 type = "group",
Zerotorescue@0 455 inline = true,
Zerotorescue@0 456 name = "Mail Skipped Notifications",
Zerotorescue@0 457 args = {
Zerotorescue@0 458 descriptionMailSkipped = {
Zerotorescue@0 459 order = 31,
Zerotorescue@0 460 type = "description",
Zerotorescue@0 461 name = "Announce when mail is skipped because...",
Zerotorescue@0 462 },
Zerotorescue@0 463
Zerotorescue@0 464 skippedToggleAll = {
Zerotorescue@0 465 order = 35,
Zerotorescue@0 466 type = "toggle",
Zerotorescue@0 467 name = "Toggle everything",
Zerotorescue@0 468 desc = "Announce when mail is skipped for |cfffed000any|r reason.",
Zerotorescue@0 469 set = function(i, v) MailOpener.db.profile.notifications.skipped.all = v; end,
Zerotorescue@0 470 get = function() return MailOpener.db.profile.notifications.skipped.all; end,
Zerotorescue@0 471 },
Zerotorescue@0 472 skippedInventoryFull = {
Zerotorescue@0 473 order = 36,
Zerotorescue@0 474 type = "toggle",
Zerotorescue@0 475 name = "Your inventory is full",
Zerotorescue@0 476 desc = "Announce when mail is skipped because |cfffed000your inventory is full|r.",
Zerotorescue@0 477 set = function(i, v) MailOpener.db.profile.notifications.skipped.inventoryFull = v; end,
Zerotorescue@0 478 get = function() return MailOpener.db.profile.notifications.skipped.inventoryFull; end,
Zerotorescue@0 479 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 480 },
Zerotorescue@0 481 skippedKeepFreeSpaceLimit = {
Zerotorescue@0 482 order = 37,
Zerotorescue@0 483 type = "toggle",
Zerotorescue@0 484 name = "Keep free space limit reached",
Zerotorescue@0 485 desc = "Announce when mail is skipped because |cfffed000the keep free space limit has been reached|r.",
Zerotorescue@0 486 set = function(i, v) MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit = v; end,
Zerotorescue@0 487 get = function() return MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit; end,
Zerotorescue@0 488 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 489 },
Zerotorescue@0 490 skippedGMMail = {
Zerotorescue@0 491 order = 38,
Zerotorescue@0 492 type = "toggle",
Zerotorescue@0 493 name = "GM mail",
Zerotorescue@0 494 desc = "Announce when mail is skipped because it's |cfffed000mail sent by a Game Master|r.",
Zerotorescue@0 495 set = function(i, v) MailOpener.db.profile.notifications.skipped.GMMail = v; end,
Zerotorescue@0 496 get = function() return MailOpener.db.profile.notifications.skipped.GMMail; end,
Zerotorescue@0 497 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 498 },
Zerotorescue@0 499 skippedCOD = {
Zerotorescue@0 500 order = 39,
Zerotorescue@0 501 type = "toggle",
Zerotorescue@0 502 name = "C.O.D. mail",
Zerotorescue@0 503 desc = "Announce when mail is skipped because it's |cfffed000a Cost On Delivery mail|r.",
Zerotorescue@0 504 set = function(i, v) MailOpener.db.profile.notifications.skipped.COD = v; end,
Zerotorescue@0 505 get = function() return MailOpener.db.profile.notifications.skipped.COD; end,
Zerotorescue@0 506 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 507 },
Zerotorescue@0 508 skippedNormalGoldMail = {
Zerotorescue@0 509 order = 40,
Zerotorescue@0 510 type = "toggle",
Zerotorescue@0 511 name = "Normal mail with gold",
Zerotorescue@0 512 desc = "Announce when mail is skipped because it's |cfffed000normal mail containing gold|r.",
Zerotorescue@0 513 set = function(i, v) MailOpener.db.profile.notifications.skipped.normalGoldMail = v; end,
Zerotorescue@0 514 get = function() return MailOpener.db.profile.notifications.skipped.normalGoldMail; end,
Zerotorescue@0 515 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 516 },
Zerotorescue@0 517 skippedNormalItemsMail = {
Zerotorescue@0 518 order = 41,
Zerotorescue@0 519 type = "toggle",
Zerotorescue@0 520 name = "Normal mail with attachments",
Zerotorescue@0 521 desc = "Announce when mail is skipped because it's |cfffed000normal mail containing items|r.",
Zerotorescue@0 522 set = function(i, v) MailOpener.db.profile.notifications.skipped.normalItemsMail = v; end,
Zerotorescue@0 523 get = function() return MailOpener.db.profile.notifications.skipped.normalItemsMail; end,
Zerotorescue@0 524 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 525 },
Zerotorescue@0 526 skippedAHExpired = {
Zerotorescue@0 527 order = 42,
Zerotorescue@0 528 type = "toggle",
Zerotorescue@0 529 name = "Auction expired mail",
Zerotorescue@0 530 desc = "Announce when mail is skipped because it's |cfffed000auction expired mail|r.",
Zerotorescue@0 531 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHexpired = v; end,
Zerotorescue@0 532 get = function() return MailOpener.db.profile.notifications.skipped.AHexpired; end,
Zerotorescue@0 533 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 534 },
Zerotorescue@0 535 skippedAHSuccessful = {
Zerotorescue@0 536 order = 43,
Zerotorescue@0 537 type = "toggle",
Zerotorescue@0 538 name = "Auction successful mail",
Zerotorescue@0 539 desc = "Announce when mail is skipped because it's |cfffed000auction successful mail|r.",
Zerotorescue@0 540 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHsuccess = v; end,
Zerotorescue@0 541 get = function() return MailOpener.db.profile.notifications.skipped.AHsuccess; end,
Zerotorescue@0 542 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 543 },
Zerotorescue@0 544 skippedAHWon = {
Zerotorescue@0 545 order = 44,
Zerotorescue@0 546 type = "toggle",
Zerotorescue@0 547 name = "Auction won mail",
Zerotorescue@0 548 desc = "Announce when mail is skipped because it's |cfffed000auction won mail|r.",
Zerotorescue@0 549 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHwon = v; end,
Zerotorescue@0 550 get = function() return MailOpener.db.profile.notifications.skipped.AHwon; end,
Zerotorescue@0 551 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 552 },
Zerotorescue@0 553 skippedAHCanceled = {
Zerotorescue@0 554 order = 45,
Zerotorescue@0 555 type = "toggle",
Zerotorescue@0 556 name = "Auction canceled mail",
Zerotorescue@0 557 desc = "Announce when mail is skipped because it's |cfffed000auction canceled mail|r.",
Zerotorescue@0 558 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHcanceled = v; end,
Zerotorescue@0 559 get = function() return MailOpener.db.profile.notifications.skipped.AHcanceled; end,
Zerotorescue@0 560 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 561 },
Zerotorescue@0 562 skippedAHOutbid = {
Zerotorescue@0 563 order = 46,
Zerotorescue@0 564 type = "toggle",
Zerotorescue@0 565 name = "Auction outbid mail",
Zerotorescue@0 566 desc = "Announce when mail is skipped because it's |cfffed000auction outbid mail|r.",
Zerotorescue@0 567 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHoutbid = v; end,
Zerotorescue@0 568 get = function() return MailOpener.db.profile.notifications.skipped.AHoutbid; end,
Zerotorescue@0 569 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 570 },
Zerotorescue@0 571 skippedOther = {
Zerotorescue@0 572 order = 47,
Zerotorescue@0 573 type = "toggle",
Zerotorescue@0 574 name = "Other mail (e.g. plain text)",
Zerotorescue@0 575 desc = "Announce when mail is skipped because it's |cfffed000any other kind of mail|r (e.g. plain text).",
Zerotorescue@0 576 set = function(i, v) MailOpener.db.profile.notifications.skipped.other = v; end,
Zerotorescue@0 577 get = function() return MailOpener.db.profile.notifications.skipped.other; end,
Zerotorescue@0 578 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end,
Zerotorescue@0 579 },
Zerotorescue@0 580 },
Zerotorescue@0 581 }, -- end Mail Skipped Notifications config inline group
Zerotorescue@0 582
Zerotorescue@0 583 -- Mail Processed Notifications config inline group
Zerotorescue@0 584 mailProcessed = {
Zerotorescue@0 585 order = 40,
Zerotorescue@0 586 type = "group",
Zerotorescue@0 587 inline = true,
Zerotorescue@0 588 name = "Mail Processed Notifications",
Zerotorescue@0 589 args = {
Zerotorescue@0 590 descriptionMailProcessed = {
Zerotorescue@0 591 order = 61,
Zerotorescue@0 592 type = "description",
Zerotorescue@0 593 name = "Announce when mail is processed because...",
Zerotorescue@0 594 },
Zerotorescue@0 595
Zerotorescue@0 596 processedToggleAll = {
Zerotorescue@0 597 order = 65,
Zerotorescue@0 598 type = "toggle",
Zerotorescue@0 599 name = "Toggle everything",
Zerotorescue@0 600 desc = "Announce when mail is processed for |cfffed000any|r reason.",
Zerotorescue@0 601 set = function(i, v) MailOpener.db.profile.notifications.processed.all = v; end,
Zerotorescue@0 602 get = function() return MailOpener.db.profile.notifications.processed.all; end,
Zerotorescue@0 603 },
Zerotorescue@0 604 processedNormalGoldMail = {
Zerotorescue@0 605 order = 70,
Zerotorescue@0 606 type = "toggle",
Zerotorescue@0 607 name = "Normal mail with gold",
Zerotorescue@0 608 desc = "Announce when mail is processed because it's |cfffed000normal mail containing gold|r.",
Zerotorescue@0 609 set = function(i, v) MailOpener.db.profile.notifications.processed.normalGoldMail = v; end,
Zerotorescue@0 610 get = function() return MailOpener.db.profile.notifications.processed.normalGoldMail; end,
Zerotorescue@0 611 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 612 },
Zerotorescue@0 613 processedNormalItemsMail = {
Zerotorescue@0 614 order = 71,
Zerotorescue@0 615 type = "toggle",
Zerotorescue@0 616 name = "Normal mail with attachments",
Zerotorescue@0 617 desc = "Announce when mail is processed because it's |cfffed000normal mail containing items|r.",
Zerotorescue@0 618 set = function(i, v) MailOpener.db.profile.notifications.processed.normalItemsMail = v; end,
Zerotorescue@0 619 get = function() return MailOpener.db.profile.notifications.processed.normalItemsMail; end,
Zerotorescue@0 620 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 621 },
Zerotorescue@0 622 processedAHExpired = {
Zerotorescue@0 623 order = 72,
Zerotorescue@0 624 type = "toggle",
Zerotorescue@0 625 name = "Auction expired mail",
Zerotorescue@0 626 desc = "Announce when mail is processed because it's |cfffed000auction expired mail|r.",
Zerotorescue@0 627 set = function(i, v) MailOpener.db.profile.notifications.processed.AHexpired = v; end,
Zerotorescue@0 628 get = function() return MailOpener.db.profile.notifications.processed.AHexpired; end,
Zerotorescue@0 629 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 630 },
Zerotorescue@0 631 processedAHSuccessful = {
Zerotorescue@0 632 order = 73,
Zerotorescue@0 633 type = "toggle",
Zerotorescue@0 634 name = "Auction successful mail",
Zerotorescue@0 635 desc = "Announce when mail is processed because it's |cfffed000auction successful mail|r.",
Zerotorescue@0 636 set = function(i, v) MailOpener.db.profile.notifications.processed.AHsuccess = v; end,
Zerotorescue@0 637 get = function() return MailOpener.db.profile.notifications.processed.AHsuccess; end,
Zerotorescue@0 638 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 639 },
Zerotorescue@0 640 processedAHWon = {
Zerotorescue@0 641 order = 74,
Zerotorescue@0 642 type = "toggle",
Zerotorescue@0 643 name = "Auction won mail",
Zerotorescue@0 644 desc = "Announce when mail is processed because it's |cfffed000auction won mail|r.",
Zerotorescue@0 645 set = function(i, v) MailOpener.db.profile.notifications.processed.AHwon = v; end,
Zerotorescue@0 646 get = function() return MailOpener.db.profile.notifications.processed.AHwon; end,
Zerotorescue@0 647 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 648 },
Zerotorescue@0 649 processedAHCanceled = {
Zerotorescue@0 650 order = 75,
Zerotorescue@0 651 type = "toggle",
Zerotorescue@0 652 name = "Auction canceled mail",
Zerotorescue@0 653 desc = "Announce when mail is processed because it's |cfffed000auction canceled mail|r.",
Zerotorescue@0 654 set = function(i, v) MailOpener.db.profile.notifications.processed.AHcanceled = v; end,
Zerotorescue@0 655 get = function() return MailOpener.db.profile.notifications.processed.AHcanceled; end,
Zerotorescue@0 656 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 657 },
Zerotorescue@0 658 processedAHOutbid = {
Zerotorescue@0 659 order = 76,
Zerotorescue@0 660 type = "toggle",
Zerotorescue@0 661 name = "Auction outbid mail",
Zerotorescue@0 662 desc = "Announce when mail is processed because it's |cfffed000auction outbid mail|r.",
Zerotorescue@0 663 set = function(i, v) MailOpener.db.profile.notifications.processed.AHoutbid = v; end,
Zerotorescue@0 664 get = function() return MailOpener.db.profile.notifications.processed.AHoutbid; end,
Zerotorescue@0 665 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 666 },
Zerotorescue@0 667 processedOther = {
Zerotorescue@0 668 order = 77,
Zerotorescue@0 669 type = "toggle",
Zerotorescue@0 670 name = "Other mail (e.g. plain text)",
Zerotorescue@0 671 desc = "Announce when mail is processed because it's |cfffed000any other kind of mail|r (e.g. plain text).",
Zerotorescue@0 672 set = function(i, v) MailOpener.db.profile.notifications.processed.other = v; end,
Zerotorescue@0 673 get = function() return MailOpener.db.profile.notifications.processed.other; end,
Zerotorescue@0 674 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end,
Zerotorescue@0 675 },
Zerotorescue@0 676 },
Zerotorescue@0 677 }, -- end Mail Processed Notifications config inline group
Zerotorescue@0 678
Zerotorescue@0 679 -- Sound Notifications config inline group
Zerotorescue@0 680 sound = {
Zerotorescue@0 681 order = 50,
Zerotorescue@0 682 type = "group",
Zerotorescue@0 683 inline = true,
Zerotorescue@0 684 name = "Sound Notifications",
Zerotorescue@0 685 args = {
Zerotorescue@42 686 descriptionMailProcessed = {
Zerotorescue@42 687 order = 61,
Zerotorescue@42 688 type = "description",
Zerotorescue@42 689 name = "Play a sound when...",
Zerotorescue@42 690 },
Zerotorescue@0 691 bagsFullSound = {
Zerotorescue@0 692 order = 100,
Zerotorescue@0 693 type = "toggle",
Zerotorescue@42 694 name = "Inventory is full",
Zerotorescue@0 695 desc = "Play a sound when your inventory is full. You can select what sound in the select box next to this.",
Zerotorescue@0 696 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSound = v; end,
Zerotorescue@0 697 get = function() return MailOpener.db.profile.notifications.bagsFullSound; end,
Zerotorescue@42 698 width = "medium",
Zerotorescue@0 699 },
Zerotorescue@0 700 bagsFullSoundFile = {
Zerotorescue@0 701 order = 101,
Zerotorescue@0 702 type = "select",
Zerotorescue@0 703 name = "Sound File",
Zerotorescue@0 704 desc = "Sound file to play when your bags are full.",
Zerotorescue@0 705 dialogControl = "LSM30_Sound",
Zerotorescue@0 706 set = function(i, v)
Zerotorescue@0 707 MailOpener.db.profile.notifications.bagsFullSoundFile = Media:Fetch("sound", v);
Zerotorescue@0 708 MailOpener.db.profile.notifications.bagsFullSoundFileName = v;
Zerotorescue@0 709
Zerotorescue@0 710 PlaySoundFile(MailOpener.db.profile.notifications.bagsFullSoundFile);
Zerotorescue@0 711
Zerotorescue@0 712 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 713 end,
Zerotorescue@0 714 get = function() return MailOpener.db.profile.notifications.bagsFullSoundFileName end,
Zerotorescue@0 715 values = function () return (Media:HashTable("sound") or nil); end,
Zerotorescue@0 716 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound); end,
Zerotorescue@0 717 },
Zerotorescue@0 718 bagsFullSoundOnlyOnce = {
Zerotorescue@0 719 order = 102,
Zerotorescue@0 720 type = "toggle",
Zerotorescue@0 721 name = "Only once",
Zerotorescue@42 722 desc = "Only play this sound once each time new mail has been arrived or your bags are updated.",
Zerotorescue@0 723 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce = v; end,
Zerotorescue@0 724 get = function() return MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce; end,
Zerotorescue@0 725 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound); end,
Zerotorescue@42 726 --width = "half",
Zerotorescue@42 727 },
Zerotorescue@42 728 bagsFullSoundOnlyOncePerMailboxVisit = {
Zerotorescue@42 729 order = 103,
Zerotorescue@42 730 type = "toggle",
Zerotorescue@42 731 name = "...per mailbox visit",
Zerotorescue@42 732 desc = "Only play this sound once each time you visit the mailbox.",
Zerotorescue@42 733 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSoundOnlyOncePerMailboxVisit = v; end,
Zerotorescue@42 734 get = function() return MailOpener.db.profile.notifications.bagsFullSoundOnlyOncePerMailboxVisit; end,
Zerotorescue@42 735 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound or not MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce); end,
Zerotorescue@0 736 },
Zerotorescue@0 737 mailboxEmptySound = {
Zerotorescue@0 738 order = 110,
Zerotorescue@0 739 type = "toggle",
Zerotorescue@42 740 name = "No more mail can be opened",
Zerotorescue@0 741 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 742 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySound = v; end,
Zerotorescue@0 743 get = function() return MailOpener.db.profile.notifications.mailboxEmptySound; end,
Zerotorescue@42 744 --width = "double",
Zerotorescue@0 745 },
Zerotorescue@0 746 mailboxEmptySoundFile = {
Zerotorescue@0 747 order = 111,
Zerotorescue@0 748 type = "select",
Zerotorescue@0 749 name = "Sound File",
Zerotorescue@0 750 desc = "Sound file to play when Mail Opener can't open any more mail.",
Zerotorescue@0 751 dialogControl = "LSM30_Sound",
Zerotorescue@0 752 set = function(i, v)
Zerotorescue@0 753 MailOpener.db.profile.notifications.mailboxEmptySoundFile = Media:Fetch("sound", v);
Zerotorescue@0 754 MailOpener.db.profile.notifications.mailboxEmptySoundFileName = v;
Zerotorescue@0 755
Zerotorescue@0 756 PlaySoundFile(MailOpener.db.profile.notifications.mailboxEmptySoundFile);
Zerotorescue@0 757
Zerotorescue@0 758 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 759 end,
Zerotorescue@0 760 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundFileName end,
Zerotorescue@0 761 values = function () return (Media:HashTable("sound") or nil); end,
Zerotorescue@0 762 disabled = function() return (not MailOpener.db.profile.notifications.mailboxEmptySound); end,
Zerotorescue@0 763 },
Zerotorescue@0 764 mailboxEmptySoundOnlyOnce = {
Zerotorescue@0 765 order = 112,
Zerotorescue@0 766 type = "toggle",
Zerotorescue@0 767 name = "Only once",
Zerotorescue@0 768 desc = "Only play this sound once each time new mail has been arrived.",
Zerotorescue@0 769 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce = v; end,
Zerotorescue@0 770 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce; end,
Zerotorescue@0 771 disabled = function() return (not MailOpener.db.profile.notifications.mailboxEmptySound); end,
Zerotorescue@42 772 --width = "half",
Zerotorescue@42 773 },
Zerotorescue@42 774 mailboxEmptySoundOnlyOncePerMailboxVisit = {
Zerotorescue@42 775 order = 113,
Zerotorescue@42 776 type = "toggle",
Zerotorescue@42 777 name = "...per mailbox visit",
Zerotorescue@42 778 desc = "Only play this sound once each time you visit the mailbox.",
Zerotorescue@42 779 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOncePerMailboxVisit = v; end,
Zerotorescue@42 780 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOncePerMailboxVisit; end,
Zerotorescue@42 781 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound or not MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce); end,
Zerotorescue@0 782 },
Zerotorescue@0 783 },
Zerotorescue@0 784 }, -- end Sound Notifications config inline group
Zerotorescue@0 785 },
Zerotorescue@0 786 };
Zerotorescue@0 787
Zerotorescue@0 788 return notificationsConfigGroup;
Zerotorescue@0 789 end