View Single Post
04-12-24, 03:09 AM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,962
Okay.

Which one of these were you hoping to implement ? Each one will involve different set up and calls to show up.

1. Display Panel in pre Dragonflight InterfaceOptionsFrame

Use example in https://warcraft.wiki.gg/wiki/Using_...s_Addons_panel to make sure your panel is correctly set up to work with the Interface Options Addons Panel system. And then use

`InterfaceOptionsFrame_OpenToCategory(panel)` to open the frame when you click your button ( you might have to call it twice for it to work as per the comment in the small print at the bottom. It will have a close button to close it again - no need to toggle.


2. Display your own custom panel on the main screen like any other frame you create.

In this case, make sure your frame has a background/backdrop and any other controls it needs. And then you can use the following function to toggle your panel to show or hide based on its current status when you click your button.

Example Code:
Lua Code:
  1. local function TogglePanel(panel)
  2.     if panel:IsShown() then
  3.        panel:Hide()
  4.    else
  5.       panel:Show()
  6.    end
  7. end function

But you would have to change this
Lua Code:
  1. local panel = CreateFrame("Frame", "MyAddonOptionsPanel", InterfaceOptionsFrame)
  2. -- Rest of your panel creation code

To this
Lua Code:
  1. local panel = CreateFrame("Frame", "MyAddonOptionsPanel",UIParent)
  2. -- Rest of your panel creation code

3. Have your panel show up as part of the Dragonflight SettingsPanel

https://warcraft.wiki.gg/wiki/Patch_10.0.0/API_changes gives you some sort of example on how to set up your frame to be part of the settings panel. But not an example on how to jump to your panel.

There is a similar Settings.OpenToCategory() function which Fizzle points to in https://www.wowinterface.com/forums/...11&postcount=2 but it only goes to the AddOns tab and not a particular AddOns panel.
__________________


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
  Reply With Quote