diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-26 16:01:24 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-26 16:01:24 +0000 |
commit | ef4486580fc7b8293555fcabc398ed0c2b90d78e (patch) | |
tree | 41312f2ab68ceaa95ca0cc235f6b612c790bb90e /src/gui | |
parent | 5cc5c903df7b535c6bf27987b89a405812d89735 (diff) | |
download | mana-ef4486580fc7b8293555fcabc398ed0c2b90d78e.tar.gz mana-ef4486580fc7b8293555fcabc398ed0c2b90d78e.tar.bz2 mana-ef4486580fc7b8293555fcabc398ed0c2b90d78e.tar.xz mana-ef4486580fc7b8293555fcabc398ed0c2b90d78e.zip |
Got rid of numerous additions and substractions to the hair style and color.
Hair style 0 was added and defined as being bald (so bald is no longer a
hardcoded style).
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/char_select.cpp | 11 | ||||
-rw-r--r-- | src/gui/playerbox.cpp | 5 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index 2fa6c68e..3db82287 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -183,8 +183,8 @@ void CharSelectDialog::updatePlayerInfo() mDelCharButton->setEnabled(true); mSelectButton->setEnabled(true); } - mPlayerBox->mHairStyle = pi->getHairStyle() - 1; - mPlayerBox->mHairColor = pi->getHairColor() - 1; + mPlayerBox->mHairStyle = pi->getHairStyle(); + mPlayerBox->mHairColor = pi->getHairColor(); mPlayerBox->mSex = pi->getSex(); mPlayerBox->mShowPlayer = true; } else { @@ -324,11 +324,10 @@ std::string CharCreateDialog::getName() void CharCreateDialog::attemptCharCreate() { // Send character infos - MessageOut outMsg; - outMsg.writeShort(PAMSG_CHAR_CREATE); + MessageOut outMsg(PAMSG_CHAR_CREATE); outMsg.writeString(getName()); - outMsg.writeByte(mPlayerBox->mHairStyle + 1); - outMsg.writeByte(mPlayerBox->mHairColor + 1); + outMsg.writeByte(mPlayerBox->mHairStyle); + outMsg.writeByte(mPlayerBox->mHairColor); // TODO: send selected sex outMsg.writeByte(0); // Player sex outMsg.writeShort(10); // STR diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp index d8faff99..ba97d54c 100644 --- a/src/gui/playerbox.cpp +++ b/src/gui/playerbox.cpp @@ -94,12 +94,13 @@ void PlayerBox::draw(gcn::Graphics *graphics) playerset[mSex]->get(0), 23, 12); // Draw his hair - if (mHairColor < NR_HAIR_COLORS && mHairStyle < NR_HAIR_STYLES) + if (mHairStyle > 0 && mHairColor < NR_HAIR_COLORS && + mHairStyle < NR_HAIR_STYLES) { int hf = 9 * mHairColor; if (hf >= 0 && hf < (int)hairset[mHairStyle]->size()) { dynamic_cast<Graphics*>(graphics)->drawImage( - hairset[mHairStyle]->get(hf), 35, 7); + hairset[mHairStyle - 1]->get(hf), 35, 7); } } } |