WoW:Creating GUI configuration options (source)
Revision as of 04:47, 15 August 2023
, 15 August 2023Move page script moved page Creating GUI configuration options to WoW:Creating GUI configuration options without leaving a redirect
(demoted headings) |
m (Move page script moved page Creating GUI configuration options to WoW:Creating GUI configuration options without leaving a redirect) |
||
| (4 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{Cleanup|Inaccurate information, dead links, relies on an add-on that is no longer available}} | |||
Making a GUI Config/Options dialog for your addon is always a bit tricky, however this HOWTO will hopefully help you in such an endeavor. Since a config dialog is usually added to an existing addon, this HOWTO will use an existing addon as an example, but we encourage you to use your own addon while following this HOWTO. | Making a GUI Config/Options dialog for your addon is always a bit tricky, however this HOWTO will hopefully help you in such an endeavor. Since a config dialog is usually added to an existing addon, this HOWTO will use an existing addon as an example, but we encourage you to use your own addon while following this HOWTO. | ||
| Line 34: | Line 36: | ||
;SavedVariables : Allow us to use a variable that is saved between game sessions, on a per-account basis. | ;SavedVariables : Allow us to use a variable that is saved between game sessions, on a per-account basis. | ||
;myClockIndicatorFrame.xml : Main addon frame | ;myClockIndicatorFrame.xml : Main addon frame | ||
;myClockConfigFrame.xml : | ;myClockConfigFrame.xml : Config addon frame | ||
== Load config from SavedVariables == | == Load config from SavedVariables == | ||
: '''Reference Material''' (optional reading) : [[Saving variables between game sessions]] | |||
Using the SavedVariable 'myClockConfig' we declared in the .toc file, we can now load and save our addon's configuration between game sessions. Remember that SavedVariable is per-account, not per-realm and not per-character, so we will need to use tables to store individual settings. | Using the SavedVariable 'myClockConfig' we declared in the .toc file, we can now load and save our addon's configuration between game sessions. Remember that SavedVariable is per-account, not per-realm and not per-character, so we will need to use tables to store individual settings. | ||
| Line 64: | Line 66: | ||
==== Globals ==== | ==== Globals ==== | ||
We need to: | We need to: | ||
| Line 470: | Line 471: | ||
Alternatively you could leave out the 'myClock_ConfigChange();' of this function, and add it to the Done button OnClick event to make a Save/Cancel dialog. Generally speaking for a config people want to see the changes happen live so they can tweak them. | Alternatively you could leave out the 'myClock_ConfigChange();' of this function, and add it to the Done button OnClick event to make a Save/Cancel dialog. Generally speaking for a config people want to see the changes happen live so they can tweak them. | ||
You're done! Hopefully this provided some concrete examples on how to make a config dialog, and much thanks to Scheid for being the ginipig! You could easily go from here to make a more complex configuration pane, using tabs, multiple pages, or even using Cosmos' Khaos (another howto someday). | You're done! Hopefully this provided some concrete examples on how to make a config dialog, and much thanks to Scheid for being the ginipig! You could easily go from here to make a more complex configuration pane, using tabs, multiple pages, or even using Cosmos' Khaos (another howto someday). | ||
[[Category:HOWTOs|Create GUI Config Options]] | [[Category:HOWTOs|Create GUI Config Options]] | ||