You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Dragonflight the current incarnation of the settings APIs doesn't support directly opening the settings panel to any category that isn't a top-level one.
A test addon is provided that will register a tree of addon categories up to a depth of 3. Once the test addon is loaded, the command listed in the table below can be used to test it.
A modification to the function like this would possibly do as we need it to for this to function.
local function FindCategoryByCategoryID(categories, categoryID)
if categories then
for index, category in ipairs(categories) do
if category:GetID() == categoryID then
return category;
else
local subcategory = FindCategoryByCategoryID(category:GetSubcategories(), categoryID);
if subcategory then return subcategory; end
end
end
end
end
function SettingsPanelMixin:OpenToCategory(categoryID, scrollToElementName)
self:Open();
local categoryTbl = FindCategoryByCategoryID(self:GetAllCategories(), categoryID);
if not categoryTbl then return false; end
self:SelectCategory(categoryTbl);
if scrollToElementName then
self:GetSettingsList():ScrollToElementByName(scrollToElementName);
end
return true;
end
In Dragonflight the current incarnation of the settings APIs doesn't support directly opening the settings panel to any category that isn't a top-level one.
A test addon is provided that will register a tree of addon categories up to a depth of 3. Once the test addon is loaded, the command listed in the table below can be used to test it.
Meorawr_SettingsOpenSubcategoryTest.zip
Meorawr_SettingsOpenSubcategoryTest.lua
/run Settings.OpenToCategory(TestCategory1:GetID())
/run Settings.OpenToCategory(TestCategory2:GetID())
/run Settings.OpenToCategory(TestCategory2_1:GetID())
/run Settings.OpenToCategory(TestCategory1_3_2:GetID())
The text was updated successfully, but these errors were encountered: