WoW:User interface customization guide: Difference between revisions

m
no edit summary
mNo edit summary
Line 1: Line 1:
{{stub/Accuracy}}
{{ambox
|border=red
|type='''Much of the information in this article is badly out of date.'''
|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).}}
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. These files make a great reference for examples of algorithms, syntax, using the game API and much more.
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.


A quick reminder: when developing add-ons you may often encounter bugs that you just can't figure out. Before reporting a bug in the game UI, disable all add-ons and verify that the bug is present in the unmodified gameMaybe it is Blizzard's bug, but there's an even better chance that the bug is yours or another add-on you're running during your development.
The Blizzard Interface Tutorial is where you start.  After you complete the tutorials, you should have enough knowledge to create a basic addonFrom 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());
This will print your client locale into the default chat window ("enUS" for English clients, "deDE" for German clients, etc).
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 ==
Anonymous user