WoW:User interface customization guide: Difference between revisions

m
WW:MOS
(Typo fixing, typos fixed: german → German, english → English using AWB)
m (WW:MOS)
Line 1: Line 1:
{{stub/Accuracy}}
{{ambox
{{ambox
|border=red
|border=red
Line 4: Line 5:
|info=*For one, you no longer need to modify FrameXML in order to add code to WoW (yes, that's how badly out of date it is).}}
|info=*For one, you no longer need to modify FrameXML in order to add code to WoW (yes, that's how badly out of date it is).}}


{{stub/Accuracy}}
This '''user interface customization guide''' is based on slouken's post on the official Beta UI forums ''(a long time ago in a galaxy far, far away)''.
 
The '''User interface customization guide''' is based on slouken's post on the official beta UI forums ''(a long time ago in a galaxy far, far away)''.


== World of Warcraft Interface Customization Guide ==
== World of Warcraft User Interface Customization Guide ==
The interface of World of Warcraft is built from XML files, which describe the look and layout, and lua files, which contain scripting functionality. This document is a short introduction into modifying these files to customize your interface. Customizing the interface is a very technical endeavor, and you should not attempt it unless you have a good working knowledge of XML and Lua.  
The interface of ''World of Warcraft'' is built from XML files, which describe the look and layout, and lua files, which contain scripting functionality. This document is a short introduction into modifying these files to customize your interface. Customizing the interface is a very technical endeavor, and you should not attempt it unless you have a good working knowledge of XML and Lua.  


There is no official support for modifying the WoW interface. If you break it, you get to keep both pieces. =)
No official support exists for modifying the WoW interface. If you break it, you get to keep both pieces. =)


To start fresh, download the [http://us.blizzard.com/support/article.xml?articleId=21466 "User Interface Customization Tool"] and extract both Data & Art. This creates a new directory called "Interface". This directory will override any built-in user interface. To remove all customized UI, just remove the Interface directory. Be sure that you never remove the Interface directory in Data\, only remove the top level Interface directory the tool created for you. For example, if you installed WoW to the default directory on Windows 2000/XP, you'll need to delete the "Interface" folder located in ''C:\Program Files\World of Warcraft\''.
To start fresh, download the [http://us.blizzard.com/support/article.xml?articleId=21466 "User Interface Customization Tool"] and extract both Data & Art. This creates a new directory called "Interface". This directory will override any built-in user interface. To remove all customized UI, just remove the Interface directory. Be sure that you never remove the Interface directory in Data\, only remove the top level Interface directory the tool created for you. For example, if you installed WoW to the default directory on Windows 2000/XP, you'll need to delete the "Interface" folder located in ''C:\Program Files\World of Warcraft\''.
Line 36: Line 35:
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.


As a reference, the [[World of Warcraft API]] page contains a (almost) complete list of available API functions in World of Warcraft. Also the [[Widget API]] page contains an overview of the methods that are available when dealing with objects of the user interface - like action buttons or unit frames. Feel free to play around with the <tt>print()</tt> function to try out the various API functions.
As a reference, the [[World of Warcraft API]] page contains a (almost) complete list of available API functions in ''World of Warcraft''. Also the [[Widget API]] page contains an overview of the methods that are available when dealing with objects of the user interface like action buttons or unit frames. Feel free to play around with the <tt>print()</tt> function to try out the various API functions.


For example:
For example:
Line 60: Line 59:
Each frame has a set of script handlers which are called under certain conditions. For example, UIParent has OnLoad, which is called immediately after the frame is loaded, OnEvent, which we'll get to later, OnUpdate, which is called every time the world is updated, and OnShow, which is called whenever the frame is shown.  
Each frame has a set of script handlers which are called under certain conditions. For example, UIParent has OnLoad, which is called immediately after the frame is loaded, OnEvent, which we'll get to later, OnUpdate, which is called every time the world is updated, and OnShow, which is called whenever the frame is shown.  


The OnEvent handler is special. This is the handler that allows the game to communicate with the interface. World of Warcraft is designed so that it needs to know very little about the interface. Instead of calling directly into the interface, whenever something interesting happens, it generates an event. Each frame registers for events that it is interested in, and when those events happen, the OnEvent handler is called for that frame.  
The OnEvent handler is special. This is the handler that allows the game to communicate with the interface. ''World of Warcraft'' is designed so that it needs to know very little about the interface. Instead of calling directly into the interface, whenever something interesting happens, it generates an event. Each frame registers for events that it is interested in, and when those events happen, the OnEvent handler is called for that frame.  


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'''. At any time, you can modify the XML and Lua files and then reload them by either typing:


* /console reloadui
* /console reloadui
Line 84: Line 83:


== 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.




Anonymous user