comparison Modules/Config.lua @ 106:d3fbb5676a5e

Added tooltips to the item refill window headers. Now color coding the availibility of items at the item refill window. Added a hide help text option (which is off by default). Renamed all premade groups to a new naming pattern; ?Profession - Category - Detail?, e.g. ?Inscription - Glyphs by class - Death Knight?. To continue getting notified about updates to a selected premade group, you must re-add them. Repositioned elements of the item refill frame to fit better. No longer using colorsargs to remember the index of a queued move, but instead providing a reference to the move itself in the new ?rowData? property of each row. Added tooltips to the headers of the sort table. Merged missing and available columns together (showing available / missing) and sorting on available now sorts on percentage of how many of the missing items are available. Moving and available columns are now aligned to the right. Added an ?extra? config group which contains the additional (but completely optional) settings. Moved color codes adjustments, forget character, auto refill skip confirm and hide help info options to this group.
author Zerotorescue
date Wed, 12 Jan 2011 19:58:39 +0100
parents 6ae44d372360
children a27948591159
comparison
equal deleted inserted replaced
105:4efbaf069ddb 106:d3fbb5676a5e
280 order = 0, 280 order = 0,
281 type = "description", 281 type = "description",
282 name = function(info) 282 name = function(info)
283 local groupName = groupIdToName[info[2]]; 283 local groupName = groupIdToName[info[2]];
284 284
285 local t = "Here you can set general settings for the currently selected group. If you do not wish to override a setting, the default setting specified in the general group will be used.\n\n"; 285 local t = "";
286 if not addon.db.profile.defaults.hideHelp then
287 t = "Here you can set general settings for the currently selected group. If you do not wish to override a setting, the default setting specified in the general group will be used.\n\n";
288 end
286 289
287 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); 290 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName);
288 local preferedAddon = addon:GetOptionByKey(groupName, "itemCountAddon"); 291 local preferedAddon = addon:GetOptionByKey(groupName, "itemCountAddon");
289 292
290 if currentAddon then 293 if currentAddon then
310 }, 313 },
311 header = { 314 header = {
312 order = 5, 315 order = 5,
313 type = "header", 316 type = "header",
314 name = "", 317 name = "",
318 hidden = function() return addon.db.profile.defaults.hideHelp; end,
315 }, 319 },
316 overrideAuctionPricingAddon = { 320 overrideAuctionPricingAddon = {
317 order = 9, 321 order = 9,
318 type = "toggle", 322 type = "toggle",
319 name = "Override pricing addon", 323 name = "Override pricing addon",
471 args = { 475 args = {
472 description = { 476 description = {
473 order = 0, 477 order = 0,
474 type = "description", 478 type = "description",
475 name = "Here you can specify the minimum amount of items you wish to keep in stock and related settings for the currently selected group. Please note the values entered here do not affect the queued quantities, you must set settings for that in the area below.", 479 name = "Here you can specify the minimum amount of items you wish to keep in stock and related settings for the currently selected group. Please note the values entered here do not affect the queued quantities, you must set settings for that in the area below.",
480 hidden = function() return addon.db.profile.defaults.hideHelp; end,
476 }, 481 },
477 header = { 482 header = {
478 order = 5, 483 order = 5,
479 type = "header", 484 type = "header",
480 name = "", 485 name = "",
486 hidden = function() return addon.db.profile.defaults.hideHelp; end,
481 }, 487 },
482 488
483 overrideMinLocalStock = { 489 overrideMinLocalStock = {
484 order = 10, 490 order = 10,
485 type = "toggle", 491 type = "toggle",
629 r = r .. "Queueing items worth |cfffed000" .. addon:ReadableMoney(addon:GetOptionByKey(groupName, "priceThreshold")) .. "|r or more."; 635 r = r .. "Queueing items worth |cfffed000" .. addon:ReadableMoney(addon:GetOptionByKey(groupName, "priceThreshold")) .. "|r or more.";
630 end 636 end
631 637
632 return r; 638 return r;
633 end, 639 end,
640 hidden = function() return addon.db.profile.defaults.hideHelp; end,
634 }, 641 },
635 header = { 642 header = {
636 order = 5, 643 order = 5,
637 type = "header", 644 type = "header",
638 name = "", 645 name = "",
646 hidden = function() return addon.db.profile.defaults.hideHelp; end,
639 }, 647 },
640 overrideRestockTarget = { 648 overrideRestockTarget = {
641 order = 9, 649 order = 9,
642 type = "toggle", 650 type = "toggle",
643 name = "Override restock target", 651 name = "Override restock target",
858 args = { 866 args = {
859 help = { 867 help = {
860 order = 10, 868 order = 10,
861 type = "description", 869 type = "description",
862 name = "You can add a single item to this group at a time by pasting the item-id or an item-link in the field to the left or you can also import multiple items at once by pasting exported item data in the field to the right. Scroll further down to add items based on your inventory contents.", 870 name = "You can add a single item to this group at a time by pasting the item-id or an item-link in the field to the left or you can also import multiple items at once by pasting exported item data in the field to the right. Scroll further down to add items based on your inventory contents.",
871 hidden = function() return addon.db.profile.defaults.hideHelp; end,
863 }, 872 },
864 itemLink = { 873 itemLink = {
865 order = 20, 874 order = 20,
866 type = "input", 875 type = "input",
867 name = "Single item add (item-link or item-id)", 876 name = "Single item add (item-link or item-id)",
941 get = false, 950 get = false,
942 }, 951 },
943 importPremadeData = { 952 importPremadeData = {
944 order = 40, 953 order = 40,
945 type = "select", 954 type = "select",
955 width = "double",
946 name = "Import premade data", 956 name = "Import premade data",
947 desc = "Import item data from a premade item-group. Any items already grouped will be skipped.", 957 desc = "Import item data from a premade item-group. Any items already grouped will be skipped.",
948 values = function() 958 values = function()
949 local temp = {}; 959 local temp = {};
950 for key, group in pairs(addon.defaultGroups) do 960 for key, group in pairs(addon.defaultGroups) do
998 args = { 1008 args = {
999 help = { 1009 help = {
1000 order = 10, 1010 order = 10,
1001 type = "description", 1011 type = "description",
1002 name = "Click the items you wish to add to this group or add multiple of these items at once by providing a name filter in the field below.", 1012 name = "Click the items you wish to add to this group or add multiple of these items at once by providing a name filter in the field below.",
1013 hidden = function() return addon.db.profile.defaults.hideHelp; end,
1003 }, 1014 },
1004 massAdd = { 1015 massAdd = {
1005 order = 20, 1016 order = 20,
1006 type = "input", 1017 type = "input",
1007 name = "Add all items matching...", 1018 name = "Add all items matching...",
1090 args = { 1101 args = {
1091 help = { 1102 help = {
1092 order = 10, 1103 order = 10,
1093 type = "group", 1104 type = "group",
1094 inline = true, 1105 inline = true,
1095 name = "Help", 1106 name = "Remove items",
1096 hidden = false, 1107 hidden = false,
1097 args = { 1108 args = {
1098 help = { 1109 help = {
1099 order = 10, 1110 order = 10,
1100 type = "description", 1111 type = "description",
1101 name = "Click the items you wish to remove from this group.", 1112 name = "Click the items you wish to remove from this group.",
1113 hidden = function() return addon.db.profile.defaults.hideHelp; end,
1102 }, 1114 },
1103 massRemove = { 1115 massRemove = {
1104 order = 20, 1116 order = 20,
1105 type = "input", 1117 type = "input",
1106 name = "Remove all items matching...", 1118 name = "Remove all items matching...",
1134 get = false, 1146 get = false,
1135 }, 1147 },
1136 premadeGroups = { 1148 premadeGroups = {
1137 order = 30, 1149 order = 30,
1138 type = "select", 1150 type = "select",
1151 width = "double",
1139 name = "Imported premade groups", 1152 name = "Imported premade groups",
1140 desc = "This is a list of all premade groups that were imported into this group. You will be notified when any of these premade groups have changed and you will be able to import these changes.\n\nSelect a group to stop reminding you of changes to the premade group (the item list will be unaffected). Doing so will require you to manually update this when new items are added to the game.", 1153 desc = "This is a list of all premade groups that were imported into this group. You will be notified when any of these premade groups have changed and you will be able to import these changes.\n\nSelect a group to stop reminding you of changes to the premade group (the item list will be unaffected). Doing so will require you to manually update this when new items are added to the game.",
1141 values = function(info) 1154 values = function(info)
1142 local groupName = groupIdToName[info[2]]; 1155 local groupName = groupIdToName[info[2]];
1143 1156
1304 1317
1305 -- Profile 1318 -- Profile
1306 options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(addon.db, true); 1319 options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(addon.db, true);
1307 options.args.profiles.order = 200; 1320 options.args.profiles.order = 200;
1308 1321
1322 -- Extra
1323 self:FillExtraOptions();
1324
1309 -- Groups 1325 -- Groups
1310 self:MakeGroupOptions(); 1326 self:MakeGroupOptions();
1311 1327
1312 -- Groups-contents 1328 -- Groups-contents
1313 self:FillGroupOptions(); 1329 self:FillGroupOptions();
1328 args = { 1344 args = {
1329 description = { 1345 description = {
1330 order = 0, 1346 order = 0,
1331 type = "description", 1347 type = "description",
1332 name = function() 1348 name = function()
1333 local t = "Here you can set general settings. The settings entered here will be used when you choose not to override the settings within an individual group.\n\n"; 1349 local t = "";
1350 if not addon.db.profile.defaults.hideHelp then
1351 t = "Here you can set general settings. The settings entered here will be used when you choose not to override the settings within an individual group.\n\n";
1352 end
1334 1353
1335 local currentAddon, selectedAddonName = addon:GetItemCountAddon(); 1354 local currentAddon, selectedAddonName = addon:GetItemCountAddon();
1336 local preferedAddon = addon.db.profile.defaults.itemCountAddon; 1355 local preferedAddon = addon.db.profile.defaults.itemCountAddon;
1337 1356
1338 if currentAddon then 1357 if currentAddon then
1450 args = { 1469 args = {
1451 description = { 1470 description = {
1452 order = 0, 1471 order = 0,
1453 type = "description", 1472 type = "description",
1454 name = "Here you can specify the default minimum amount of items you wish to keep in stock and related settings. The settings entered here will be used when you choose not to override the settings within an individual group.", 1473 name = "Here you can specify the default minimum amount of items you wish to keep in stock and related settings. The settings entered here will be used when you choose not to override the settings within an individual group.",
1474 hidden = function() return addon.db.profile.defaults.hideHelp; end,
1455 }, 1475 },
1456 header = { 1476 header = {
1457 order = 5, 1477 order = 5,
1458 type = "header", 1478 type = "header",
1459 name = "", 1479 name = "",
1480 hidden = function() return addon.db.profile.defaults.hideHelp; end,
1460 }, 1481 },
1461 minLocalStock = { 1482 minLocalStock = {
1462 order = 10, 1483 order = 10,
1463 type = "range", 1484 type = "range",
1464 min = 0, 1485 min = 0,
1483 type = "toggle", 1504 type = "toggle",
1484 name = "Auto refill from (guild) bank", 1505 name = "Auto refill from (guild) bank",
1485 desc = "Automatically refill items from the bank (unless this is included in the local count) or guild bank when below the minimum local stock.", 1506 desc = "Automatically refill items from the bank (unless this is included in the local count) or guild bank when below the minimum local stock.",
1486 get = function() return addon.db.profile.defaults.autoRefill; end, 1507 get = function() return addon.db.profile.defaults.autoRefill; end,
1487 set = function(i, v) addon.db.profile.defaults.autoRefill = v; end, 1508 set = function(i, v) addon.db.profile.defaults.autoRefill = v; end,
1488 },
1489 autoRefillSkipConfirm = {
1490 order = 13,
1491 type = "toggle",
1492 name = "Skip confirmation",
1493 desc = "Automatically start moving items from the (guild) bank without showing the confirmation window.\n\n|cfffed000This option can not be overridden.|r",
1494 get = function() return addon.db.profile.defaults.autoRefillSkipConfirm; end,
1495 set = function(i, v) addon.db.profile.defaults.autoRefillSkipConfirm = v; end,
1496 }, 1509 },
1497 minGlobalStock = { 1510 minGlobalStock = {
1498 order = 20, 1511 order = 20,
1499 type = "range", 1512 type = "range",
1500 min = 0, 1513 min = 0,
1564 1577
1565 r = r .. "When restocking the target amount is |cfffed000" .. addon.db.profile.defaults.restockTarget .. "|r of every item. Not queueing craftable items when only missing |cfffed000" .. floor( addon.db.profile.defaults.minCraftingQueue * addon.db.profile.defaults.restockTarget ) .. "|r (|cfffed000" .. ( addon.db.profile.defaults.minCraftingQueue * 100 ) .. "%|r) of the restock target."; 1578 r = r .. "When restocking the target amount is |cfffed000" .. addon.db.profile.defaults.restockTarget .. "|r of every item. Not queueing craftable items when only missing |cfffed000" .. floor( addon.db.profile.defaults.minCraftingQueue * addon.db.profile.defaults.restockTarget ) .. "|r (|cfffed000" .. ( addon.db.profile.defaults.minCraftingQueue * 100 ) .. "%|r) of the restock target.";
1566 1579
1567 return r; 1580 return r;
1568 end, 1581 end,
1582 hidden = function() return addon.db.profile.defaults.hideHelp; end,
1569 }, 1583 },
1570 header = { 1584 header = {
1571 order = 5, 1585 order = 5,
1572 type = "header", 1586 type = "header",
1573 name = "", 1587 name = "",
1588 hidden = function() return addon.db.profile.defaults.hideHelp; end,
1574 }, 1589 },
1575 restockTarget = { 1590 restockTarget = {
1576 order = 10, 1591 order = 10,
1577 type = "range", 1592 type = "range",
1578 min = 0, 1593 min = 0,
1630 type = "toggle", 1645 type = "toggle",
1631 name = "Always show auction value", 1646 name = "Always show auction value",
1632 desc = "Always cache and show the auction value of items, even if the price threshold is set to 0|cffeda55fc|r.", 1647 desc = "Always cache and show the auction value of items, even if the price threshold is set to 0|cffeda55fc|r.",
1633 get = function() return addon.db.profile.defaults.alwaysGetAuctionValue; end, 1648 get = function() return addon.db.profile.defaults.alwaysGetAuctionValue; end,
1634 set = function(i, v) addon.db.profile.defaults.alwaysGetAuctionValue = v; end, 1649 set = function(i, v) addon.db.profile.defaults.alwaysGetAuctionValue = v; end,
1650 },
1651 },
1652 },
1653 },
1654 };
1655 end
1656
1657 function mod:FillExtraOptions()
1658 options.args.extra = {
1659 order = 300,
1660 type = "group",
1661 name = "Extra",
1662 desc = "Change additional (but completely optional) settings.",
1663 args = {
1664 misc = {
1665 order = 10,
1666 type = "group",
1667 inline = true,
1668 name = "Miscellaneous",
1669 args = {
1670 hideHelp = {
1671 order = 10,
1672 type = "toggle",
1673 width = "full",
1674 name = "Hide any help tooltips, descriptions and the help config category",
1675 desc = "Hide any optional help tooltips, descriptions and the help config category.\n\nPlease note some tooltips may not disappear until next login.",
1676 get = function() return addon.db.profile.defaults.hideHelp; end,
1677 set = function(i, v) addon.db.profile.defaults.hideHelp = v; end,
1678 },
1679 autoRefillSkipConfirm = {
1680 order = 20,
1681 type = "toggle",
1682 width = "full",
1683 name = "Skip the confirmation window for (guild) bank refilling",
1684 desc = "Automatically start moving items from the (guild) bank without showing the confirmation window.",
1685 get = function() return addon.db.profile.defaults.autoRefillSkipConfirm; end,
1686 set = function(i, v) addon.db.profile.defaults.autoRefillSkipConfirm = v; end,
1687 },
1688 removeCharacter = {
1689 order = 30,
1690 type = "select",
1691 width = "double",
1692 name = "Remove a character from Inventorium's memory",
1693 desc = "Select a character to remove all traces of it from Inventorium's memory.\n\nYour current character can not be removed, you must login to a different character to do so.",
1694 values = function()
1695 local temp = {};
1696
1697 temp[""] = "";
1698
1699 local playerName = UnitName("player");
1700 for charName in pairs(addon.db.factionrealm.characters) do
1701 if playerName ~= charName then
1702 temp[charName] = charName;
1703 end
1704 end
1705
1706 return temp;
1707 end,
1708 set = function(i, value)
1709 if value and value ~= "" then
1710 addon.db.factionrealm.characters[value] = nil;
1711 addon.db.profile.defaults.trackAtCharacters[value] = nil;
1712 for name, values in pairs(addon.db.profile.groups) do
1713 if values.trackAtCharacters then
1714 values.trackAtCharacters[name] = nil;
1715 end
1716 end
1717 end
1718 end,
1635 }, 1719 },
1636 }, 1720 },
1637 }, 1721 },
1638 colorCodes = { 1722 colorCodes = {
1639 order = 30, 1723 order = 30,
1643 args = { 1727 args = {
1644 description = { 1728 description = {
1645 order = 0, 1729 order = 0,
1646 type = "description", 1730 type = "description",
1647 name = "Change the color code thresholds based on the current stock remaining of the required minimum stock.", 1731 name = "Change the color code thresholds based on the current stock remaining of the required minimum stock.",
1732 hidden = function() return addon.db.profile.defaults.hideHelp; end,
1648 }, 1733 },
1649 header = { 1734 header = {
1650 order = 5, 1735 order = 5,
1651 type = "header", 1736 type = "header",
1652 name = "", 1737 name = "",
1738 hidden = function() return addon.db.profile.defaults.hideHelp; end,
1653 }, 1739 },
1654 green = { 1740 green = {
1655 order = 10, 1741 order = 10,
1656 type = "range", 1742 type = "range",
1657 min = 0, 1743 min = 0,
1658 max = 1, 1744 max = 1,
1659 step = 0.01, 1745 step = 0.01,
1660 isPercent = true, 1746 isPercent = true,
1661 name = "|cff00ff00Green|r", 1747 name = "|cff00ff00Green|r",
1662 desc = "Show quantity in green when at least this much of the minimum stock is available.\n\n|cfffed000This option can not be overridden.|r", 1748 desc = "Show quantity in green when at least this much of the minimum stock is available.",
1663 get = function() return addon.db.profile.defaults.colors.green; end, 1749 get = function() return addon.db.profile.defaults.colors.green; end,
1664 set = function(i, v) addon.db.profile.defaults.colors.green = v; end, 1750 set = function(i, v) addon.db.profile.defaults.colors.green = v; end,
1665 }, 1751 },
1666 yellow = { 1752 yellow = {
1667 order = 20, 1753 order = 20,
1669 min = 0, 1755 min = 0,
1670 max = 1, 1756 max = 1,
1671 step = 0.01, 1757 step = 0.01,
1672 isPercent = true, 1758 isPercent = true,
1673 name = "|cffffff00Yellow|r", 1759 name = "|cffffff00Yellow|r",
1674 desc = "Show quantity in yellow when at least this much of the minimum stock is available.\n\n|cfffed000This option can not be overridden.|r", 1760 desc = "Show quantity in yellow when at least this much of the minimum stock is available.",
1675 get = function() return addon.db.profile.defaults.colors.yellow; end, 1761 get = function() return addon.db.profile.defaults.colors.yellow; end,
1676 set = function(i, v) addon.db.profile.defaults.colors.yellow = v; end, 1762 set = function(i, v) addon.db.profile.defaults.colors.yellow = v; end,
1677 }, 1763 },
1678 orange = { 1764 orange = {
1679 order = 30, 1765 order = 30,
1681 min = 0, 1767 min = 0,
1682 max = 1, 1768 max = 1,
1683 step = 0.01, 1769 step = 0.01,
1684 isPercent = true, 1770 isPercent = true,
1685 name = "|cffff9933Orange|r", 1771 name = "|cffff9933Orange|r",
1686 desc = "Show quantity in orange when at least this much of the minimum stock is available.\n\n|cfffed000This option can not be overridden.|r", 1772 desc = "Show quantity in orange when at least this much of the minimum stock is available.",
1687 get = function() return addon.db.profile.defaults.colors.orange; end, 1773 get = function() return addon.db.profile.defaults.colors.orange; end,
1688 set = function(i, v) addon.db.profile.defaults.colors.orange = v; end, 1774 set = function(i, v) addon.db.profile.defaults.colors.orange = v; end,
1689 }, 1775 },
1690 red = { 1776 red = {
1691 order = 40, 1777 order = 40,
1693 min = 0, 1779 min = 0,
1694 max = 1, 1780 max = 1,
1695 step = 0.01, 1781 step = 0.01,
1696 isPercent = true, 1782 isPercent = true,
1697 name = "|cffff0000Red|r", 1783 name = "|cffff0000Red|r",
1698 desc = "Show quantity in red when at least this much of the minimum stock is available.\n\n|cfffed000This option can not be overridden.|r", 1784 desc = "Show quantity in red when at least this much of the minimum stock is available.",
1699 get = function() return addon.db.profile.defaults.colors.red; end, 1785 get = function() return addon.db.profile.defaults.colors.red; end,
1700 set = function(i, v) addon.db.profile.defaults.colors.red = v; end, 1786 set = function(i, v) addon.db.profile.defaults.colors.red = v; end,
1701 },
1702 },
1703 },
1704 extra = {
1705 order = 40,
1706 type = "group",
1707 inline = true,
1708 name = "Extra",
1709 args = {
1710 description = {
1711 order = 0,
1712 type = "description",
1713 name = "Additional optional settings.",
1714 },
1715 header = {
1716 order = 5,
1717 type = "header",
1718 name = "",
1719 },
1720 removeCharacter = {
1721 order = 40,
1722 type = "select",
1723 name = "Forget character",
1724 desc = "Select a character to remove all traces of it from Inventorium's memory.\n\nYour current character can not be removed, you must login to a different character to do so.",
1725 values = function()
1726 local temp = {};
1727
1728 temp[""] = "";
1729
1730 local playerName = UnitName("player");
1731 for charName in pairs(addon.db.factionrealm.characters) do
1732 if playerName ~= charName then
1733 temp[charName] = charName;
1734 end
1735 end
1736
1737 return temp;
1738 end,
1739 set = function(i, value)
1740 if value and value ~= "" then
1741 addon.db.factionrealm.characters[value] = nil;
1742 addon.db.profile.defaults.trackAtCharacters[value] = nil;
1743 for name, values in pairs(addon.db.profile.groups) do
1744 if values.trackAtCharacters then
1745 values.trackAtCharacters[name] = nil;
1746 end
1747 end
1748 end
1749 end,
1750 }, 1787 },
1751 }, 1788 },
1752 }, 1789 },
1753 }, 1790 },
1754 }; 1791 };
1756 1793
1757 function mod:FillHelpOptions() 1794 function mod:FillHelpOptions()
1758 options.args.help = { 1795 options.args.help = {
1759 order = 150, 1796 order = 150,
1760 type = "group", 1797 type = "group",
1798 hidden = function() return addon.db.profile.defaults.hideHelp; end,
1761 childGroups = "tab", 1799 childGroups = "tab",
1762 name = "Help", 1800 name = "Help",
1763 desc = "Useful information for if you're unfamiliar with a part of the addon.", 1801 desc = "Useful information for if you're unfamiliar with a part of the addon.",
1764 args = { 1802 args = {
1765 general = { 1803 general = {