File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed
Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ globals = {
9999 "UIParent",
100100 "UISpecialFrames",
101101 "Settings",
102+ "SettingsPanel",
102103 "PartyMemberFrame1",
103104 -- FrameXML globals
104105
Original file line number Diff line number Diff line change 537537 " C_Timer" ,
538538 " hooksecurefunc" ,
539539 " GetTime" ,
540- " AdvancedInterfaceOptionsSaved"
540+ " AdvancedInterfaceOptionsSaved" ,
541+ " SettingsPanel"
541542 ],
542543 "diagnostics.disable" : [
543544 " lowercase-global" ,
Original file line number Diff line number Diff line change @@ -129,14 +129,25 @@ function E:Init() -- Runs after our saved variables are loaded and cvars have be
129129 end
130130 SLASH_AIO1 = " /aio"
131131
132- -- TODO: Re-enable in 11.0.2 when subcategories are fixed
133- --[[ SlashCmdList.CVAR = function()
134- if not InCombatLockdown() then
135- -- Does not work, opens to main category
136- Settings.OpenToCategory(cVarCategoryID)
132+ -- TODO: Adjust in 11.0.2 when subcategories are properly fixed
133+ SlashCmdList .CVAR = function ()
134+ if not InCombatLockdown () then
135+ for _ , category in ipairs (SettingsPanel :GetCategoryList ().allCategories ) do
136+ if category .ID == mainCategoryID and category .subcategories then
137+ for _ , subCategory in ipairs (category .subcategories ) do
138+ if subCategory .ID == cVarCategoryID then
139+ SettingsPanel :Show ()
140+ SettingsPanel :SelectCategory (subCategory )
141+ break
142+ end
143+ end
137144 end
145+ end
146+ else
147+ DEFAULT_CHAT_FRAME :AddMessage (format (" %s: Can't modify interface options in combat" , addonName ))
138148 end
139- SLASH_CVAR1 = "/cvar"]]
149+ end
150+ SLASH_CVAR1 = " /cvar"
140151end
141152
142153function addon :RecordCVar (cvar , value ) -- Save cvar to DB for loading later
You can’t perform that action at this time.
0 commit comments