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.
This commit is contained in:
2026-05-22 21:05:35 +02:00
parent 500ba12da0
commit 5021fd1bce
+39 -18
View File
@@ -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