From 32a2e8453f70decf297dd3dac3bdc0d02242e1fb Mon Sep 17 00:00:00 2001 From: Flamanis Date: Wed, 27 Sep 2023 15:32:04 -0500 Subject: [PATCH] Fix support for ElvUI with TotemPlates ElvUI does not force show their nameplates anymore as it can cause blocked actions. So TotemPlates would perma hide any ElvUI nameplate that was attached to a totem until a reload. This forces a call to show when the TotemPlate is removed. --- Modules/TotemPlates.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Modules/TotemPlates.lua b/Modules/TotemPlates.lua index e5e6ef0..be11830 100644 --- a/Modules/TotemPlates.lua +++ b/Modules/TotemPlates.lua @@ -209,6 +209,10 @@ function TotemPlates:NAME_PLATE_UNIT_REMOVED(unitID) nameplate.gladdyTotemFrame:SetParent(nil) tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame) nameplate.gladdyTotemFrame = nil + --Show ElvUI nameplates when totem frame is removed. + if (TotemPlates.addon == "ElvUI") and nameplate.unitFrame then + nameplate.unitFrame:Show() + end end end @@ -402,7 +406,7 @@ function TotemPlates.OnUpdate(self) else self.selectionHighlight:SetAlpha(0) end - if (TotemPlates.addon == "Plater" or TotemPlates.addon == "Tukui" or TotemPlates.addon == "ElvUI") and self.parent and self.parent.unitFrame then + if (TotemPlates.addon == "Plater" or TotemPlates.addon == "Tukui") and self.parent and self.parent.unitFrame then self.parent.unitFrame:Hide() end end @@ -453,6 +457,10 @@ function TotemPlates:OnUnitEvent(unitID) nameplate.gladdyTotemFrame.totemName:SetText(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].customText or "") nameplate.gladdyTotemFrame.parent = nameplate nameplate.gladdyTotemFrame:Show() + --Hide ElvUI nameplates once instead of in OnUpdate + if (TotemPlates.addon == "ElvUI") and nameplate.unitFrame then + nameplate.unitFrame:Hide() + end TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, unitID) self:ToggleAddon(nameplate) self.activeTotemNameplates[unitID] = nameplate @@ -462,6 +470,10 @@ function TotemPlates:OnUnitEvent(unitID) nameplate.gladdyTotemFrame:SetParent(nil) tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame) nameplate.gladdyTotemFrame = nil + --Show ElvUI nameplates when totem frame is removed. + if (TotemPlates.addon == "ElvUI") and nameplate.unitFrame then + nameplate.unitFrame:Show() + end end self:ToggleAddon(nameplate) else @@ -789,4 +801,4 @@ function TotemPlates:GetOptions() args = select(2, GetTotemColorDefaultOptions()) }, } -end \ No newline at end of file +end