diff --git a/ShaguTweaks-extras.toc b/ShaguTweaks-extras.toc index 7199f06..f7835e7 100644 --- a/ShaguTweaks-extras.toc +++ b/ShaguTweaks-extras.toc @@ -35,6 +35,7 @@ mods\chat-text-shadow.lua # raid frames mods\raid.lua mods\raid-party.lua +mods\raid-hide-party.lua # reduced actionbar size mods\reduced-actionbar-bags.lua diff --git a/mods/raid-hide-party.lua b/mods/raid-hide-party.lua new file mode 100644 index 0000000..eabed3a --- /dev/null +++ b/mods/raid-hide-party.lua @@ -0,0 +1,53 @@ +local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T + +local module = ShaguTweaks:register({ + title = T["Hide Party Frames"], + description = T["Disable default party frames while the raidframes are active."], + expansions = { ["vanilla"] = true, ["tbc"] = false }, + category = T["Raid Frames"], + maintainer = "@shagu (GitHub)", + enabled = nil, +}) + +module.enable = function(self) + local show = _G['PartyMemberFrame1'].Show + local hide = function() return end + + local scanner = CreateFrame("Frame", nil, UIParent) + scanner:SetScript("OnUpdate", function() + if ShaguTweaksRaidFrame and ShaguTweaksRaidFrame:IsShown() then + --print("REMOVE GROUP") + if not this.disable then + -- disable all party frames + for i = 1, MAX_PARTY_MEMBERS do + local frame = _G['PartyMemberFrame' .. i] + if frame then + frame.Show = hide + frame:Hide() + end + end + + this.disable = true + end + else + --print("RESTORE GROUP") + if this.disable then + -- enable all party frames + for i = 1, MAX_PARTY_MEMBERS do + for i = 1, MAX_PARTY_MEMBERS do + local frame = _G['PartyMemberFrame' .. i] + if frame then + frame.Show = show + if GetPartyMember(i) then + frame:Show() + end + end + end + end + + this.disable = nil + end + end + end) +end