Lore archive · Warcraft Wiki, 2023 dump
Using the Interface Options Addons panel
Last wiki revision 2022-11-08
The Interface window includes a tab for third-party AddOns to share a common look and feel. This tutorial expands on instructions in the source code at.
It is minimally necessary to create a frame (panel), assign the field, and pass it to InterfaceOptions_AddCategory:
- Fields used when registering a new panel:
- name : string - Name in the list of panels (customarily the AddOn name, unless it is a sub-panel).
- parent : string ? - The name of another panel to appear as a its sub-panel. If omitted, or if the other panel is not found, then this panel remains top-level.
- Fields used during user interaction:
- refresh : function ? - Callback when the panel first appears and also after default.
- okay : function ? - Callback when the user presses the Okay button to save settings.
- cancel : function ? - Callback when the user presses the Cancel button to discard changes.
- default : function ? - Callback when the user presses the Default button to restore default settings; followed by refresh.
- InterfaceOptions_AddCategory(panel [, addOn, position]) : Adds a configuration panel.
- panel : - A panel with widgets (children) to control an AddOn.
- addOn : boolean ? - Identifies an AddOn is from a third party; however, the argment has no effect because the function body checks.
- position : number ? - Position in the list of panels; omitting defaults to alphabetical order.
- InterfaceAddOnsList_Update : Prepares the InterfaceOptionsFrameAddOns buttons list, ensuring future calls to InterfaceOptionsFrame_OpenToCategory will succeed.
- InterfaceOptionsFrame_OpenToCategory(panel) : Opens the Interface window to the chosen panel; however, this may fail the first time it is called unless preceeded by InterfaceAddOnsList_Update.
- panel : | string - The registered panel, or its name.
- InterfaceOptionsFrame_Show : Toggles visibility of the Interface Options frame.
- The panel's parent, anchors and visibility are controlled by the InterfaceOptions API.
- okay, cancel, default and refresh are called using so errors in one AddOn do not prevent another from applying changes. During debugging, it is necessary to wrap code in to identify errors.
Fitting many options inside the border texture using a :
HelloWorld example from Create a WoW AddOn in 15 Minutes:
Source
https://warcraft.wiki.gg/wiki/Using_the_Interface_Options_Addons_panel · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.