diff --git a/ElvUI/Core/Cooldowns.lua b/ElvUI/Core/Cooldowns.lua index e60abfe..4acbb92 100644 --- a/ElvUI/Core/Cooldowns.lua +++ b/ElvUI/Core/Cooldowns.lua @@ -7,7 +7,6 @@ local format = string.format local GetTime = GetTime --WoW API / Variables local CreateFrame = CreateFrame -local hooksecurefunc = hooksecurefunc local ICON_SIZE = 36 --the normal size for an icon (don't change this) local FONT_SIZE = 20 --the base font size to use at a scale of 1 diff --git a/ElvUI/Modules/ActionBars/Bind.lua b/ElvUI/Modules/ActionBars/Bind.lua index 16fb280..1062cc9 100644 --- a/ElvUI/Modules/ActionBars/Bind.lua +++ b/ElvUI/Modules/ActionBars/Bind.lua @@ -14,7 +14,6 @@ local GameTooltip_Hide = GameTooltip_Hide local GetBindingKey = GetBindingKey local GetCurrentBindingSet = GetCurrentBindingSet local GetMacroInfo = GetMacroInfo -local hooksecurefunc = hooksecurefunc local IsAddOnLoaded = IsAddOnLoaded local IsAltKeyDown = IsAltKeyDown local IsControlKeyDown = IsControlKeyDown diff --git a/ElvUI/Modules/UnitFrames/Groups/Party.lua b/ElvUI/Modules/UnitFrames/Groups/Party.lua index e864042..a03166b 100644 --- a/ElvUI/Modules/UnitFrames/Groups/Party.lua +++ b/ElvUI/Modules/UnitFrames/Groups/Party.lua @@ -42,16 +42,32 @@ function UF:Construct_PartyFrames() return self; end +function UF:PartySmartVisibility() + if not self then self = this end + + if GetNumRaidMembers() < 1 then + self:Show() + else + self:Hide() + end +end + function UF:Update_PartyHeader(header) if not header.positioned then header:ClearAllPoints() header:SetPoint("BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 4, 195) E:CreateMover(header, header:GetName().."Mover", L["Party Frames"], nil, nil, nil, "ALL,PARTY") + + header:RegisterEvent("PARTY_MEMBERS_CHANGED") + header:RegisterEvent("RAID_ROSTER_UPDATE") + header:SetScript("OnEvent", UF["PartySmartVisibility"]) + header.positioned = true end -end + UF.PartySmartVisibility(header) +end function UF:Update_PartyFrames(frame, db) frame.db = db diff --git a/ElvUI/Modules/UnitFrames/Groups/Raid.lua b/ElvUI/Modules/UnitFrames/Groups/Raid.lua index a7b1d53..cbfd7f7 100644 --- a/ElvUI/Modules/UnitFrames/Groups/Raid.lua +++ b/ElvUI/Modules/UnitFrames/Groups/Raid.lua @@ -42,14 +42,31 @@ function UF:Construct_RaidFrames() return self end +function UF:RaidSmartVisibility() + if not self then self = this end + + if GetNumRaidMembers() > 1 then + self:Show() + else + self:Hide() + end +end + function UF:Update_RaidHeader(header) if not header.positioned then header:ClearAllPoints() header:SetPoint("BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 4, 195) E:CreateMover(header, header:GetName().."Mover", L["Raid Frames"], nil, nil, nil, "ALL,RAID") + + header:RegisterEvent("PARTY_MEMBERS_CHANGED") + header:RegisterEvent("RAID_ROSTER_UPDATE") + header:SetScript("OnEvent", UF["RaidSmartVisibility"]) + header.positioned = true end + + UF.RaidSmartVisibility(header) end function UF:Update_RaidFrames(frame, db)