Quantcast

Add button fixed. Statistics frame added. Lists ordered. Too many entries in tooltip fixed.

ckaotik [03-01-10 - 20:09]
Add button fixed. Statistics frame added. Lists ordered. Too many entries in tooltip fixed.
Filename
core.lua
options.lua
diff --git a/core.lua b/core.lua
index dc263a9..ff4266c 100644
--- a/core.lua
+++ b/core.lua
@@ -330,19 +330,6 @@ function BrokerGarbage:JoinTables(...)
 	return result
 end

-function BrokerGarbage:SortIcons(a,b)
-	if type(a) == type(b) then
-		return a<b
-	else
-		-- sort: string first
-		return type(a) == "string"
-	end
-end
-
-local function SortByValue(a, b)
-	return a.value < b.value
-end
-
 function BrokerGarbage:Count(table)
   local i = 0
   for _, _ in pairs(table) do i = i + 1 end
@@ -807,7 +794,9 @@ function BrokerGarbage:GetCheapest(number)
 			count = count + 1
 		end
 	end
-	table.sort(cheapestItems, SortByValue)
+	table.sort(cheapestItems, function(a, b)
+		return a.value < b.value
+	end)

 	-- fill with non-forced
 	if #cheapestItems < number then
diff --git a/options.lua b/options.lua
index 5328c0b..cc57cfc 100644
--- a/options.lua
+++ b/options.lua
@@ -828,15 +828,12 @@ local function ShowListOptions(frame)
 			table.insert(data, key)
 		end

-		table.sort(data, function(a,b)
-			--if type(a) == type(b) then
-				--return a<b
+		table.sort(data, function(a,b)
 			if type(a) == "string" and type(b) == "string" then
 				return a<b
 			elseif type(a) == "number" and type(b) == "number" then
 				return (GetItemInfo(a) or "z") < (GetItemInfo(b) or "z")
 			else
-				-- sort: string first
 				return type(a) == "string"
 			end
 		end)