Quantcast

Add functionality so that you can filter out based on expansion.

ackis [05-13-09 - 18:18]
Add functionality so that you can filter out based on expansion.
Filename
ARLConfig.lua
AckisRecipeList.lua
diff --git a/ARLConfig.lua b/ARLConfig.lua
index 493d0eb..b9a9973 100644
--- a/ARLConfig.lua
+++ b/ARLConfig.lua
@@ -199,6 +199,30 @@ local function giveFilter()
 							get		= function() return addon.db.profile.filters.classes.warrior end,
 							set		= function() addon.db.profile.filters.classes.warrior = not addon.db.profile.filters.classes.warrior end,
 						},
+						originalwow = {
+							order	= 20,
+							type	= "toggle",
+							name	= L["Original WoW"],
+							desc	= L["ORIGINAL_WOW_DESC"],
+							get		= function() return addon.db.profile.filters.obtain.originalwow end,
+							set		= function() addon.db.profile.filters.obtain.originalwow = not addon.db.profile.filters.obtain.originalwow end,
+						},
+						bc = {
+							order	= 21,
+							type	= "toggle",
+							name	= L["Burning Crusade"],
+							desc	= L["BC_WOW_DESC"],
+							get		= function() return addon.db.profile.filters.obtain.bc end,
+							set		= function() addon.db.profile.filters.obtain.bc = not addon.db.profile.filters.obtain.bc end,
+						},
+						wrath = {
+							order	= 22,
+							type	= "toggle",
+							name	= L["Wrath of the Lich King"],
+							desc	= L["LK_WOW_DESC"],
+							get		= function() return addon.db.profile.filters.obtain.wrath end,
+							set		= function() addon.db.profile.filters.obtain.wrath = not addon.db.profile.filters.obtain.wrath end,
+						},
 					},
 				},
 				obtain = {
diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua
index fdd25c2..fec63db 100644
--- a/AckisRecipeList.lua
+++ b/AckisRecipeList.lua
@@ -179,6 +179,9 @@ function addon:OnInitialize()
 					skill = true,
 					known = false,
 					unknown = true,
+					originalwow = true,
+					bc = true,
+					wrath = true,
 				},
 				-- Obtain Options
 				obtain = {
@@ -1030,6 +1033,18 @@ do
 			end
 		end

+		-- Filter out "era" recipes
+
+		if ((generaldb.originalwow == false) and (Recipe["Game"] == 0)) then
+			return false
+		end
+		if ((generaldb.bc == false) and (Recipe["Game"] == 1)) then
+			return false
+		end
+		if ((generaldb.wrath == false) and (Recipe["Game"] == 2)) then
+			return false
+		end
+
 		local bindingdb = filterdb.binding

 		-- Include BoE Items in the scan? (if I want to see BoE items, only filter those that are not BoE)