From The Mana World
(→‎Discussion: respond)
m (Move page script moved page Dev:Color XML to Development:Color XML: Rename Dev: to Development: so the miraheze import works)
 
(4 intermediate revisions by one other user not shown)
Line 32: Line 32:


When the server sends a dyed item, it also sends the color id to use. The client adds the color name to the item name (turning "Cotton Shirt" to "Red Cotton Shirt" for a color named "Red").
When the server sends a dyed item, it also sends the color id to use. 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.
==Examples==
I've made some examples based on the colors in the client code and item databases:
*[[User:Jaxad0127/Color files/Hair colors|Hair colors]]
*[[User:Jaxad0127/Color files/Pants colors|Pants colors]]
*[[User:Jaxad0127/Color files/Shirt colors|Shirt colors]]
*[[User:Jaxad0127/Color files/Skirt colors|Skirt colors]]
== Discussion ==
''Wouldn't it make sense rather to have one color file, making all color IDs global? I don't see why you would restrict one set of colors to only one item, and having it global would save a lot of typing and maintenance. Also, what about internationalisation?'' --[[User:Bjørn|Bjørn]] 21:22, 4 September 2008 (CEST)
:One file is possible, yes. But with all the duplicate names in clothing, I thought it would be easier this way. For internationalization, I'll use the same system the DBs use, once it's figured out :). &mdash; [[User:Jaxad0127|<span style="color: #160196">Jaxad</span>]][[User Talk:Jaxad0127|<span style="color: #5B038F">0127</span>]] 01:25, 5 September 2008 (CEST)

Latest revision as of 03:56, 27 March 2024

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. Colors have ids, names, and values. 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 id to use. The client adds the color name to the item name (turning "Cotton Shirt" to "Red Cotton Shirt" for a color named "Red").