Quantcast

5.4.172

Steven Jackson [01-11-15 - 04:44]
5.4.172
Filename
Interface/AddOns/SVUI_ConfigOMatic/components/filters/buffwatch.lua
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/filters/buffwatch.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/buffwatch.lua
index 24cb339..ecd8440 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/components/filters/buffwatch.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/buffwatch.lua
@@ -83,14 +83,15 @@ local function CacheWatchedBuffs(data)
 	end
 end

-local function SetWatchedBuff(id, data, enable, point, color, anyUnit)
+local function SetWatchedBuff(stringID, id, data, enable, point, color, anyUnit)
 	if(not data[id]) then
-		data[id] = {["enable"] = enable, ["point"] = point, ["color"] = color, ["anyUnit"] = anyUnit}
+		data[stringID] = {["enable"] = enable, ["id"] = id, ["point"] = point, ["color"] = color, ["anyUnit"] = anyUnit}
 	else
-		data[id]["enable"] = enable;
-		data[id]["point"] = point;
-		data[id]["color"] = color;
-		data[id]["anyUnit"] = anyUnit;
+		data[stringID]["id"] = id;
+		data[stringID]["enable"] = enable;
+		data[stringID]["point"] = point;
+		data[stringID]["color"] = color;
+		data[stringID]["anyUnit"] = anyUnit;
 	end
 end

@@ -131,7 +132,7 @@ ns.FilterOptionGroups['BuffWatch'] = function(selectedSpell)
 					else
 						SetWatchedBuff(value, spellID, FILTER, true, "TOPRIGHT", DEFAULT_COLOR, false)
 						UpdateBuffWatch()
-						ns:SetFilterOptions('BuffWatch')
+						ns:SetFilterOptions('BuffWatch', spellID)
 					end
 				end
 			},
@@ -152,17 +153,13 @@ ns.FilterOptionGroups['BuffWatch'] = function(selectedSpell)
 						for id, data in pairs(FILTER) do
 							if(tonumber(id) == spellID) then
 								temp = data;
-								if FILTER[id] then
-									FILTER[id].enable = false;
-								else
-									FILTER[id] = nil
-								end
+								FILTER[id] = nil
 							end
 						end
 						if temp == nil then
 							SV:AddonMessage(L["Spell not found in list."])
 						else
-							ns:SetFilterOptions()
+							ns:SetFilterOptions('BuffWatch')
 						end
 					end
 					UpdateBuffWatch("raid")
@@ -335,7 +332,7 @@ ns.FilterOptionGroups['PetBuffWatch'] = function(selectedSpell)
 					else
 						SetWatchedBuff(value, spellID, FILTER, true, "TOPRIGHT", DEFAULT_COLOR, true)
 						UpdatePetBuffWatch()
-						ns:SetFilterOptions('PetBuffWatch', selectedSpell)
+						ns:SetFilterOptions('PetBuffWatch', spellID)
 					end
 				end
 			},
@@ -366,7 +363,7 @@ ns.FilterOptionGroups['PetBuffWatch'] = function(selectedSpell)
 						end
 					end
 					UpdatePetBuffWatch()
-					ns:SetFilterOptions('PetBuffWatch', selectedSpell)
+					ns:SetFilterOptions('PetBuffWatch', value)
 				end
 			},
 			selectSpell = {
@@ -386,7 +383,7 @@ ns.FilterOptionGroups['PetBuffWatch'] = function(selectedSpell)
 					return tempFilterTable
 				end,
 				get = function(key) return selectedSpell end,
-				set = function(key, value) ns:SetFilterOptions('PetBuffWatch', selectedSpell) end
+				set = function(key, value) ns:SetFilterOptions('PetBuffWatch', value) end
 			}
 		}
 	};