Quantcast

* Fixed the "Hide Blizzard Party" option

James Whitehead II [01-29-08 - 23:09]
* Fixed the "Hide Blizzard Party" option
Filename
PerfectRaid.lua
PerfectRaid_Config.lua
diff --git a/PerfectRaid.lua b/PerfectRaid.lua
index f5871f6..ea7d393 100644
--- a/PerfectRaid.lua
+++ b/PerfectRaid.lua
@@ -224,33 +224,6 @@ function PerfectRaid:CreateRaidFrame(idx)

 	end

-	if self.db.profile.hideparty then
-		if self.db.profile.hideparty then
-			-- Disable the party frames
-			self.hidingparty = true
-			for i=1,4 do
-				local f = getglobal("PartyMemberFrame"..i)
-				f:UnregisterEvent("RAID_ROSTER_UPDATE")
-				f:UnregisterEvent("PARTY_MEMBERS_CHANGED")
-			end
-			if PartyMemberBackground and SHOW_PARTY_BACKGROUND == "1" then
-				PartyMemberBackground:Hide()
-			end
-			HidePartyFrame()
-		elseif self.hidingparty then
-			self.hidingparty = false
-			for i=1,4 do
-				local f = getglobal("PartyMemberFrame"..i)
-				f:RegisterEvent("RAID_ROSTER_UPDATE")
-				f:RegisterEvent("PARTY_MEMBERS_CHANGED")
-			end
-			if PartyMemberBackground and SHOW_PARTY_BACKGROUND == "1" then
-				PartyMemberBackground:Show()
-			end
-			ShowPartyFrame()
-		end
-	end
-
 	-- Position backdrop
 	frame.idx = idx
 	frame.title:SetText(options.title or "")
diff --git a/PerfectRaid_Config.lua b/PerfectRaid_Config.lua
index 51612a0..d9b6b48 100644
--- a/PerfectRaid_Config.lua
+++ b/PerfectRaid_Config.lua
@@ -87,6 +87,8 @@ function Config:CreateOptions(opt)
 		PerfectRaid.db.profile.showmanaonly = showMana
 		PerfectRaid.db.profile.clickcast = clickCast
 		PerfectRaid.db.profile.locked = locked
+
+		Config:PartyVisibility()
 	end

 	function options:CancelOptions()
@@ -107,4 +109,35 @@ function Config:CreateOptions(opt)
 			widget:SetPoint("TOPLEFT", options.widgets[idx - 1], "BOTTOMLEFT", 0, -15)
 		end
 	end
+
+	-- Toggle party visibility
+	self:PartyVisibility()
+end
+
+function Config:PartyVisibility()
+	local hideparty = PerfectRaid.db.profile.hideparty
+	if hideparty then
+		-- Disable the party frames
+		self.hidingparty = true
+		for i=1,4 do
+			local f = getglobal("PartyMemberFrame"..i)
+			f:UnregisterEvent("RAID_ROSTER_UPDATE")
+			f:UnregisterEvent("PARTY_MEMBERS_CHANGED")
+		end
+		if PartyMemberBackground and SHOW_PARTY_BACKGROUND == "1" then
+			PartyMemberBackground:Hide()
+		end
+		HidePartyFrame()
+	elseif self.hidingparty then
+		self.hidingparty = false
+		for i=1,4 do
+			local f = getglobal("PartyMemberFrame"..i)
+			f:RegisterEvent("RAID_ROSTER_UPDATE")
+			f:RegisterEvent("PARTY_MEMBERS_CHANGED")
+		end
+		if PartyMemberBackground and SHOW_PARTY_BACKGROUND == "1" then
+			PartyMemberBackground:Show()
+		end
+		ShowPartyFrame()
+	end
 end