WoW:Setting up Visual Studio for WoW XML: Difference between revisions
No edit summary |
m (Move page script moved page Setting up Visual Studio for WoW XML to Setting up Visual Studio for WoW XML without leaving a redirect) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{wow/uihowto}} | |||
Microsoft Visual Studio comes with an excellent XML editor. By far, the most useful feature is that it can read an [[Wikipedia:XSD|XSD]] file and know exactly how your XML is supposed to be structured (the only other XML editor I know of that can do this will set you back $500). This means that, for the most part, you don't have to memorize tag names, what tags can go where, attribute names, and in many circumstances, attribute values. As soon as you type the opening bracket, it will provide you with a drop-down list of all available tags that are legal given your current position in the code. Once you select a tag and hit space, you'll be presented with a list of all possible attributes for the tag. Select one, and if it's not a free-form value (like name, or val) it will present you with a list of all possible choices. | Microsoft Visual Studio comes with an excellent XML editor. By far, the most useful feature is that it can read an [[Wikipedia:XSD|XSD]] file and know exactly how your XML is supposed to be structured (the only other XML editor I know of that can do this will set you back $500). This means that, for the most part, you don't have to memorize tag names, what tags can go where, attribute names, and in many circumstances, attribute values. As soon as you type the opening bracket, it will provide you with a drop-down list of all available tags that are legal given your current position in the code. Once you select a tag and hit space, you'll be presented with a list of all possible attributes for the tag. Select one, and if it's not a free-form value (like name, or val) it will present you with a list of all possible choices. | ||
Line 13: | Line 14: | ||
== Visual Studio == | == Visual Studio == | ||
Chances are, you don't just have a copy of Visual Studio hanging around for your coding pleasure. Thankfully, Microsoft has released parts of VS for free. The Microsoft Visual Studio Express Editions are simplified copies of the most popular components: C++, C#, Visual Basic, SQL Server, & Visual Web Developer. [http://www.microsoft.com/express/ Download] and install whichever component you think you might get some use out of since all we're really after here is the basic editor environment. | Chances are, you don't just have a copy of Visual Studio hanging around for your coding pleasure. Thankfully, Microsoft has released parts of VS for free. The Microsoft Visual Studio Express Editions are simplified copies of the most popular components: C++, C#, Visual Basic, SQL Server, & Visual Web Developer. [http://www.microsoft.com/express/ Download] and install whichever component you think you might get some use out of since all we're really after here is the basic editor environment. If you are a student, you can also get full versions of Visual Studio from [http://www.dreamspark.com/ Dreamspark], a Microsoft portal for academic software. | ||
Be sure to set up VS as your default XML editor. For Windows XP the easiest way to do this is to right-click on any XML file, click Open With...->Choose Program, select Microsoft Visual Studio from the list (the name may be different depending on the edition you select), check Always use the selected program, and hit OK. | Be sure to set up VS as your default XML editor. For Windows XP the easiest way to do this is to right-click on any XML file, click Open With...->Choose Program, select Microsoft Visual Studio from the list (the name may be different depending on the edition you select), check Always use the selected program, and hit OK. | ||
Line 24: | Line 25: | ||
http://wowprogramming.com/FrameXML/UI.xsd"></nowiki> | http://wowprogramming.com/FrameXML/UI.xsd"></nowiki> | ||
This will pull the schema from the [http://wowprogramming.com WoWProgramming website]. If you'd rather use a local copy, you can either download [http://wowprogramming.com/FrameXML/UI.xsd that file], or extract it using [[ | This will pull the schema from the [http://wowprogramming.com WoWProgramming website]. If you'd rather use a local copy, you can either download [http://wowprogramming.com/FrameXML/UI.xsd that file], or extract it using [[Viewing Blizzard's WoW user interface code|Blizzard's UI extractor]]. Then change the location in your Ui tag from <nowiki>http://wowprogramming.com/FrameXML/UI.xsd</nowiki> to the location of the file you downloaded (e.g. "C:/Program Files/World of Warcraft/Blizzard Interface Data (enUS)/FrameXML/UI.xsd") | ||
That's all there is to it! | That's all there is to it! | ||
[[Category: | == See also == | ||
* [[w:c:addonstudio:AddOn Studio for World of Warcraft (current)|AddOn Studio for World of Warcraft]] | |||
[[Category:Visual Studio]] |
Latest revision as of 04:48, 15 August 2023
← HOWTOs
Microsoft Visual Studio comes with an excellent XML editor. By far, the most useful feature is that it can read an XSD file and know exactly how your XML is supposed to be structured (the only other XML editor I know of that can do this will set you back $500). This means that, for the most part, you don't have to memorize tag names, what tags can go where, attribute names, and in many circumstances, attribute values. As soon as you type the opening bracket, it will provide you with a drop-down list of all available tags that are legal given your current position in the code. Once you select a tag and hit space, you'll be presented with a list of all possible attributes for the tag. Select one, and if it's not a free-form value (like name, or val) it will present you with a list of all possible choices.
Not only does this save time, but it can also be a great learning tool. For instance, I accidentally found out that a lot of common structures can be simplified:
<Size> <AbsDimension x="320" y="200"/> </Size>
can written simply as:
<Size x="320" y="200"/>
Visual Studio[edit]
Chances are, you don't just have a copy of Visual Studio hanging around for your coding pleasure. Thankfully, Microsoft has released parts of VS for free. The Microsoft Visual Studio Express Editions are simplified copies of the most popular components: C++, C#, Visual Basic, SQL Server, & Visual Web Developer. Download and install whichever component you think you might get some use out of since all we're really after here is the basic editor environment. If you are a student, you can also get full versions of Visual Studio from Dreamspark, a Microsoft portal for academic software.
Be sure to set up VS as your default XML editor. For Windows XP the easiest way to do this is to right-click on any XML file, click Open With...->Choose Program, select Microsoft Visual Studio from the list (the name may be different depending on the edition you select), check Always use the selected program, and hit OK.
The Ui Tag[edit]
Now you need to change the Ui tag in your XML files to point to the XML schema. The simplest way to do this is to use the following tag:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ http://wowprogramming.com/FrameXML/UI.xsd">
This will pull the schema from the WoWProgramming website. If you'd rather use a local copy, you can either download that file, or extract it using Blizzard's UI extractor. Then change the location in your Ui tag from http://wowprogramming.com/FrameXML/UI.xsd to the location of the file you downloaded (e.g. "C:/Program Files/World of Warcraft/Blizzard Interface Data (enUS)/FrameXML/UI.xsd")
That's all there is to it!