comparison Core.lua @ 57:03c0610e9c1e

Added a minimum local stock option. I reckon people will want to keep maybe a stack in their bags/AH and another stack in their bank. Added a seperate alert option for the local stock option. When your selected item count addon isn?t enabled the options help text will now display the reason for this. No more debugging of something that ain?t broken. The minimum stock will now be displayed next to the current stock values rather than as a seperate column.
author Zerotorescue
date Tue, 21 Dec 2010 14:24:15 +0100
parents 9607b3251655
children d903b0a151d3
comparison
equal deleted inserted replaced
56:b33248fb89dd 57:03c0610e9c1e
25 }, 25 },
26 defaults = { 26 defaults = {
27 auctionPricingAddon = "Auctioneer", 27 auctionPricingAddon = "Auctioneer",
28 itemCountAddon = "Altoholic", 28 itemCountAddon = "Altoholic",
29 craftingAddon = "AdvancedTradeSkillWindow", 29 craftingAddon = "AdvancedTradeSkillWindow",
30 minimumStock = 60, 30 minimumLocalStock = 20,
31 alertBelowMinimum = true, 31 alertBelowLocalMinimum = true,
32 minimumStock = 60, -- global stock
33 alertBelowMinimum = true, -- global stock
32 summaryThresholdShow = 10, 34 summaryThresholdShow = 10,
33 restockTarget = 60, 35 restockTarget = 60,
34 minCraftingQueue = 0.05, 36 minCraftingQueue = 0.05,
35 bonusQueue = 0.1, 37 bonusQueue = 0.1,
36 priceThreshold = 0, 38 priceThreshold = 0,
588 type = "description", 590 type = "description",
589 name = function() 591 name = function()
590 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"; 592 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";
591 593
592 local currentAddon, selectedAddonName = addon:GetItemCountAddon(); 594 local currentAddon, selectedAddonName = addon:GetItemCountAddon();
595 local preferedAddon = self.db.global.defaults.itemCountAddon;
593 596
594 if currentAddon then 597 if currentAddon then
595 --GetCharacterCount 598 --GetCharacterCount
596 --self.supportedAddons.itemCount[selectedExternalAddon] 599 --self.supportedAddons.itemCount[selectedExternalAddon]
597 t = t .. "Currently using |cfffed000" .. selectedAddonName .. "|r as your item count addon. This addon is " .. ((currentAddon.IsEnabled() and "|cff00ff00enabled|r") or "|cffff0000disabled|r") .. "."; 600 t = t .. "Currently using |cfffed000" .. selectedAddonName .. "|r as your item count addon. This addon is " .. ((currentAddon.IsEnabled() and "|cff00ff00enabled|r") or "|cffff0000disabled|r") .. ".";
600 t = t .. " This addon supports |cfffed000both total as local|r item counts."; 603 t = t .. " This addon supports |cfffed000both total as local|r item counts.";
601 elseif currentAddon.GetTotalCount then 604 elseif currentAddon.GetTotalCount then
602 t = t .. " This addon supports |cfffed000only total|r item counts."; 605 t = t .. " This addon supports |cfffed000only total|r item counts.";
603 elseif currentAddon.GetCharacterCount then 606 elseif currentAddon.GetCharacterCount then
604 t = t .. " This addon supports |cfffed000only local|r item counts."; 607 t = t .. " This addon supports |cfffed000only local|r item counts.";
608 end
609
610 if preferedAddon ~= selectedAddonName then
611 t = t .. "\n\n|cffff0000You have selected |cfffed000" .. preferedAddon .. "|r|cffff0000 as your item count addon, but this appears to be disabled and thus a random alternative was selected.|r";
605 end 612 end
606 end 613 end
607 614
608 return t; 615 return t;
609 end, 616 end,
710 header = { 717 header = {
711 order = 5, 718 order = 5,
712 type = "header", 719 type = "header",
713 name = "", 720 name = "",
714 }, 721 },
715 minimumStock = { 722 minLocalStock = {
716 order = 10, 723 order = 10,
717 type = "range", 724 type = "range",
718 min = 0, 725 min = 0,
719 max = 100000, 726 max = 100000,
720 softMax = 100, 727 softMax = 100,
721 step = 1, 728 step = 1,
722 name = "Minimum stock", 729 name = "Minimum local stock",
730 desc = "You can manually enter a value between 100 and 100.000 in the text box below if the provided range is insufficient.",
731 get = function() return self.db.global.defaults.minimumLocalStock; end,
732 set = function(i, v) self.db.global.defaults.minimumLocalStock = v; end,
733 },
734 alertBelowLocalMinimum = {
735 order = 11,
736 type = "toggle",
737 name = "Alert when below local minimum (NYI)",
738 desc = "Show an alert when this item gets below this threshold.",
739 get = function() return self.db.global.defaults.alertBelowLocalMinimum; end,
740 set = function(i, v) self.db.global.defaults.alertBelowLocalMinimum = v; end,
741 },
742 minGlobalStock = {
743 order = 20,
744 type = "range",
745 min = 0,
746 max = 100000,
747 softMax = 100,
748 step = 1,
749 name = "Minimum global stock",
723 desc = "You can manually enter a value between 100 and 100.000 in the text box below if the provided range is insufficient.", 750 desc = "You can manually enter a value between 100 and 100.000 in the text box below if the provided range is insufficient.",
724 get = function() return self.db.global.defaults.minimumStock; end, 751 get = function() return self.db.global.defaults.minimumStock; end,
725 set = function(i, v) self.db.global.defaults.minimumStock = v; end, 752 set = function(i, v) self.db.global.defaults.minimumStock = v; end,
726 }, 753 },
754 alertBelowGlobalMinimum = {
755 order = 21,
756 type = "toggle",
757 name = "Alert when below global minimum (NYI)",
758 desc = "Show an alert when this item gets below this threshold.",
759 get = function() return self.db.global.defaults.alertBelowMinimum; end,
760 set = function(i, v) self.db.global.defaults.alertBelowMinimum = v; end,
761 },
727 summaryThresholdShow = { 762 summaryThresholdShow = {
728 order = 20, 763 order = 30,
729 type = "range", 764 type = "range",
730 min = 0, 765 min = 0,
731 max = 10, 766 max = 10,
732 softMax = 100, 767 softMax = 100,
733 step = 0.05, 768 step = 0.05,
734 isPercent = true, 769 isPercent = true,
735 name = "Show in summary when below", 770 name = "Show in summary when below",
736 desc = "Show items in the summary when below this percentage of the minimum stock.\n\nYou can manually enter a value between 1.000% and 10.000% in the edit box if the provided range is insufficient.", 771 desc = "Show items in the summary when below this percentage of the minimum stock. This can be either below the minimum or the global stock.\n\nYou can manually enter a value between 1.000% and 10.000% in the edit box if the provided range is insufficient.",
737 get = function() return self.db.global.defaults.summaryThresholdShow; end, 772 get = function() return self.db.global.defaults.summaryThresholdShow; end,
738 set = function(i, v) self.db.global.defaults.summaryThresholdShow = v; end, 773 set = function(i, v) self.db.global.defaults.summaryThresholdShow = v; end,
739 },
740 alertBelowMinimum = {
741 order = 30,
742 type = "toggle",
743 name = "NYI | Alert when below minimum",
744 desc = "Show an alert when this item gets below this threshold.",
745 get = function() return self.db.global.defaults.alertBelowMinimum; end,
746 set = function(i, v) self.db.global.defaults.alertBelowMinimum = v; end,
747 }, 774 },
748 trackAtCharacters = { 775 trackAtCharacters = {
749 order = 40, 776 order = 40,
750 type = "multiselect", 777 type = "multiselect",
751 name = "Track at", 778 name = "Track at",
1215 local groupName = groupIdToName[info[2]]; 1242 local groupName = groupIdToName[info[2]];
1216 1243
1217 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"; 1244 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";
1218 1245
1219 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); 1246 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName);
1247 local preferedAddon = addon:GetOptionByKey(groupName, "itemCountAddon");
1220 1248
1221 if currentAddon then 1249 if currentAddon then
1222 --GetCharacterCount 1250 --GetCharacterCount
1223 --self.supportedAddons.itemCount[selectedExternalAddon] 1251 --self.supportedAddons.itemCount[selectedExternalAddon]
1224 t = t .. "Currently using |cfffed000" .. selectedAddonName .. "|r as your item count addon. This addon is " .. ((currentAddon.IsEnabled() and "|cff00ff00enabled|r") or "|cffff0000disabled|r") .. "."; 1252 t = t .. "Currently using |cfffed000" .. selectedAddonName .. "|r as your item count addon. This addon is " .. ((currentAddon.IsEnabled() and "|cff00ff00enabled|r") or "|cffff0000disabled|r") .. ".";
1227 t = t .. " This addon supports |cfffed000both total as local|r item counts."; 1255 t = t .. " This addon supports |cfffed000both total as local|r item counts.";
1228 elseif currentAddon.GetTotalCount then 1256 elseif currentAddon.GetTotalCount then
1229 t = t .. " This addon supports |cfffed000only total|r item counts."; 1257 t = t .. " This addon supports |cfffed000only total|r item counts.";
1230 elseif currentAddon.GetCharacterCount then 1258 elseif currentAddon.GetCharacterCount then
1231 t = t .. " This addon supports |cfffed000only local|r item counts."; 1259 t = t .. " This addon supports |cfffed000only local|r item counts.";
1260 end
1261
1262 if preferedAddon ~= selectedAddonName then
1263 t = t .. "\n\n|cffff0000You have selected |cfffed000" .. preferedAddon .. "|r|cffff0000 as your item count addon, but this appears to be disabled and thus a random alternative was selected.|r";
1232 end 1264 end
1233 end 1265 end
1234 1266
1235 return t; 1267 return t;
1236 end, 1268 end,
1404 header = { 1436 header = {
1405 order = 5, 1437 order = 5,
1406 type = "header", 1438 type = "header",
1407 name = "", 1439 name = "",
1408 }, 1440 },
1409 overrideMinimumStock = { 1441
1410 order = 9, 1442 overrideMinLocalStock = {
1443 order = 10,
1411 type = "toggle", 1444 type = "toggle",
1412 name = "Override min stock", 1445 name = "Override min local stock",
1413 desc = "Allows you to override the minimum stock setting for this group.", 1446 desc = "Allows you to override the minimum local stock setting for this group.",
1414 arg = "minimumStock", 1447 arg = "minLocalStock",
1415 }, 1448 },
1416 minimumStock = { 1449 minLocalStock = {
1417 order = 10, 1450 order = 11,
1418 type = "range", 1451 type = "range",
1419 min = 0, 1452 min = 0,
1420 max = 100000, 1453 max = 100000,
1421 softMax = 100, 1454 softMax = 100,
1422 step = 1, 1455 step = 1,
1423 name = "Minimum stock", 1456 name = "Minimum local stock",
1424 desc = "You can manually enter a value between 100 and 100.000 in the text box below if the provided range is insufficient.", 1457 desc = "You can manually enter a value between 100 and 100.000 in the text box below if the provided range is insufficient.",
1425 arg = "overrideMinimumStock", 1458 arg = "overrideMinLocalStock",
1426 }, 1459 },
1460 overrideAlertBelowLocalMinimum = {
1461 order = 15,
1462 type = "toggle",
1463 name = "Override local minimum alert",
1464 desc = "Allows you to override wether an alert should be shown when an item in this group gets below the local minimum stock threshold.",
1465 arg = "alertBelowLocalMinimum",
1466 },
1467 alertBelowLocalMinimum = {
1468 order = 16,
1469 type = "toggle",
1470 name = "Alert when below local minimum (NYI)",
1471 desc = "Show an alert when an item in this group gets below the local minimum stock threshold.",
1472 arg = "overrideAlertBelowLocalMinimum",
1473 },
1474
1475 overrideMinGlobalStock = {
1476 order = 20,
1477 type = "toggle",
1478 name = "Override min global stock",
1479 desc = "Allows you to override the minimum global stock setting for this group.",
1480 arg = "minGlobalStock",
1481 },
1482 minGlobalStock = {
1483 order = 21,
1484 type = "range",
1485 min = 0,
1486 max = 100000,
1487 softMax = 100,
1488 step = 1,
1489 name = "Minimum global stock",
1490 desc = "You can manually enter a value between 100 and 100.000 in the text box below if the provided range is insufficient.",
1491 arg = "overrideMinGlobalStock",
1492 },
1493 overrideAlertBelowGlobalMinimum = {
1494 order = 25,
1495 type = "toggle",
1496 name = "Override global minimum alert",
1497 desc = "Allows you to override wether an alert should be shown when an item in this group gets below the global minimum stock threshold.",
1498 arg = "alertBelowGlobalMinimum",
1499 },
1500 alertBelowGlobalMinimum = {
1501 order = 26,
1502 type = "toggle",
1503 name = "Alert when below global minimum (NYI)",
1504 desc = "Show an alert when an item in this group gets below the global minimum stock threshold.",
1505 arg = "overrideAlertBelowGlobalMinimum",
1506 },
1507
1427 overrideSummaryThresholdShow = { 1508 overrideSummaryThresholdShow = {
1428 order = 19, 1509 order = 34,
1429 type = "toggle", 1510 type = "toggle",
1430 name = "Override summary showing", 1511 name = "Override summary showing",
1431 desc = "Allows you to override when this group should appear in the summary.", 1512 desc = "Allows you to override when this group should appear in the summary.",
1432 arg = "summaryThresholdShow", 1513 arg = "summaryThresholdShow",
1433 }, 1514 },
1434 summaryThresholdShow = { 1515 summaryThresholdShow = {
1435 order = 20, 1516 order = 35,
1436 type = "range", 1517 type = "range",
1437 min = 0, 1518 min = 0,
1438 max = 10, 1519 max = 10,
1439 softMax = 100, 1520 softMax = 100,
1440 step = 0.05, 1521 step = 0.05,
1441 isPercent = true, 1522 isPercent = true,
1442 name = "Show in summary when below", 1523 name = "Show in summary when below",
1443 desc = "Show items in the summary when below the specified percentage of the minimum stock.\n\nYou can manually enter a value between 1.000% and 10.000% in the edit box if the provided range is insufficient.", 1524 desc = "Show items in the summary when below the specified percentage of the minimum stock.\n\nYou can manually enter a value between 1.000% and 10.000% in the edit box if the provided range is insufficient.",
1444 arg = "overrideSummaryThresholdShow", 1525 arg = "overrideSummaryThresholdShow",
1445 },
1446 overrideAlertBelowMinimum = {
1447 order = 29,
1448 type = "toggle",
1449 name = "Override minimum alert",
1450 desc = "Allows you to override wether an alert should be shown when an item in this group gets below the minimum stock threshold.",
1451 arg = "alertBelowMinimum",
1452 },
1453 alertBelowMinimum = {
1454 order = 30,
1455 type = "toggle",
1456 name = "NYI | Alert when below minimum",
1457 desc = "Show an alert when an item in this group gets below the minimum stock threshold.",
1458 arg = "overrideAlertBelowMinimum",
1459 }, 1526 },
1460 overrideTrackAtCharacters = { 1527 overrideTrackAtCharacters = {
1461 order = 39, 1528 order = 39,
1462 type = "toggle", 1529 type = "toggle",
1463 name = "Override track at", 1530 name = "Override track at",