WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   PTR General Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=172)
-   -   Opening an addon settings panel? (https://www.wowinterface.com/forums/showthread.php?t=59264)

Zax 10-16-22 05:44 AM

Opening an addon settings panel?
 
Hello,

To open the settings panel of my addon, I use:
Lua Code:
  1. Settings.OpenToCategory(myAddonName)
It worked fine on previous PTR versions but now, this command only opens the general options panel.
Furthermore, if I have several addons, each settings panel is not always refreshed ("open" event is not always sent).

Is there a new way to open an addon settings panel?

sirpucna 10-16-22 07:26 AM

try instead:
Code:

InterfaceOptionsFrame:Show()
InterfaceOptionsFrame_OpenToCategory("YourAddonName")


Zax 10-16-22 08:10 AM

Code:

InterfaceOptionsFrame:Show()
This raises an error on PTR.

Code:

InterfaceOptionsFrame_OpenToCategory("YourAddonName")
This is deprecated, according to https://github.com/Gethe/wow-ui-sour...recated.lua#L4

Xrystal 10-16-22 09:21 AM

You could try this .. Dragonflight includes a fair amount of UI changes

https://wowpedia.fandom.com/wiki/Pat....0/API_changes

There has been some issues however where the settings panel will trigger errors. Whether it is the fault of the code in the addon or the changes in the blizzard code is hard to say.

Fizzlemizz 10-16-22 10:06 AM

Quote:

Originally Posted by Xrystal (Post 341236)
.. Dragonflight includes a fair amount of UI changes

So many in fact, ther's also a seperate page to cover the Beta (the actual Dragonflight expansion release) version which has differences that are not in the PTR.

Xrystal 10-16-22 11:17 AM

thanks, I was looking for that second one .. but guess I forgot how to get to that page rofl

Fizzlemizz 10-16-22 11:23 AM

I was just lucky that changing the last 0 to a 2 got me there ;)

Zax 10-16-22 11:46 AM

Quote:

Originally Posted by Xrystal (Post 341236)
You could try this .. Dragonflight includes a fair amount of UI changes
https://wowpedia.fandom.com/wiki/Pat....0/API_changes

Yes, that's what I did, and the Canvas Layout example worked on previous PTR versions. Maybe it will work again in next versions...

sirpucna 10-16-22 06:18 PM

Quote:

Originally Posted by Zax (Post 341235)
Code:

InterfaceOptionsFrame:Show()
This raises an error on PTR.

Code:

InterfaceOptionsFrame_OpenToCategory("YourAddonName")
This is deprecated, according to https://github.com/Gethe/wow-ui-sour...recated.lua#L4

ahh InterfaceOptionsFrame:Show() did indeed throw a error, swear it didn't in beta last week, but regarding beta(not ptr), the following was tested working just now.
Code:

        CreateFrame("Frame", "OptionsPanel")
        OptionsPanel.name = "YourAddon"
        InterfaceOptions_AddCategory(OptionsPanel)
        SlashCmdList["ABCSlash"] = function()
                InterfaceOptionsFrame_OpenToCategory("YourAddon")
        end
        SLASH_ABCSlash1 = "/abc"


Zax 10-17-22 08:14 AM

Code:

        CreateFrame("Frame", "OptionsPanel")
        OptionsPanel.name = "YourAddon"
        InterfaceOptions_AddCategory(OptionsPanel)
        SlashCmdList["ABCSlash"] = function()
                InterfaceOptionsFrame_OpenToCategory("YourAddon")
        end
        SLASH_ABCSlash1 = "/abc"

Thank you.
It doesn't work better than my original script but we'll see on next PTR versions.


All times are GMT -6. The time now is 02:09 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI