Skip to content

Commit

Permalink
Updated settings handling for TWW (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
SinusPi committed Jun 6, 2024
1 parent b8f76e0 commit 2122823
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
8 changes: 7 additions & 1 deletion config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 6 additions & 2 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 6 additions & 2 deletions ldb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 2122823

Please sign in to comment.