WoW:User interface customization guide (source)
Revision as of 23:58, 3 December 2009
, 3 December 2009no edit summary
mNo edit summary |
|||
| Line 1: | Line 1: | ||
This '''user interface customization guide''' is based upon [[slouken]]'s post on the official Beta UI forums ''(a long time ago in a galaxy far, far away)''. | This '''user interface customization guide''' is based upon [[slouken]]'s post on the official Beta UI forums ''(a long time ago in a galaxy far, far away)''. | ||
| Line 21: | Line 15: | ||
The art folder contains all of the graphics used in the built-in UI. They are generally [[BLP_files|BLP files]], which are a simple container DirectX-formatted texture data. The [[BLP_files|BLP files]] page lists several tools for converting between BLP and other image formats. | The art folder contains all of the graphics used in the built-in UI. They are generally [[BLP_files|BLP files]], which are a simple container DirectX-formatted texture data. The [[BLP_files|BLP files]] page lists several tools for converting between BLP and other image formats. | ||
The data folder contains all of the [[Lua]] and [[XML]] files which are used to describe and program the UI. | The data folder contains all of the [[Lua]] and [[XML]] files which are used to describe and program the UI. Editing these files will not do anything - they are there to show you how the Blizzard UI works, and a reference for examples of algorithms, syntax, using the game API and much more. | ||
The Blizzard Interface Tutorial is where you start. After you complete the tutorials, you should have enough knowledge to create a basic addon. From your addon, you can make whatever changes to the Blizzard UI that you want. | |||
== XML layout == | == XML layout == | ||
| Line 47: | Line 41: | ||
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''. When you want to figure something out, this is the first page you should turn to. 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 type this into the game chat: | ||
/run print(GetLocale()); | /run print(GetLocale()); | ||
GetLocale() is an API function. It returns the client locale ("enUS" for English clients, "deDE" for German clients, etc). Print() then prints that value into the default chat window. | |||
Your addons are loaded after the Blizzard files, so your addon can overwrite or change any Blizzard UI. For example, you could create an addon with one line of code: | |||
MailFrame:Show() | |||
MailFrame is the name of a Blizzard Frame, created in Blizzard Interface Data/FrameXML/MailFrame.xml. Anyframe:Show() will make that frame appear, even if you are nowhere near a mailbox. Type /run MailFrame:Show() in game to accomplish the same thing. | |||
== Getting started == | == Getting started == | ||