From 8baaa93eb325d8723d8fba3fff5045af2c48c8cf Mon Sep 17 00:00:00 2001 From: d87 Date: Sun, 10 Sep 2023 11:17:57 +0700 Subject: [PATCH] Update for DF settings panel --- .luacheckrc | 1 + NugRunning.lua | 2 +- Options/NugRunningOptions.lua | 15 ++------------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 4dd3685..076ef3f 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -121,6 +121,7 @@ globals = { "Enum", "UnitPower", "GetTime", + "SettingsPanel", "InterfaceOptionsFrame", "InterfaceOptionsFrame_OpenToCategory", diff --git a/NugRunning.lua b/NugRunning.lua index 14ccc1c..70cb35c 100644 --- a/NugRunning.lua +++ b/NugRunning.lua @@ -402,7 +402,7 @@ function NugRunning.PLAYER_LOGIN(self,event,arg1) NugRunning.SetupSpecialTimers() - local f = CreateFrame('Frame', nil, InterfaceOptionsFrame) + local f = CreateFrame('Frame', nil, SettingsPanel or InterfaceOptionsFrame) f:SetScript('OnShow', function(self) self:SetScript('OnShow', nil) LoadAddOn('NugRunningOptions') diff --git a/Options/NugRunningOptions.lua b/Options/NugRunningOptions.lua index 3982352..59abaa0 100644 --- a/Options/NugRunningOptions.lua +++ b/Options/NugRunningOptions.lua @@ -1876,7 +1876,7 @@ local function MakeGeneralOptions() AceConfigRegistry:RegisterOptionsTable("NugRunningGeneral", opt) local AceConfigDialog = LibStub("AceConfigDialog-3.0") - local panelFrame = AceConfigDialog:AddToBlizOptions("NugRunningGeneral", "General", "NugRunning") + local panelFrame = AceConfigDialog:AddToBlizOptions("NugRunningGeneral", "NugRunning") return panelFrame end @@ -1919,21 +1919,10 @@ end do local f = CreateFrame('Frame', "NugRunningOptions", InterfaceOptionsFrame) - f.name = "NugRunning" - InterfaceOptions_AddCategory(f); - - f.general = MakeGeneralOptions() + f.general = MakeGeneralOptions() -- makes the root category now f.help = MakeHelp() NugRunningGUI.frame = NugRunningGUI:Create("Spell List", "NugRunning") f.spell_list = NugRunningGUI.frame.frame InterfaceOptions_AddCategory(f.spell_list); - - f:Hide() - f:SetScript("OnShow", function(self) - self:Hide(); - local list = self.spell_list - InterfaceOptionsFrame_OpenToCategory (list) - InterfaceOptionsFrame_OpenToCategory (list) - end) end