diff --git a/ShadowedUF_Options/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/ShadowedUF_Options/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua index e758beb..19772f0 100644 --- a/ShadowedUF_Options/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua +++ b/ShadowedUF_Options/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua @@ -2014,28 +2014,37 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...) group:SetCallback("OnHide", ClearBlizPanel) local categoryName = name or appName - if parent then - local parentID = BlizOptionsIDMap[parent] or parent - local category = Settings.GetCategory(parentID) - if not category then - error(("The parent category '%s' was not found"):format(parent), 2) - end - local subcategory = Settings.RegisterCanvasLayoutSubcategory(category, group.frame, categoryName) - group:SetName(subcategory.ID, parentID) - else - if BlizOptionsIDMap[categoryName] then - error(("%s has already been added to the Blizzard Options Window with the given name: %s"):format(appName, categoryName), 2) - end + -- CoA-compat: the Settings.* API (GetCategory / RegisterCanvasLayoutCategory / + -- RegisterCanvasLayoutSubcategory / RegisterAddOnCategory) is a retail-only + -- (Dragonflight+) replacement for the WotLK-era InterfaceOptions_AddCategory. + -- On the 3.3.5-based CoA client Settings is nil, so fall back to the legacy API. + if Settings and Settings.GetCategory then + if parent then + local parentID = BlizOptionsIDMap[parent] or parent + local category = Settings.GetCategory(parentID) + if not category then + error(("The parent category '%s' was not found"):format(parent), 2) + end + local subcategory = Settings.RegisterCanvasLayoutSubcategory(category, group.frame, categoryName) + group:SetName(subcategory.ID, parentID) + else + if BlizOptionsIDMap[categoryName] then + error(("%s has already been added to the Blizzard Options Window with the given name: %s"):format(appName, categoryName), 2) + end - local category = Settings.RegisterCanvasLayoutCategory(group.frame, categoryName) - if not (C_SettingsUtil and C_SettingsUtil.OpenSettingsPanel) then - -- override the ID so the name can be used in Settings.OpenToCategory - -- unfortunately with incoming API changes in 12.0 (and likely classic at some point) this override is no longer possible - category.ID = categoryName + local category = Settings.RegisterCanvasLayoutCategory(group.frame, categoryName) + if not (C_SettingsUtil and C_SettingsUtil.OpenSettingsPanel) then + -- override the ID so the name can be used in Settings.OpenToCategory + -- unfortunately with incoming API changes in 12.0 (and likely classic at some point) this override is no longer possible + category.ID = categoryName + end + group:SetName(category.ID) + BlizOptionsIDMap[categoryName] = category.ID + Settings.RegisterAddOnCategory(category) end - group:SetName(category.ID) - BlizOptionsIDMap[categoryName] = category.ID - Settings.RegisterAddOnCategory(category) + else + group:SetName(name or appName, parent) + InterfaceOptions_AddCategory(group.frame) end return group.frame, group.frame.name diff --git a/ShadowedUF_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua b/ShadowedUF_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua index d95db58..4f635d8 100644 --- a/ShadowedUF_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua +++ b/ShadowedUF_Options/libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua @@ -99,7 +99,11 @@ local methods = { Constructor -------------------------------------------------------------------------------]] local function Constructor() - local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer) + -- CoA-compat: InterfaceOptionsFramePanelContainer is a global from the stock 3.3.5 + -- Interface Options frame; on the CoA reworked FrameXML it can be nil at the time + -- AceGUI widgets are constructed. Fall back to UIParent so CreateFrame doesn't blow up. + local _parent = InterfaceOptionsFramePanelContainer or UIParent + local frame = CreateFrame("Frame", nil, _parent) frame:Hide() -- support functions for the Blizzard Interface Options