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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user