Quantcast

Make GUI options for filtering out the expansions and fix a bug where it was looking in the wrong place for the filter values.

ackis [05-13-09 - 19:14]
Make GUI options for filtering out the expansions and fix a bug where it was looking in the wrong place for the filter values.
Filename
ARLConfig.lua
ARLFrame.lua
Locals/testenUS.lua
diff --git a/ARLConfig.lua b/ARLConfig.lua
index b9a9973..03084ba 100644
--- a/ARLConfig.lua
+++ b/ARLConfig.lua
@@ -202,26 +202,26 @@ local function giveFilter()
 						originalwow = {
 							order	= 20,
 							type	= "toggle",
-							name	= L["Original WoW"],
+							name	= L["Old Word"],
 							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,
+							get		= function() return addon.db.profile.filters.general.originalwow end,
+							set		= function() addon.db.profile.filters.general.originalwow = not addon.db.profile.filters.general.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,
+							get		= function() return addon.db.profile.filters.general.bc end,
+							set		= function() addon.db.profile.filters.general.bc = not addon.db.profile.filters.general.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,
+							get		= function() return addon.db.profile.filters.general.wrath end,
+							set		= function() addon.db.profile.filters.general.wrath = not addon.db.profile.filters.general.wrath end,
 						},
 					},
 				},
diff --git a/ARLFrame.lua b/ARLFrame.lua
index 9df9e39..9b0b87d 100644
--- a/ARLFrame.lua
+++ b/ARLFrame.lua
@@ -1402,7 +1402,7 @@ function addon.numFilters()

 	-- IMPORTANT: If the number of filters we're maintaining changes, you'll need to change the FilterValueMap
 	-- at the end (of CreateFrame), as well as the following index value:
-	local MaxFilters = 88
+	local MaxFilters = 91

 	local total = 0
 	local active = 0
@@ -2573,6 +2573,9 @@ function addon.setFlyawayState()
 	ARL_FactionCB:SetChecked(filterdb.general.faction)
 	ARL_KnownCB:SetChecked(filterdb.general.known)
 	ARL_UnknownCB:SetChecked(filterdb.general.unknown)
+	ARL_OriginalWoWCB:SetChecked(filterdb.general.originalwow)
+	ARL_BCCB:SetChecked(filterdb.general.bc)
+	ARL_WrathCB:SetChecked(filterdb.general.wrath)
 	-- Classes
 	ARL_DeathKnightCB:SetChecked(filterdb.classes.deathknight)
 	ARL_DruidCB:SetChecked(filterdb.classes.druid)
@@ -3695,6 +3698,15 @@ function addon:CreateFrame(
 			local ARL_UnknownCB = CreateFrame("CheckButton", "ARL_UnknownCB", addon.Fly_General, "UICheckButtonTemplate")
 				addon:GenericMakeCB(ARL_UnknownCB, addon.Fly_General, L["UNKNOWN_DESC"], 6, 5, 1, 0)
 				ARL_UnknownCBText:SetText(L["Unknown"])
+			local ARL_OriginalWoWCB = CreateFrame("CheckButton", "ARL_OriginalWoWCB", addon.Fly_General, "UICheckButtonTemplate")
+				addon:GenericMakeCB(ARL_OriginalWoWCB, addon.Fly_General, L["ORIGINAL_WOW_DESC"], 89, 1, 2, 0)
+				ARL_OriginalWoWCB:SetText(L["Old World"])
+			local ARL_BCCB = CreateFrame("CheckButton", "ARL_BCCB", addon.Fly_General, "UICheckButtonTemplate")
+				addon:GenericMakeCB(ARL_BCCB, addon.Fly_General, L["BC_WOW_DESC"], 90, 2, 2, 0)
+				ARL_BCCB:SetText(L["Burning Crusade"])
+			local ARL_WrathCB = CreateFrame("CheckButton", "ARL_WrathCB", addon.Fly_General, "UICheckButtonTemplate")
+				addon:GenericMakeCB(ARL_WrathCB, addon.Fly_General, L["LK_WOW_DESC"], 91, 3, 2, 0)
+				ARL_WrathCB:SetText(L["Wrath of the Lich King"])
 			local ARL_ClassButton = addon:GenericCreateButton("ARL_ClassButton", addon.Fly_General,
 				20, 70, "TOPLEFT", ARL_UnknownCB, "BOTTOMLEFT", -4, 6, "GameFontHighlight",
 				"GameFontHighlightSmall", L["Classes"], "LEFT", L["CLASS_TEXT_DESC"], 0)
@@ -4449,6 +4461,9 @@ function addon:CreateFrame(
 			[4]  = { cb = ARL_FactionCB,				svroot = filterdb.general,		svval = "faction" },
 			[5]  = { cb = ARL_KnownCB,					svroot = filterdb.general,		svval = "known" },
 			[6]  = { cb = ARL_UnknownCB,				svroot = filterdb.general,		svval = "unknown" },
+			[89]  = { cb = ARL_OriginalWoWCB,			svroot = filterdb.general,		svval = "originalwow" },
+			[90]  = { cb = ARL_BCCB,					svroot = filterdb.general,		svval = "bc" },
+			[91]  = { cb = ARL_WrathCB,					svroot = filterdb.general,		svval = "wrath" },
 		-- Classes
 			[87] = { cb = ARL_DeathKnightCB,			svroot = filterdb.classes,		svval = "deathknight" },
 			[88] = { cb = ARL_DruidCB,					svroot = filterdb.classes,		svval = "druid" },
diff --git a/Locals/testenUS.lua b/Locals/testenUS.lua
index 1545853..de7ded7 100644
--- a/Locals/testenUS.lua
+++ b/Locals/testenUS.lua
@@ -1748,4 +1748,7 @@ L["Orland Schaeffer"] = true
 L["Imindril Spearsong"] = true
 L["First Aid Trainer"] = true
 L["Enchanting Trainer"] = true
-L["Alt-Tradeskills"] = true
\ No newline at end of file
+L["Alt-Tradeskills"] = true
+L["ORIGINAL_WOW_DESC"] = "Recipes availible with the original game."
+L["BC_WOW_DESC"] = "Recipes availible with the Burning Crusade."
+L["LK_WOW_DESC"] = "Recipes availible with the Wrath of the Lich King."