fix: guard legacy InterfaceOptions globals for CoA client

The CoA client's reworked Settings panel does not expose
InterfaceOptionsCombatPanelNameplateClassColors or
InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates, causing a nil-index
error whenever the Combat options panel was shown. Guard each access in
ClassColours and Castbar.
This commit is contained in:
2026-05-22 21:05:32 +02:00
parent 77fa7d7f49
commit 7996489a1a
2 changed files with 26 additions and 12 deletions
+14 -7
View File
@@ -402,13 +402,20 @@ function mod:OnInitialize()
self.configChangedFuncs.display.cbheight.ro(sizes.cbheight)
-- handle default interface cvars & checkboxes
InterfaceOptionsCombatPanel:HookScript(
"OnShow",
function()
InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:SetChecked(true)
InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:Disable()
end
)
-- The CoA client's reworked Settings panel may not expose these legacy
-- globals; guard each access so a missing widget cannot error every time
-- the Combat options panel is shown.
if InterfaceOptionsCombatPanel then
InterfaceOptionsCombatPanel:HookScript(
"OnShow",
function()
if InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates then
InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:SetChecked(true)
InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:Disable()
end
end
)
end
InterfaceOptionsFrame:HookScript(
"OnHide",
function()
+12 -5
View File
@@ -94,11 +94,18 @@ function mod:OnInitialize()
self:SetEnabledState(self.db.profile.friendly)
-- handle default interface cvars & checkboxes
InterfaceOptionsCombatPanel:HookScript("OnShow", function()
InterfaceOptionsCombatPanelNameplateClassColors:Disable()
InterfaceOptionsCombatPanelNameplateClassColors:SetChecked(mod.db.profile.enemy)
InterfaceOptionsCombatPanelNameplateClassColors.Enable = function() return end
end)
-- The CoA client's reworked Settings panel does not expose the legacy
-- InterfaceOptionsCombatPanel / NameplateClassColors checkbox, so guard
-- every access to avoid indexing a nil global.
if InterfaceOptionsCombatPanel then
InterfaceOptionsCombatPanel:HookScript("OnShow", function()
if InterfaceOptionsCombatPanelNameplateClassColors then
InterfaceOptionsCombatPanelNameplateClassColors:Disable()
InterfaceOptionsCombatPanelNameplateClassColors:SetChecked(mod.db.profile.enemy)
InterfaceOptionsCombatPanelNameplateClassColors.Enable = function() return end
end
end)
end
InterfaceOptionsFrame:HookScript("OnHide", function() SetCVars() end)
SetCVars()
end