From 3b490ac91ab2e7fb53d25c723831ef40f840fc4b Mon Sep 17 00:00:00 2001 From: Ackis Date: Thu, 20 Nov 2008 20:11:06 +0000 Subject: [PATCH] Fix filter state being remembered. --- ARLDataminer.rb | 2 +- ARLFrame.lua | 37 ++++++++++++++----------------------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/ARLDataminer.rb b/ARLDataminer.rb index 43e5b1c..5c710ab 100644 --- a/ARLDataminer.rb +++ b/ARLDataminer.rb @@ -1818,7 +1818,7 @@ $bosslist = [ ] $bosszonemap = { - #"40 Tickets - Schematic: Steam Tonk Controller" => "", + "40 Tickets - Schematic: Steam Tonk Controller" => "Darkmoon Faire", "Master Craftsman Omarion" => "Naxxaramas", "Azure Ley-Whelp" => "The Oculus", "Bloodaxe Raider" => "Blackrock Spire", diff --git a/ARLFrame.lua b/ARLFrame.lua index a1b6193..b4d547c 100644 --- a/ARLFrame.lua +++ b/ARLFrame.lua @@ -716,40 +716,31 @@ function addon.filterSwitch(val) end - local found = false + -- We have this toggled one way + if (ApplyFilterState[val]) then - for i,j in pairs(ApplyFilterState) do - - -- We have this value in our filter state, so we're toggling it off again - if (j == val) then + ApplyFilterState[val] = not ApplyFilterState[val] - tremove(ApplyFilterState, j) - found = true - break + -- Hasn't been toggled + else - end + ApplyFilterState[val] = true end - -- New filter we haven't played with before - if (not found) then - - tinsert(ApplyFilterState, val) - - end + ARL_ApplyButton:SetNormalFontObject("GameFontDisableSmall") + ARL_ApplyButton:Disable() - -- Make sure our apply button gets enabled if we have a different state than the original + for i,j in pairs(ApplyFilterState) do - if (#ApplyFilterState ~= 0) then + if (j == true) then - ARL_ApplyButton:SetNormalFontObject("GameFontNormalSmall") - ARL_ApplyButton:Enable() + ARL_ApplyButton:SetNormalFontObject("GameFontNormalSmall") + ARL_ApplyButton:Enable() + break - else + end - ARL_ApplyButton:SetNormalFontObject("GameFontDisableSmall") - ARL_ApplyButton:Disable() - end end -- 1.7.9.5