Quantcast

Added some table searching functions

Darthpred [10-01-13 - 07:14]
Added some table searching functions
Filename
ElvUI_SLE/ElvUI_SLE.lua
diff --git a/ElvUI_SLE/ElvUI_SLE.lua b/ElvUI_SLE/ElvUI_SLE.lua
index 0f7f088..abffb7f 100755
--- a/ElvUI_SLE/ElvUI_SLE.lua
+++ b/ElvUI_SLE/ElvUI_SLE.lua
@@ -54,8 +54,6 @@ function SLE:ChatPos()
 	end
 end

-
-
 E.UpdateAllSLE = E.UpdateAll
 function E:UpdateAll()
     E.UpdateAllSLE(self)
@@ -135,6 +133,22 @@ function SLE:BagSearch(itemId)
 	end
 end

+function SLE:ValueTable(table, item)
+	for i, _ in pairs(table) do
+		if i == item then return true end
+	end
+	return false
+end
+
+function SLE:SimpleTable(table, item)
+	for i = 1, #table do
+		if table[i] == item then
+			return true
+		end
+	end
+	return false
+end
+
 function SLE:Print(msg)
 	print(E["media"].hexvaluecolor..'S&L:|r', msg)
 end