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