Skip to content

Commit

Permalink
Use new Settings API
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharparam committed Aug 13, 2024
1 parent bc72412 commit ab03280
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ stds.wow = {
"RaidNotice_AddMessage",
"RaidWarningFrame",
"SendChatMessage",
"Settings",
"SOUNDKIT",
"StaticPopup_Show",
"time",
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"PlaySound",
"string",
"math",
"Settings",
"SOUNDKIT",
"IsInRaid",
"IsInGroup",
Expand Down
8 changes: 5 additions & 3 deletions Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ local panel = Opt.Panel
panel.name = "KillTrack"
panel:Hide()

local category = Settings.RegisterCanvasLayoutCategory(panel, panel.name)
Opt.Category = category

-- Dirty hack to give a name to option checkboxes
local checkCounter = 0

Expand Down Expand Up @@ -73,8 +76,7 @@ local function HideBlizzOptions()
end

function Opt:Open()
InterfaceOptionsFrame_OpenToCategory(panel)
InterfaceOptionsFrame_OpenToCategory(panel)
Settings.OpenToCategory(self.Category.ID)
end

function Opt:Show()
Expand Down Expand Up @@ -259,4 +261,4 @@ end

panel:SetScript("OnShow", function(self) Opt.Show(self) end)

InterfaceOptions_AddCategory(panel)
Settings.RegisterAddOnCategory(category)

0 comments on commit ab03280

Please sign in to comment.