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) self.configChangedFuncs.display.cbheight.ro(sizes.cbheight)
-- handle default interface cvars & checkboxes -- handle default interface cvars & checkboxes
InterfaceOptionsCombatPanel:HookScript( -- The CoA client's reworked Settings panel may not expose these legacy
"OnShow", -- globals; guard each access so a missing widget cannot error every time
function() -- the Combat options panel is shown.
InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:SetChecked(true) if InterfaceOptionsCombatPanel then
InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:Disable() InterfaceOptionsCombatPanel:HookScript(
end "OnShow",
) function()
if InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates then
InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:SetChecked(true)
InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:Disable()
end
end
)
end
InterfaceOptionsFrame:HookScript( InterfaceOptionsFrame:HookScript(
"OnHide", "OnHide",
function() function()
+12 -5
View File
@@ -94,11 +94,18 @@ function mod:OnInitialize()
self:SetEnabledState(self.db.profile.friendly) self:SetEnabledState(self.db.profile.friendly)
-- handle default interface cvars & checkboxes -- handle default interface cvars & checkboxes
InterfaceOptionsCombatPanel:HookScript("OnShow", function() -- The CoA client's reworked Settings panel does not expose the legacy
InterfaceOptionsCombatPanelNameplateClassColors:Disable() -- InterfaceOptionsCombatPanel / NameplateClassColors checkbox, so guard
InterfaceOptionsCombatPanelNameplateClassColors:SetChecked(mod.db.profile.enemy) -- every access to avoid indexing a nil global.
InterfaceOptionsCombatPanelNameplateClassColors.Enable = function() return end if InterfaceOptionsCombatPanel then
end) 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) InterfaceOptionsFrame:HookScript("OnHide", function() SetCVars() end)
SetCVars() SetCVars()
end end