diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-01-18 19:20:34 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-02-02 15:31:41 +0100 |
commit | f5de9ae444f1bca1f6ba6969214e9a8cacb15f68 (patch) | |
tree | f9b9c699c52d279cdc4d93b09f48dd3b24403f5b /src/net/manaserv | |
parent | 7cc504d993fa948ae2e10848993f4552b2d6daaa (diff) | |
download | mana-f5de9ae444f1bca1f6ba6969214e9a8cacb15f68.tar.gz mana-f5de9ae444f1bca1f6ba6969214e9a8cacb15f68.tar.bz2 mana-f5de9ae444f1bca1f6ba6969214e9a8cacb15f68.tar.xz mana-f5de9ae444f1bca1f6ba6969214e9a8cacb15f68.zip |
Fix to the hair colors and styles handling.
- I made the charCreatedialog handle a possible
max permitted color Id and a minimum hair style id for tA.
- Added a foundation to later load the styles and colors from
the same file, to handle the Mana-issue #224 for manaserv.
- Support for non-contiguous hair color and style ids
has also been added.
- I also replaced the < and > arrow signs with images.
Reviewed-by: Ben Longbons, Thorbjørn Lindeijer
Diffstat (limited to 'src/net/manaserv')
-rw-r--r-- | src/net/manaserv/beinghandler.cpp | 6 | ||||
-rw-r--r-- | src/net/manaserv/charhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/manaserv/charhandler.h | 8 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp index be4daa49..fb3a3644 100644 --- a/src/net/manaserv/beinghandler.cpp +++ b/src/net/manaserv/beinghandler.cpp @@ -144,7 +144,8 @@ void BeingHandler::handleBeingEnterMessage(Net::MessageIn &msg) being->setName(name); } int hs = msg.readInt8(), hc = msg.readInt8(); - being->setSprite(SPRITE_LAYER_HAIR, hs * -1, HairDB::get(hc)); + being->setSprite(SPRITE_LAYER_HAIR, hs * -1, + hairDB.getHairColor(hc)); being->setGender(msg.readInt8() == ManaServ::GENDER_MALE ? ::GENDER_MALE : ::GENDER_FEMALE); handleLooks(being, msg); @@ -334,7 +335,8 @@ void BeingHandler::handleBeingLooksChangeMessage(Net::MessageIn &msg) { int style = msg.readInt16(); int color = msg.readInt16(); - being->setSprite(SPRITE_LAYER_HAIR, style * -1, HairDB::get(color)); + being->setSprite(SPRITE_LAYER_HAIR, style * -1, + hairDB.getHairColor(color)); } } diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp index 4c4c9475..c05e9320 100644 --- a/src/net/manaserv/charhandler.cpp +++ b/src/net/manaserv/charhandler.cpp @@ -392,7 +392,7 @@ void CharHandler::updateCharacters() player->setName(info.name); player->setGender(info.gender); player->setSprite(SPRITE_LAYER_HAIR, info.hairStyle * -1, - HairDB::get(info.hairColor)); + hairDB.getHairColor(info.hairColor)); character->data.mAttributes[LEVEL] = info.level; character->data.mAttributes[CHAR_POINTS] = info.characterPoints; character->data.mAttributes[CORR_POINTS] = info.correctionPoints; diff --git a/src/net/manaserv/charhandler.h b/src/net/manaserv/charhandler.h index fef9627b..e3098c09 100644 --- a/src/net/manaserv/charhandler.h +++ b/src/net/manaserv/charhandler.h @@ -73,6 +73,14 @@ class CharHandler : public MessageHandler, public Net::CharHandler unsigned int maxSprite() const; + // No limitation on Manaserv + int getCharCreateMaxHairColorId() const + { return 0; } + + // No limitation on Manaserv + int getCharCreateMaxHairStyleId() const + { return 0; } + void clear(); private: |