From 5021fd1bcead95a93a1fd395480a7f344889f247 Mon Sep 17 00:00:00 2001 From: Florian Berthold Date: Fri, 22 May 2026 21:05:35 +0200 Subject: [PATCH] fix: guard legacy InterfaceOptions globals in UnitFrames The CoA client's reworked options panels may omit legacy InterfaceOptions* status/combat/display widgets; an unguarded access aborted UnitFrames initialisation on login. Guard every access. --- ElvUI/Modules/UnitFrames/UnitFrames.lua | 57 +++++++++++++++++-------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/ElvUI/Modules/UnitFrames/UnitFrames.lua b/ElvUI/Modules/UnitFrames/UnitFrames.lua index dd18a8d..d52eaac 100644 --- a/ElvUI/Modules/UnitFrames/UnitFrames.lua +++ b/ElvUI/Modules/UnitFrames/UnitFrames.lua @@ -1429,34 +1429,55 @@ function UF:Initialize() hooksecurefunc(CompactUnitMixin, "SetUnit", UF.DisableBlizzard_SetUnit) end + -- The CoA client's reworked options panels may omit these legacy + -- InterfaceOptions* widgets; guard every access so a missing global + -- cannot abort UnitFrames initialisation. if E.private.unitframe.disabledBlizzardFrames.arena and E.private.unitframe.disabledBlizzardFrames.focus and E.private.unitframe.disabledBlizzardFrames.party then - InterfaceOptionsFrameCategoriesButton10:SetScale(0.0001) + if InterfaceOptionsFrameCategoriesButton10 then + InterfaceOptionsFrameCategoriesButton10:SetScale(0.0001) + end end if E.private.unitframe.disabledBlizzardFrames.player then - InterfaceOptionsStatusTextPanelPlayer:SetScale(0.0001) - InterfaceOptionsStatusTextPanelPlayer:SetAlpha(0) - InterfaceOptionsStatusTextPanelPet:SetScale(0.0001) - InterfaceOptionsStatusTextPanelPet:SetAlpha(0) + if InterfaceOptionsStatusTextPanelPlayer then + InterfaceOptionsStatusTextPanelPlayer:SetScale(0.0001) + InterfaceOptionsStatusTextPanelPlayer:SetAlpha(0) + end + if InterfaceOptionsStatusTextPanelPet then + InterfaceOptionsStatusTextPanelPet:SetScale(0.0001) + InterfaceOptionsStatusTextPanelPet:SetAlpha(0) + end end if E.private.unitframe.disabledBlizzardFrames.target then - InterfaceOptionsStatusTextPanelTarget:SetScale(0.0001) - InterfaceOptionsStatusTextPanelTarget:SetAlpha(0) - InterfaceOptionsCombatPanelEnemyCastBarsOnPortrait:SetAlpha(0) - InterfaceOptionsCombatPanelEnemyCastBarsOnPortrait:EnableMouse(false) - InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:ClearAllPoints() - InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:Point(InterfaceOptionsCombatPanelEnemyCastBarsOnPortrait:GetPoint()) - InterfaceOptionsCombatPanelTargetOfTarget:SetScale(0.0001) - InterfaceOptionsCombatPanelTargetOfTarget:SetAlpha(0) - InterfaceOptionsDisplayPanelShowAggroPercentage:SetScale(0.0001) - InterfaceOptionsDisplayPanelShowAggroPercentage:SetAlpha(0) + if InterfaceOptionsStatusTextPanelTarget then + InterfaceOptionsStatusTextPanelTarget:SetScale(0.0001) + InterfaceOptionsStatusTextPanelTarget:SetAlpha(0) + end + if InterfaceOptionsCombatPanelEnemyCastBarsOnPortrait and InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates then + InterfaceOptionsCombatPanelEnemyCastBarsOnPortrait:SetAlpha(0) + InterfaceOptionsCombatPanelEnemyCastBarsOnPortrait:EnableMouse(false) + InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:ClearAllPoints() + InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:Point(InterfaceOptionsCombatPanelEnemyCastBarsOnPortrait:GetPoint()) + end + if InterfaceOptionsCombatPanelTargetOfTarget then + InterfaceOptionsCombatPanelTargetOfTarget:SetScale(0.0001) + InterfaceOptionsCombatPanelTargetOfTarget:SetAlpha(0) + end + if InterfaceOptionsDisplayPanelShowAggroPercentage then + InterfaceOptionsDisplayPanelShowAggroPercentage:SetScale(0.0001) + InterfaceOptionsDisplayPanelShowAggroPercentage:SetAlpha(0) + end end if E.private.unitframe.disabledBlizzardFrames.party then - InterfaceOptionsStatusTextPanelParty:SetScale(0.0001) - InterfaceOptionsStatusTextPanelParty:SetAlpha(0) - InterfaceOptionsFrameCategoriesButton11:SetScale(0.0001) + if InterfaceOptionsStatusTextPanelParty then + InterfaceOptionsStatusTextPanelParty:SetScale(0.0001) + InterfaceOptionsStatusTextPanelParty:SetAlpha(0) + end + if InterfaceOptionsFrameCategoriesButton11 then + InterfaceOptionsFrameCategoriesButton11:SetScale(0.0001) + end end if E.private.unitframe.disabledBlizzardFrames.arena then