m (→Item Database: Add item name changing) |
(→<color>: Add id attribute) |
||
Line 8: | Line 8: | ||
===<color>=== | ===<color>=== | ||
And individual color. <code>Color</code>s have <code>name</code>s and <code>value</code>s. The <code>name</code> is a description for the user. The <code>value</code> is the information used by the code. Example (these are the current hair colors): | And individual color. <code>Color</code>s have <code>id</code>s, <code>name</code>s, and <code>value</code>s. The <code>id</code> is the value used to identify the color. The <code>name</code> is a description for the user. The <code>value</code> is the information used by the code. Example (these are the current hair colors): | ||
<code> | <code> | ||
<colors> | <colors> | ||
<color name="Light Red" value="#8c4b41,da9041,ffffff"/> | <color id="0" name="Light Red" value="#8c4b41,da9041,ffffff"/> | ||
<color name="Green" value="#06372b,489e25,fdedcc"/> | <color id="1" name="Green" value="#06372b,489e25,fdedcc"/> | ||
<color name="Red" value="#5f0b33,91191c,f9ad81"/> | <color id="2" name="Red" value="#5f0b33,91191c,f9ad81"/> | ||
... | ... | ||
</colors> | </colors> |
Revision as of 13:59, 14 August 2008
Color files are files that specify colors that can be used for various purposes. The colors specified in these files are suited for use in Image dyeing and other purposes.
Structure
Color files are in XML format.
<colors>
This is the root element of the file.
<color>
And individual color. Color
s have id
s, name
s, and value
s. The id
is the value used to identify the color. The name
is a description for the user. The value
is the information used by the code. Example (these are the current hair colors):
<colors>
<color id="0" name="Light Red" value="#8c4b41,da9041,ffffff"/>
<color id="1" name="Green" value="#06372b,489e25,fdedcc"/>
<color id="2" name="Red" value="#5f0b33,91191c,f9ad81"/>
...
</colors>
Usage
Item Database
In the item database, item elements reference the color files. Example:
<item id="-1" type="hairsprite" colors="colors_hairstyles.xml">
<sprite gender="male">hairstyle1-male.xml</sprite>
<sprite gender="female">hairstyle1-female.xml</sprite>
</item>
When the server sends a dyed item, it also sends the color index to use. The first entry is number one. Undyed items use index 0. The client adds the color name to the item name (turning "Cotton Shirt" to "Red Cotton Shirt" for a color named "Red").
Others
I cannot think of other uses for these files at the moment.