Skip to content

Commit

Permalink
Fix issue #187, ShowOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
b-morgan committed Oct 8, 2024
1 parent 4260af3 commit 2466c81
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions SkilletOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1588,35 +1588,10 @@ function Skillet:ConfigureOptions()
acedia:AddToBlizOptions("Skillet Plugins", "Plugins", "Skillet")
end

local function ScrollToCategory(panelName,offset)
local idx = 0
InterfaceOptionsFrameAddOnsListScrollBar:SetValue(0)
local mdx = #INTERFACEOPTIONS_ADDONCATEGORIES
for i,cat in ipairs(INTERFACEOPTIONS_ADDONCATEGORIES) do
if not cat.hidden then
idx = idx + 1
if cat.name == panelName then
break
end
end
end
local numbuttons = #(InterfaceOptionsFrameAddOns.buttons)
--DA.DEBUG(0,"ScrollToCategory: numbuttons= "..tostring(numbuttons)..", idx= "..tostring(idx)..", mdx= "..tostring(mdx)..", offset= "..tostring(offset))
if idx and numbuttons and idx > numbuttons then
local btnHeight = InterfaceOptionsFrameAddOns.buttons[1]:GetHeight()
if offset+idx > mdx then
idx = mdx - offset
end
InterfaceOptionsFrameAddOnsListScrollBar:SetValue((offset+idx-numbuttons)*btnHeight)
end
end

--
-- Show the options window
--
function Skillet:ShowOptions()
InterfaceOptionsFrame_Show()
ScrollToCategory("Skillet",4)
InterfaceOptionsFrame_OpenToCategory("Skillet")
Settings.OpenToCategory("Skillet")
end

0 comments on commit 2466c81

Please sign in to comment.