From db49688f87d6e332e1580c0f16557f2e8b0966ce Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Tue, 29 Jan 2008 23:09:47 +0000 Subject: [PATCH] * Fixed the "Hide Blizzard Party" option --- PerfectRaid.lua | 27 --------------------------- PerfectRaid_Config.lua | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 27 deletions(-) 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 -- 1.7.9.5