summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorFate <fate.tmw@googlemail.com>2008-11-01 23:45:48 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-13 16:06:17 +0100
commitba02a23b63bf0a1fde2194d163ead365d2a4fdf0 (patch)
tree3fbaa733e43b270395b20418f71211b9a5b1fed2 /src/player.cpp
parent16106cae769f485908c15ac39d0e017167099a48 (diff)
downloadmana-ba02a23b63bf0a1fde2194d163ead365d2a4fdf0.tar.gz
mana-ba02a23b63bf0a1fde2194d163ead365d2a4fdf0.tar.bz2
mana-ba02a23b63bf0a1fde2194d163ead365d2a4fdf0.tar.xz
mana-ba02a23b63bf0a1fde2194d163ead365d2a4fdf0.zip
* Use hair.xml to determine hair colours (#514)
* Auto-detect number of hair styles available (#514) Conflicts: ChangeLog src/being.cpp src/being.h src/gui/char_select.cpp (cherry picked from eAthena client)
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/player.cpp b/src/player.cpp
index e24a2d8c..19486d6e 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -85,27 +85,13 @@ void Player::setGender(Gender gender)
void Player::setHairStyle(int style, int color)
{
- style = style < 0 ? mHairStyle : style % NR_HAIR_STYLES;
- color = color < 0 ? mHairColor : color % NR_HAIR_COLORS;
+ style = style < 0 ? mHairStyle : style % getHairStylesNr();
+ color = color < 0 ? mHairColor : color % getHairColorsNr();
if (style == mHairStyle && color == mHairColor) return;
Being::setHairStyle(style, color);
- static char const *const colors[NR_HAIR_COLORS] =
- {
- "#8c4b41,da9041,ffffff", // light brown
- "#06372b,489e25,fdedcc", // green
- "#5f0b33,91191c,f9ad81", // red
- "#602486,934cc3,fdc689", // purple
- "#805e74,c6b09b,ffffff", // gray
- "#8c6625,dab425,ffffff", // yellow
- "#1d2d6d,1594a3,fdedcc", // blue
- "#831f2d,be4f2d,f8cc8b", // brown
- "#432482,584bbc,dae8e5", // light blue
- "#460850,611967,e7b4ae", // dark purple
- };
-
- setSprite(HAIR_SPRITE, style * -1, colors[color]);
+ setSprite(HAIR_SPRITE, style * -1, getHairColor(color));
setAction(mAction);
}
@@ -194,3 +180,5 @@ void Player::setInParty(bool value)
{
mInParty = value;
}
+
+