WoW:User interface customization guide (source)
Revision as of 16:21, 11 August 2008
, 11 August 2008small fixes
m (catfix) |
(small fixes) |
||
| Line 5: | Line 5: | ||
{{stub/Accuracy}} | {{stub/Accuracy}} | ||
The '''User interface customization guide''' is based on slouken's post on the official beta UI forums ''(a long, long time ago)''. | |||
== World of Warcraft Interface Customization Guide == | == World of Warcraft Interface Customization Guide == | ||
| Line 18: | Line 17: | ||
Before you report a bug in the interface, move your custom interface directory out of the way, to make sure the bug occurs in the unmodified game. | Before you report a bug in the interface, move your custom interface directory out of the way, to make sure the bug occurs in the unmodified game. | ||
== XML Layout == | == XML Layout == | ||
The files containing the layout for the game user interface can be found in Interface\FrameXML | The files containing the layout for the game user interface can be found in Interface\FrameXML | ||
The file "FrameXML.toc" contains a list of XML files to load when you enter the game. The files listed are loaded in order. Any errors that occur when loading the files are written to FrameXML.log in the toplevel directory. | The file "FrameXML.toc" contains a list of XML files to load when you enter the game. The files listed are loaded in order. Any errors that occur when loading the files are written to FrameXML.log in the toplevel directory. | ||
| Line 28: | Line 25: | ||
Lots more details here: [[XML User Interface]] | Lots more details here: [[XML User Interface]] | ||
== Lua Scripting == | == Lua Scripting == | ||
All of the functionality in the interface is provided through Lua scripting. | |||
The manual for Lua 5.1.2 is available online at: http://www.lua.org | |||
The manual for Lua 5.1.2 is available online | |||
See the Reference manual at: http://www.lua.org/manual/5.1 | |||
http://lua | |||
For more concise help, topic-specific Lua tutorials can be found at: http://lua-users.org/wiki/TutorialDirectory | |||
The best way to become familiar with the way Lua is used to script the interface is to look at the scripts in the XML files, denoted by the <script> tag, and to browse the lua files. The lua files typically contain functions which are used by the corresponding XML files. | The best way to become familiar with the way Lua is used to script the interface is to look at the scripts in the XML files, denoted by the <script> tag, and to browse the lua files. The lua files typically contain functions which are used by the corresponding XML files. | ||
== Getting Started == | == Getting Started == | ||
A good place to start getting familiar with the interface is the file BasicControls.xml | A good place to start getting familiar with the interface is the file BasicControls.xml | ||
| Line 54: | Line 47: | ||
At the end of the file we define an actual frame called "ScriptErrors" which inherits the dialog box we defined previously. This is the frame which is shown in the message function at the top of the file. | At the end of the file we define an actual frame called "ScriptErrors" which inherits the dialog box we defined previously. This is the frame which is shown in the message function at the top of the file. | ||
== How Does It Work? == | == How Does It Work? == | ||
The very first frame that is created is the WorldFrame. This frame is required, and is where the game world renders. The next frame that is created is the UIParent frame. This frame manages all the rest of the user interface, and allows it to be hidden separately from the world. This is how we get screenshots without the interface visible. :) | The very first frame that is created is the WorldFrame. This frame is required, and is where the game world renders. The next frame that is created is the UIParent frame. This frame manages all the rest of the user interface, and allows it to be hidden separately from the world. This is how we get screenshots without the interface visible. :) | ||
| Line 67: | Line 58: | ||
Having the UI respond to events wouldn't be very useful if the interface couldn't affect the game in return. The game provides a wide array of functions to query information and change game state. Examples of using these functions are throughout the provided lua files. | Having the UI respond to events wouldn't be very useful if the interface couldn't affect the game in return. The game provides a wide array of functions to query information and change game state. Examples of using these functions are throughout the provided lua files. | ||
== Tips and Tricks == | == Tips and Tricks == | ||
World of Warcraft supports dynamically '''reloading the user interface'''. At any time you can modify the XML and Lua files, and then reload them by either typing: | |||
World of Warcraft supports dynamically '''reloading the user interface | |||
* /console reloadui | * /console reloadui | ||
| Line 78: | Line 67: | ||
If you are using Cosmos, you can use the shorcut /rl | If you are using Cosmos, you can use the shorcut /rl | ||
If you | If you are not sure what is happening in the script, use the '''message() function to print a message and view variables'''. Once the dialog is shown, your script keeps on executing, but no other message() calls will show anything until you click the button to dismiss the dialog. | ||
Feel free to experiment. If you break something, starting fresh is really easy. If you have questions, look on the forums to see if other people have already figured out the answers. Occasionally, Blizzard staff will be available to answer scripting questions — we value your feedback! | |||
== Conclusion == | == Conclusion == | ||
The interface files are provided for your enjoyment, and are not supported in any way. That said, we hope that World of Warcraft provides a robust and flexible system for custom interfaces. | The interface files are provided for your enjoyment, and are not supported in any way. That said, we hope that World of Warcraft provides a robust and flexible system for custom interfaces. | ||
See also: | |||
*[[UI Questions]] | *[[UI Questions]] | ||
*[[Interface Customization]] | *[[Interface Customization]] | ||
[[Category:Interface customization]] | [[Category:Interface customization]] | ||