Quantcast

added a hidden option to have included items work totally agains Broker_Garbage's principles. And yes, I AM looking at you, sarah_a180@Curse.

ckaotik [09-29-10 - 18:17]
added a hidden option to have included items work totally agains Broker_Garbage's principles. And yes, I AM looking at you, sarah_a180@Curse.
 /run BG_GlobalDB.useRealValues = true
will now enable you to have items on your include list ignore your drop treshold (caution!) and have their proper price considered. To disable it, simply run
 /run BG_GlobalDB.useRealValues = false
Filename
constants.lua
core.lua
diff --git a/constants.lua b/constants.lua
index 43963e3..2e30c45 100644
--- a/constants.lua
+++ b/constants.lua
@@ -12,10 +12,12 @@ BrokerGarbage.defaultGlobalSettings = {
 	autoSellToVendor = true,
 	autoRepairAtVendor = true,
 	disableKey = "SHIFT",
-	hideZeroValue = true,		-- TODO: provide interface options. disable this to have zero value items (quest items, event items etc.) show up in BG tooltip, enable it to hide them
 	sellNotWearable = false,
 	sellNWQualityTreshold = 4,
 	autoSellIncludeItems = false,
+	-- hidden options
+	hideZeroValue = true,		-- false: have zero value items (quest items, event items etc.) show up in BG tooltip, true: hide them [DEFAULT]
+	useRealValues = false,		-- false: use zero value for included items (junk list items) [DEFAULT], true: use the item's actual value

 	-- default values
 	tooltipMaxHeight = 220,
diff --git a/core.lua b/core.lua
index d3414f7..6568d9b 100644
--- a/core.lua
+++ b/core.lua
@@ -660,7 +660,7 @@ end
 -- ---------------------------------------------------------
 local function TableSort(a, b)
     -- put included items even prior to forced vendor price items
-    if (a.source == b.source) or (a.source ~= BrokerGarbage.INCLUDE and b.source ~= BrokerGarbage.INCLUDE) then
+    if (a.source == b.source) or (a.source ~= BrokerGarbage.INCLUDE and b.source ~= BrokerGarbage.INCLUDE) or BG_GlobalDB.useRealValues then
         if a.value == b.value then
             if a.itemID == b.itemID then
                 return a.count < b.count
@@ -675,7 +675,7 @@ local function TableSort(a, b)
     end
 end

--- returns the n cheapest items in your bags  in a table
+-- returns the n cheapest items in your bags in a table
 function BrokerGarbage:GetCheapest(number)
     if not number then number = BG_GlobalDB.tooltipNumItems end
     local cheapestItems = {}
@@ -737,7 +737,7 @@ function BrokerGarbage:GetCheapest(number)
                         end
                         if insert then
                             -- treat like a regular include item
-                            value = 0
+                            value = BG_GlobalDB.useRealValues and value or 0
                         end

                     elseif item.classification == BrokerGarbage.DISENCHANT or item.classification == BrokerGarbage.AUCTION then
@@ -754,7 +754,7 @@ function BrokerGarbage:GetCheapest(number)
                         end

                     elseif item.classification == BrokerGarbage.INCLUDE then
-                        value = 0
+                        value = BG_GlobalDB.useRealValues and value or 0

                     elseif item.classification == BrokerGarbage.VENDORLIST or item.classification == BrokerGarbage.VENDOR then
                         value = vendorValue