From 908bf4b6d9139c881de32d8bf1dec82509f926a1 Mon Sep 17 00:00:00 2001 From: Sinus Date: Thu, 6 Jun 2024 03:14:37 +0200 Subject: [PATCH] Updated Settings handling per WoW build 55000 --- config.lua | 8 +++++++- core.lua | 8 ++++++-- ldb.lua | 8 ++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/config.lua b/config.lua index 95b1329..bb1b608 100644 --- a/config.lua +++ b/config.lua @@ -148,5 +148,11 @@ frame:SetScript("OnShow", function(frame) frame:SetScript("OnShow", nil) end) -InterfaceOptions_AddCategory(frame) +if InterfaceOptions_AddCategory then + InterfaceOptions_AddCategory(frame) +else + local category, layout = Settings.RegisterCanvasLayoutCategory(frame, frame.name); + Settings.RegisterAddOnCategory(category); + addon.settingsCategory = category +end diff --git a/core.lua b/core.lua index 597513d..10f5be7 100644 --- a/core.lua +++ b/core.lua @@ -142,8 +142,12 @@ do if msg == "show" then addon:OpenSack() else - InterfaceOptionsFrame_OpenToCategory(addonName) - InterfaceOptionsFrame_OpenToCategory(addonName) + if InterfaceOptionsFrame_OpenToCategory then + InterfaceOptionsFrame_OpenToCategory(addonName) + InterfaceOptionsFrame_OpenToCategory(addonName) + else + Settings.OpenToCategory(addon.settingsCategory.ID) + end end end SLASH_BugSack1 = "/bugsack" diff --git a/ldb.lua b/ldb.lua index fd289a2..520ae2e 100644 --- a/ldb.lua +++ b/ldb.lua @@ -15,8 +15,12 @@ local BugGrabber = BugGrabber function plugin.OnClick(self, button) if button == "RightButton" then - InterfaceOptionsFrame_OpenToCategory(addonName) - InterfaceOptionsFrame_OpenToCategory(addonName) + if InterfaceOptionsFrame_OpenToCategory then + InterfaceOptionsFrame_OpenToCategory(addonName) + InterfaceOptionsFrame_OpenToCategory(addonName) + else + Settings.OpenToCategory(addon.settingsCategory.ID) + end else if IsShiftKeyDown() then ReloadUI()