Skip to content

Commit

Permalink
Reenable /cvar command
Browse files Browse the repository at this point in the history
Thanks @xepheris for the hint
  • Loading branch information
Stanzilla committed Jul 28, 2024
1 parent 371d279 commit 1437d41
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ globals = {
"UIParent",
"UISpecialFrames",
"Settings",
"SettingsPanel",
"PartyMemberFrame1",
-- FrameXML globals

Expand Down
3 changes: 2 additions & 1 deletion .luarc.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@
"C_Timer",
"hooksecurefunc",
"GetTime",
"AdvancedInterfaceOptionsSaved"
"AdvancedInterfaceOptionsSaved",
"SettingsPanel"
],
"diagnostics.disable": [
"lowercase-global",
Expand Down
23 changes: 17 additions & 6 deletions basicOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,25 @@ function E:Init() -- Runs after our saved variables are loaded and cvars have be
end
SLASH_AIO1 = "/aio"

-- TODO: Re-enable in 11.0.2 when subcategories are fixed
--[[SlashCmdList.CVAR = function()
if not InCombatLockdown() then
-- Does not work, opens to main category
Settings.OpenToCategory(cVarCategoryID)
-- TODO: Adjust in 11.0.2 when subcategories are properly fixed
SlashCmdList.CVAR = function()
if not InCombatLockdown() then
for _, category in ipairs(SettingsPanel:GetCategoryList().allCategories) do
if category.ID == mainCategoryID and category.subcategories then
for _, subCategory in ipairs(category.subcategories) do
if subCategory.ID == cVarCategoryID then
SettingsPanel:Show()
SettingsPanel:SelectCategory(subCategory)
break
end
end
end
end
else
DEFAULT_CHAT_FRAME:AddMessage(format("%s: Can't modify interface options in combat", addonName))
end
SLASH_CVAR1 = "/cvar"]]
end
SLASH_CVAR1 = "/cvar"
end

function addon:RecordCVar(cvar, value) -- Save cvar to DB for loading later
Expand Down

0 comments on commit 1437d41

Please sign in to comment.