WoW:Creating GUI configuration options: Difference between revisions

m
Move page script moved page Creating GUI configuration options to WoW:Creating GUI configuration options without leaving a redirect
m (Move page script moved page Creating GUI configuration options to WoW:Creating GUI configuration options without leaving a redirect)
 
(3 intermediate revisions by 3 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 37: Line 39:


== Load config from SavedVariables ==
== Load config from SavedVariables ==
;Reference Material (optional reading) : [[HOWTO: Save Variables Between Game Sessions]]
: '''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 ====
;Reference Material (optional reading) : [[HOWTO: Get Player and Realm Name At Load Time]]


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]]
Anonymous user