api/AceConfigDialog-3.0
AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables.
AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
Add an option table into the Blizzard Interface Options panel.
You can optionally supply a descriptive name to use and a parent frame to use, as well as a path in the options table.
If no name is specified, the appName will be used instead.
If you specify a proper `parent` (by name), the interface options will generate a tree layout. Note that only one level of children is supported, so the parent always has to be a head-level note.
This function returns a reference to the container frame registered with the Interface Options. You can use this reference to open the options with the API function `InterfaceOptionsFrame_OpenToCategory`. For WoW 10.0, the second return parameter contains the category ID, which can be passed to `Settings.OpenToCategory`.
Parameters
- appName
- The application name as given to `:RegisterOptionsTable()`
- name
- A descriptive name to display in the options tree (defaults to appName)
- parent
- The parent to use in the interface options tree.
- ...
- The path in the options table to feed into the interface options panel.
Return values
- The reference to the frame registered into the Interface Options.
- The registered category ID
AceConfigDialog:Close(appName)
Close a specific options window.
Parameters
- appName
- The application name as given to `:RegisterOptionsTable()`
AceConfigDialog:CloseAll()
Close all open options windows
AceConfigDialog:Open(appName [, container][, ...])
Open an option window at the specified path (if any).
This function can optionally feed the group into a pre-created container instead of creating a new container frame.
Parameters
- appName
- The application name as given to `:RegisterOptionsTable()`
- container
- An optional container frame to feed the options into
- ...
- The path to open after creating the options window (see `:SelectGroup` for details)
AceConfigDialog:SelectGroup(appName, ...)
Selects the specified path in the options window.
The path specified has to match the keys of the groups in the table.
Parameters
- appName
- The application name as given to `:RegisterOptionsTable()`
- ...
- The path to the key that should be selected
AceConfigDialog:SetDefaultSize(appName, width, height)
Sets the default size of the options window for a specific application.
Parameters
- appName
- The application name as given to `:RegisterOptionsTable()`
- width
- The default width
- height
- The default height
Something I hadn't appreciated until this evening is that when using AceConfigDialog:AddToBlizOptions(appName, name, parent, ...) the appName MUST BE unique.
When coding my mod, I used example code I found on wowace.com that specified how to add profiles to your mod.
That works just fine. However if anyone else codes their mod the same, then the user ends up with an error message as two (or more) mods try to register the options page with the name "Profiles" In the example above, I would need to change the last two lines:
The user never sees the text "MyApp Profiles" as the AddToBlizOptions function specifies that the display text is simply, "Profiles"
After adding your configuration dialog to the Blizzard Interface frame, you can also hook into the standard "Defaults" button presented to the user. You do this by assigning a handler to the
default
member of the returned frame:When the user resets "These Settings" of your addon's configuration, your callback
SetDefaultOptions
will be called:The issue then is that your configuration dialog, on screen, will show values that are not correct. You can force the configuration dialog to refresh itself by calling:
in other words:
The third parameter of the AddToBlizOptions() function needs the text display name of the parent item, not the appName.
I can't speak for anyone else, but I kept trying to use "MyApp" for the parent parameter and the parent relationship therefore failed causing the collapse button to not appear in the interface options tree.
It took me a little bit to figure this out, if you want to open your addon settings in the default Bliz frame use InterfaceOptionsFrame_OpenToCategory(appName) and not AceConfigDialog:Open(appName)
A :Toggle(appName) function would be nice. Also a :SetMinResize(appname, width, height), :SetMaxResize(appname, width, height).
If you want to check if an AddOn's GUI is open, use AceConfigDialog.OpenFrames["AppName"]. This is useful to close GUIs during combat, or toggle between opened and closed states. Note the square backets, not curved.