Update 6; fixed multiselect

katkat42 [03-04-15 - 02:09]
Update 6; fixed multiselect
Filename
AddonClearer.lua
AddonClearer.txt
diff --git a/AddonClearer.lua b/AddonClearer.lua
index 90c7db9..115022b 100644
--- a/AddonClearer.lua
+++ b/AddonClearer.lua
@@ -3,7 +3,7 @@ AddonClearer = {}
 function AddonClearer:SetAddons(toDo)
 	table.sort(ZO_AddOnsList.data, function(a,b) return a.data.addOnFileName == "AddonClearer" end) -- In place sorting. oh dear
 	local thisAddonIndex = ZO_AddOnsList.data[1].data.index
-
+
 	local notEmpty = false

 	if not toDo then -- Save current setup
@@ -26,26 +26,26 @@ function AddonClearer:SetAddons(toDo)
 	end

 	local AddOnManager = GetAddOnManager()
-	local numAddons = AddOnManager:GetNumAddOns()
-	for i = 1, numAddons do
+	local numAddons = AddOnManager:GetNumAddOns()
+	for i = 1, numAddons do
 		if i ~= thisAddonIndex then -- ignore this addon
 			if SelectAddonButton.nameLabel:GetText() == "Select Saved" and toDo then -- Are we restoring from save?
-				AddOnManager:SetAddOnEnabled(i, AddonClearer.settings.savedSetup[i])
+				AddOnManager:SetAddOnEnabled(i, AddonClearer.settings.savedSetup[i])
 			else -- Otherwise continue as normal
-				AddOnManager:SetAddOnEnabled(i, toDo)
+				AddOnManager:SetAddOnEnabled(i, toDo)
 			end
 		end
 	end
-
+
 	ZO_AddOnManager.isDirty = true
-	-- Reset the view
+	-- Reset the view
 	SCENE_MANAGER:RemoveFragment(ADDONS_FRAGMENT)
 	SCENE_MANAGER:AddFragment(ADDONS_FRAGMENT)
 end

 local firstControl = nil

-function AddonClearer:MultiSelect(button)
+function AddonClearer:MultiSelect(button)
 	if not IsShiftKeyDown() then firstControl = self return false end
 	if firstControl == nil then firstControl = self return false end
 	if self ~= firstControl and IsShiftKeyDown() then
@@ -62,12 +62,12 @@ end

 function AddonClearer:ShowPanel(...)
 	local _, a,b = ...
-
-	if not (a == 14 and b == 5) then return end
-
-	for i,control in ipairs(ZO_AddOnsList.activeControls) do
-		local name = control:GetNamedChild("Name")
-		local enabled = control:GetNamedChild("Enabled")
+
+	if not (a == 16 and b == 5) then return end
+
+	for i,control in ipairs(ZO_AddOnsList.activeControls) do
+		local name = control:GetNamedChild("Name")
+		local enabled = control:GetNamedChild("Enabled")
 		local enabledClick = enabled:GetHandler("OnClicked")
 		name:SetMouseEnabled(true)
 		name:SetHandler("OnMouseDown", function(self, button) AddonClearer.MultiSelect(enabled, button) enabledClick(enabled, button) end)
diff --git a/AddonClearer.txt b/AddonClearer.txt
index 17f29e2..b39c338 100644
--- a/AddonClearer.txt
+++ b/AddonClearer.txt
@@ -1,7 +1,7 @@
 ## Title: |cFFFFB0AddonClearer|r by |c00C000Wobin & CrazyDutchGuy & katkat42|r
 ## Author: CrazyDutchGuy and Wobin and katkat42
 ## Version: @project-version@
-## APIVersion: 100010
+## APIVersion: 100011
 ## SavedVariables: AddonClearerSV

 AddonClearer.lua