Quantcast

Fixed the weights configuration dialog to not collapse any used classes in addition to the player's current class

Kevin Lyles [01-22-10 - 18:34]
Fixed the weights configuration dialog to not collapse any used classes in addition to the player's current class
Filename
weights.lua
diff --git a/weights.lua b/weights.lua
index 6d162b6..67ae4fc 100644
--- a/weights.lua
+++ b/weights.lua
@@ -409,13 +409,12 @@ function loadClassButtons()
 	local _, class = UnitClass("player")
 	for _, classFrame in ipairs(ww_weights.leftPanel.scrollFrame.categories) do
 		classFrame.class = revClassLookup[classFrame.text:GetText()]
-		if classFrame.class ~= class then
-			classFrame.text:Click()
-		end
+		local used = (classFrame.class == class)
 		for i, weightFrame in ipairs({classFrame:GetChildren()}) do
 			if weightFrame.name then
 				if ww_charVars.activeWeights[classFrame.class] then
 					for _, weight in ipairs(ww_charVars.activeWeights[classFrame.class]) do
+						used = true
 						if weight == weightFrame.name then
 							weightFrame.checkButton:SetChecked(true)
 							break
@@ -429,6 +428,9 @@ function loadClassButtons()
 				end
 			end
 		end
+		if not used then
+			classFrame.text:Click()
+		end
 	end
 end