Mercurial > wow > inventory
comparison Modules/Config.lua @ 176:26c750a10b14
Renamed Inventorium debug channel to IMDebug (so it?s easier to recognize only IM changes, not from other addons), write /im d to register this new channel.
Implemented stock alerts.
Added ?don?t alert at characters? option which allows you to track groups at characters without being bothered about low stock.
You can change the speed of the stock alert at the extra config tab.
author | Zerotorescue |
---|---|
date | Sun, 30 Jan 2011 15:39:18 +0100 |
parents | e31b68c119df |
children | dd0e7e00bb9d |
comparison
equal
deleted
inserted
replaced
175:7aa0850952ef | 176:26c750a10b14 |
---|---|
327 }, | 327 }, |
328 overrideTrackAtCharacters = { | 328 overrideTrackAtCharacters = { |
329 order = 19, | 329 order = 19, |
330 type = "toggle", | 330 type = "toggle", |
331 name = "Override track at", | 331 name = "Override track at", |
332 desc = "Allows you to override at which characters items in this group should appear in the summary and generate alerts.", | 332 desc = "Allows you to override at which characters groups should be tracked, appear in the summary or generate alerts.", |
333 arg = "trackAtCharacters", | 333 arg = "trackAtCharacters", |
334 }, | 334 }, |
335 trackAtCharacters = { | 335 trackAtCharacters = { |
336 order = 20, | 336 order = 20, |
337 type = "multiselect", | 337 type = "multiselect", |
338 name = "Track at", | 338 name = "Track at", |
339 desc = "Select at which characters this should appear in the summary and generate alerts.", | 339 desc = "Select at which characters groups should be tracked, appear in the summary or generate alerts.", |
340 values = function() | 340 values = function() |
341 local temp = {}; | 341 local temp = {}; |
342 for charName in pairs(addon.db.factionrealm.characters) do | 342 for charName in pairs(addon.db.factionrealm.characters) do |
343 temp[charName] = charName; | 343 temp[charName] = charName; |
344 end | 344 end |
346 return temp; | 346 return temp; |
347 end, | 347 end, |
348 get = GetMultiOption, | 348 get = GetMultiOption, |
349 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | 349 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. |
350 arg = "overrideTrackAtCharacters", | 350 arg = "overrideTrackAtCharacters", |
351 }, | |
352 overrideDontAlertAtCharacters = { | |
353 order = 29, | |
354 type = "toggle", | |
355 name = "Override not alerting at", | |
356 desc = "Allows you to override at which characters items in groups should |cffff0000not|r generate alerts when they are below the required stock.", | |
357 arg = "dontAlertAtCharacters", | |
358 }, | |
359 dontAlertAtCharacters = { | |
360 order = 30, | |
361 type = "multiselect", | |
362 name = "Do |cffff0000not|r alert at", | |
363 desc = "Select at which characters items in groups should |cffff0000not|r generate alerts when they are below the required stock.", | |
364 values = function() | |
365 local temp = {}; | |
366 for charName in pairs(addon.db.factionrealm.characters) do | |
367 temp[charName] = charName; | |
368 end | |
369 | |
370 return temp; | |
371 end, | |
372 get = GetMultiOption, | |
373 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | |
374 arg = "overrideDontAlertAtCharacters", | |
351 }, | 375 }, |
352 overrideLocalItemData = { | 376 overrideLocalItemData = { |
353 order = 39, | 377 order = 39, |
354 type = "toggle", | 378 type = "toggle", |
355 name = "Override local item data", | 379 name = "Override local item data", |
1305 -- We want to include the group name, so we copy the table then set another value | 1329 -- We want to include the group name, so we copy the table then set another value |
1306 local temp = CopyTable(addon.db.profile.groups[groupName]); | 1330 local temp = CopyTable(addon.db.profile.groups[groupName]); |
1307 temp.name = groupName; | 1331 temp.name = groupName; |
1308 temp.trackAtCharacters = nil; | 1332 temp.trackAtCharacters = nil; |
1309 temp.overrideTrackAtCharacters = nil; | 1333 temp.overrideTrackAtCharacters = nil; |
1334 temp.dontAlertAtCharacters = nil; | |
1335 temp.overrideDontAlertAtCharacters = nil; | |
1310 | 1336 |
1311 if not AceSerializer then | 1337 if not AceSerializer then |
1312 AceSerializer = LibStub("AceSerializer-3.0"); | 1338 AceSerializer = LibStub("AceSerializer-3.0"); |
1313 end | 1339 end |
1314 | 1340 |
1413 name = "", | 1439 name = "", |
1414 }, | 1440 }, |
1415 trackAtCharacters = { | 1441 trackAtCharacters = { |
1416 order = 10, | 1442 order = 10, |
1417 type = "multiselect", | 1443 type = "multiselect", |
1418 width = "double", | 1444 name = "Track at", |
1419 name = "Track at these characters:", | 1445 desc = "Select at which characters groups should be tracked, appear in the summary or generate alerts.", |
1420 desc = "Select at which characters this should appear in the summary and generate alerts.", | |
1421 values = function() | 1446 values = function() |
1422 local temp = {}; | 1447 local temp = {}; |
1423 for charName in pairs(addon.db.factionrealm.characters) do | 1448 for charName in pairs(addon.db.factionrealm.characters) do |
1424 temp[charName] = charName; | 1449 temp[charName] = charName; |
1425 end | 1450 end |
1432 set = function(i, v, e) | 1457 set = function(i, v, e) |
1433 addon.db.profile.defaults.trackAtCharacters[v] = e or nil; | 1458 addon.db.profile.defaults.trackAtCharacters[v] = e or nil; |
1434 end, | 1459 end, |
1435 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | 1460 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. |
1436 }, | 1461 }, |
1462 dontAlertAtCharacters = { | |
1463 order = 15, | |
1464 type = "multiselect", | |
1465 name = "Do |cffff0000not|r alert at:", | |
1466 desc = "Select at which characters items in groups should |cffff0000not|r generate alerts when they are below the required stock.", | |
1467 values = function() | |
1468 local temp = {}; | |
1469 for charName in pairs(addon.db.factionrealm.characters) do | |
1470 temp[charName] = charName; | |
1471 end | |
1472 | |
1473 return temp; | |
1474 end, | |
1475 get = function(i, v) | |
1476 return addon.db.profile.defaults.dontAlertAtCharacters[v]; | |
1477 end, | |
1478 set = function(i, v, e) | |
1479 addon.db.profile.defaults.dontAlertAtCharacters[v] = e or nil; | |
1480 end, | |
1481 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | |
1482 }, | |
1483 --[[stockLevelAlertScanRepeatInterval = { | |
1484 order = 17, | |
1485 type = "multiselect", | |
1486 name = "Stock scan repeat interval", | |
1487 desc = "Select when or how often your stock levels should be checked and show alerts.", | |
1488 values = { | |
1489 ["00Login"] = "At login", | |
1490 ["01Repeat5"] = "Every 5 minutes", | |
1491 ["02Repeat10"] = "Every 10 minutes", | |
1492 ["03Repeat15"] = "Every 15 minutes", | |
1493 ["04Repeat30"] = "Every 30 minutes", | |
1494 ["05Repeat60"] = "Every 1 hour", | |
1495 ["06Repeat120"] = "Every 2 hours", | |
1496 }, | |
1497 get = function(i, v) return addon.db.profile.defaults.scanRepeatInterval and addon.db.profile.defaults.scanRepeatInterval[v]; end, | |
1498 set = function(i, v, e) addon.db.profile.defaults.scanRepeatInterval[v] = e; end, -- can't be nil or the defaults will be used | |
1499 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | |
1500 },]] | |
1437 localItemData = { | 1501 localItemData = { |
1438 order = 20, | 1502 order = 20, |
1439 type = "multiselect", | 1503 type = "multiselect", |
1440 width = "double", | |
1441 name = "Include in local item data", | 1504 name = "Include in local item data", |
1442 desc = "Select which data should be included in the local item data.", | 1505 desc = "Select which data should be included in the local item data.", |
1443 values = { | 1506 values = { |
1444 ["Bag"] = "Bag", | 1507 ["Bag"] = "Bag", |
1445 ["Bank"] = "Bank", | 1508 ["Bank"] = "Bank", |
1468 order = 5, | 1531 order = 5, |
1469 type = "header", | 1532 type = "header", |
1470 name = "", | 1533 name = "", |
1471 hidden = function() return addon.db.profile.defaults.hideHelp; end, | 1534 hidden = function() return addon.db.profile.defaults.hideHelp; end, |
1472 }, | 1535 }, |
1536 | |
1473 minLocalStock = { | 1537 minLocalStock = { |
1474 order = 10, | 1538 order = 10, |
1475 type = "range", | 1539 type = "range", |
1476 min = 0, | 1540 min = 0, |
1477 max = 100000, | 1541 max = 100000, |
1496 name = "Auto refill from storage", | 1560 name = "Auto refill from storage", |
1497 desc = "Automatically refill items from your storage (bank/mailbox - unless this is included in the local count - or the guild bank) when below the minimum local stock.", | 1561 desc = "Automatically refill items from your storage (bank/mailbox - unless this is included in the local count - or the guild bank) when below the minimum local stock.", |
1498 get = function() return addon.db.profile.defaults.autoRefill; end, | 1562 get = function() return addon.db.profile.defaults.autoRefill; end, |
1499 set = function(i, v) addon.db.profile.defaults.autoRefill = v; end, | 1563 set = function(i, v) addon.db.profile.defaults.autoRefill = v; end, |
1500 }, | 1564 }, |
1565 | |
1501 minGlobalStock = { | 1566 minGlobalStock = { |
1502 order = 20, | 1567 order = 20, |
1503 type = "range", | 1568 type = "range", |
1504 min = 0, | 1569 min = 0, |
1505 max = 100000, | 1570 max = 100000, |
1516 name = "Alert when below global minimum (NYI)", | 1581 name = "Alert when below global minimum (NYI)", |
1517 desc = "Show an alert when this item gets below this threshold.", | 1582 desc = "Show an alert when this item gets below this threshold.", |
1518 get = function() return addon.db.profile.defaults.alertBelowGlobalMinimum; end, | 1583 get = function() return addon.db.profile.defaults.alertBelowGlobalMinimum; end, |
1519 set = function(i, v) addon.db.profile.defaults.alertBelowGlobalMinimum = v; end, | 1584 set = function(i, v) addon.db.profile.defaults.alertBelowGlobalMinimum = v; end, |
1520 }, | 1585 }, |
1586 | |
1521 summaryThresholdShow = { | 1587 summaryThresholdShow = { |
1522 order = 30, | 1588 order = 30, |
1523 type = "range", | 1589 type = "range", |
1524 min = 0, | 1590 min = 0, |
1525 max = 100, | 1591 max = 100, |
1736 values = function() | 1802 values = function() |
1737 local temp = {}; | 1803 local temp = {}; |
1738 | 1804 |
1739 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); | 1805 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); |
1740 | 1806 |
1741 if currentAddon.GetGuildNames then | 1807 if currentAddon and currentAddon.GetGuildNames then |
1742 local guilds = currentAddon.GetGuildNames(); | 1808 local guilds = currentAddon.GetGuildNames(); |
1743 | 1809 |
1744 if guilds and type(guilds) == "table" then | 1810 if guilds and type(guilds) == "table" then |
1745 for guildName, state in pairs(guilds) do | 1811 for guildName, state in pairs(guilds) do |
1746 temp[guildName] = guildName; | 1812 temp[guildName] = guildName; |
1757 return temp; | 1823 return temp; |
1758 end, | 1824 end, |
1759 get = function(i, v) | 1825 get = function(i, v) |
1760 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); | 1826 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); |
1761 | 1827 |
1762 return currentAddon.GetGuildNames and currentAddon.GetGuildNames()[v]; | 1828 return currentAddon and currentAddon.GetGuildNames and currentAddon.GetGuildNames()[v]; |
1763 end, | 1829 end, |
1764 set = function(i, v, e) | 1830 set = function(i, v, e) |
1765 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); | 1831 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); |
1766 | 1832 |
1767 if e then | 1833 if e then |
1769 addon.db.profile.defaults.itemCountGuildsExcluded[v] = nil; | 1835 addon.db.profile.defaults.itemCountGuildsExcluded[v] = nil; |
1770 else | 1836 else |
1771 addon.db.profile.defaults.itemCountGuildsExcluded[v] = true; -- this is excluded, excluded is indicated by true | 1837 addon.db.profile.defaults.itemCountGuildsExcluded[v] = true; -- this is excluded, excluded is indicated by true |
1772 end | 1838 end |
1773 | 1839 |
1774 if currentAddon.SetGuildState then | 1840 if currentAddon and currentAddon.SetGuildState then |
1775 currentAddon.SetGuildState(v, e); | 1841 currentAddon.SetGuildState(v, e); |
1776 end | 1842 end |
1777 end, -- can't be nil or the defaults will be used | 1843 end, -- can't be nil or the defaults will be used |
1778 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | 1844 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. |
1779 }, | 1845 }, |
1813 name = "Skip the confirmation window for storage refilling", | 1879 name = "Skip the confirmation window for storage refilling", |
1814 desc = "Automatically start moving items from the storage (bank, guild bank or mailbox) without showing the confirmation window.", | 1880 desc = "Automatically start moving items from the storage (bank, guild bank or mailbox) without showing the confirmation window.", |
1815 get = function() return addon.db.profile.defaults.autoRefillSkipConfirm; end, | 1881 get = function() return addon.db.profile.defaults.autoRefillSkipConfirm; end, |
1816 set = function(i, v) addon.db.profile.defaults.autoRefillSkipConfirm = v; end, | 1882 set = function(i, v) addon.db.profile.defaults.autoRefillSkipConfirm = v; end, |
1817 }, | 1883 }, |
1884 stockAlertScanInterval = { | |
1885 order = 25, | |
1886 type = "select", | |
1887 width = "double", | |
1888 name = "Stock scan speed", | |
1889 desc = "Select the speed at which items should be scanned for stock alerts. Faster requires more resources and may drastically reduce your frame rate during a scan.", | |
1890 values = { | |
1891 ["0"] = "Instant", -- chains everything, no delay used | |
1892 ["0.01"] = "Very fast", -- < 100 fps: once every frame, >= 100 fps, 100 scans per second | |
1893 ["0.05"] = "Fast", | |
1894 ["0.1"] = "Default", | |
1895 ["0.2"] = "Medium", | |
1896 ["0.3"] = "Slow", | |
1897 ["0.5"] = "Very slow", | |
1898 }, | |
1899 get = function() return addon.db.profile.defaults.scanInterval; end, | |
1900 set = function(i, v) addon.db.profile.defaults.scanInterval = v; end, | |
1901 }, | |
1902 spacer = { | |
1903 order = 26, | |
1904 type = "description", | |
1905 name = "", | |
1906 width = "double", | |
1907 }, | |
1818 removeCharacter = { | 1908 removeCharacter = { |
1819 order = 30, | 1909 order = 30, |
1820 type = "select", | 1910 type = "select", |
1821 width = "double", | 1911 width = "double", |
1822 name = "Remove a character from Inventorium's memory", | 1912 name = "Remove a character from Inventorium's memory", |
1837 end, | 1927 end, |
1838 set = function(i, value) | 1928 set = function(i, value) |
1839 if value and value ~= "" then | 1929 if value and value ~= "" then |
1840 addon.db.factionrealm.characters[value] = nil; | 1930 addon.db.factionrealm.characters[value] = nil; |
1841 addon.db.profile.defaults.trackAtCharacters[value] = nil; | 1931 addon.db.profile.defaults.trackAtCharacters[value] = nil; |
1932 addon.db.profile.defaults.dontAlertAtCharacters[value] = nil; | |
1842 for name, values in pairs(addon.db.profile.groups) do | 1933 for name, values in pairs(addon.db.profile.groups) do |
1843 if values.trackAtCharacters then | 1934 if values.trackAtCharacters then |
1844 values.trackAtCharacters[name] = nil; | 1935 values.trackAtCharacters[name] = nil; |
1936 end | |
1937 | |
1938 if values.dontAlertAtCharacters then | |
1939 values.dontAlertAtCharacters[name] = nil; | |
1845 end | 1940 end |
1846 end | 1941 end |
1847 end | 1942 end |
1848 end, | 1943 end, |
1849 }, | 1944 }, |
2240 end | 2335 end |
2241 | 2336 |
2242 -- Ensure this data isn't received (this would be silly/buggy as exports from other accounts - with different characters - won't know what to do with this) | 2337 -- Ensure this data isn't received (this would be silly/buggy as exports from other accounts - with different characters - won't know what to do with this) |
2243 temp.trackAtCharacters = nil; | 2338 temp.trackAtCharacters = nil; |
2244 temp.overrideTrackAtCharacters = nil; | 2339 temp.overrideTrackAtCharacters = nil; |
2340 temp.dontAlertAtCharacters = nil; | |
2341 temp.overrideDontAlertAtCharacters = nil; | |
2245 | 2342 |
2246 addon.db.profile.groups[name] = temp; | 2343 addon.db.profile.groups[name] = temp; |
2247 end | 2344 end |
2248 end | 2345 end |
2249 end | 2346 end |