View Single Post
04-12-24, 07:22 AM   #9
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,950
Yes, my last example, 2 lines in the OnClick script will open the settings panel to the addon list page. There doesn't seem to be a way addons can open to their own section of the settings by code. Maybe it is protected and needs the user to select the item in the list.


Where is the code where you set up your settings/options page ?

You might still have stuff missing to make it work.

And how you have done it will determine whether you need to use
Lua Code:
  1. InterfaceOptions_OpenToCategory("AddonName")
or
Lua Code:
  1. Settings.OpenToCategory(category:GetID())

As a reminder:
This link gives you an example on how to use the OLD InterfaceOptionsFrame way of adding a settings page. And includes the example on how to show the page on request.
https://warcraft.wiki.gg/wiki/Using_...s_Addons_panel

This post from 2 years ago talks through a few problems people have had getting it to work. It might help you.
https://www.wowinterface.com/forums/...ad.php?t=57172



Bear in mind that the
Lua Code:
  1. InterfaceOptionsFrame_OpenToCategory("MyAddonOptionsPanel")
line is deprecated in Dragonflight and will be removed eventually.

Instead it is replaced with
Lua Code:
  1. Settings.OpenToCategory()

So, you might want to consider using the new Settings functionality added in Dragonflight. This will save you having to figure it out again later when it stops working when the functionality is removed.

But you have to set up your settings page to work with Blizzards Settings ( my last block of code gives an example of how one of those ways works - Vertical Display - and the link below also includes the Canvas route and that is the closest to the old InterfaceOptions way).

As a reminder:
https://warcraft.wiki.gg/wiki/Patch_...s#Settings_API Gives you an example of how to set that up ( my last code block is a copy of this with a button to click it open added.

You can then use the following to open up the settings frame and show the addon page ( finally managed to get it work with my example with the following in the OnClick function.
Lua Code:
  1. Settings.OpenToCategory(category:GetID())

category is set up when you create your settings panel and connect it to the settings system.


So .. depending on how you have created your panel, will determine which version you use and whether it will work or not.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 04-12-24 at 09:04 AM.
  Reply With Quote