diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-11-03 09:58:25 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-11-03 09:58:25 +0000 |
commit | 8a60e11684e84807f3526b37afa8cbf6f103b8fd (patch) | |
tree | 202058890ef2f8f2c5e9873acbb6f59327b28762 /src/gui | |
parent | 8a0e94b31be13ef9c52b281c32095279d7fa1ca7 (diff) | |
download | mana-client-8a60e11684e84807f3526b37afa8cbf6f103b8fd.tar.gz mana-client-8a60e11684e84807f3526b37afa8cbf6f103b8fd.tar.bz2 mana-client-8a60e11684e84807f3526b37afa8cbf6f103b8fd.tar.xz mana-client-8a60e11684e84807f3526b37afa8cbf6f103b8fd.zip |
Fixed double load of hair graphics.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/char_select.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index c2306880..ccdf20c8 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -245,8 +245,7 @@ CharCreateDialog::CharCreateDialog(Window *parent, int slot): Window(_("Create Character"), true, parent), mSlot(slot) { mPlayer = new Player(0, 0, NULL); - mPlayer->setHairStyle(rand() % NR_HAIR_STYLES); - mPlayer->setHairColor(rand() % NR_HAIR_COLORS); + mPlayer->setHairStyle(rand() % NR_HAIR_STYLES, rand() % NR_HAIR_COLORS); mNameField = new TextField(""); mNameLabel = new gcn::Label(_("Name:")); @@ -373,18 +372,16 @@ CharCreateDialog::action(const gcn::ActionEvent &event) scheduleDelete(); } else if (event.getId() == "nextcolor") { - mPlayer->setHairColor((mPlayer->getHairColor() + 1) % NR_HAIR_COLORS); + mPlayer->setHairStyle(-1, mPlayer->getHairColor() + 1); } else if (event.getId() == "prevcolor") { - int prevColor = mPlayer->getHairColor() + NR_HAIR_COLORS - 1; - mPlayer->setHairColor(prevColor % NR_HAIR_COLORS); + mPlayer->setHairStyle(-1, mPlayer->getHairColor() + NR_HAIR_COLORS - 1); } else if (event.getId() == "nextstyle") { - mPlayer->setHairStyle((mPlayer->getHairStyle() + 1) % NR_HAIR_STYLES); + mPlayer->setHairStyle(mPlayer->getHairStyle() + 1, -1); } else if (event.getId() == "prevstyle") { - int prevStyle = mPlayer->getHairStyle() + NR_HAIR_STYLES - 1; - mPlayer->setHairStyle(prevStyle % NR_HAIR_STYLES); + mPlayer->setHairStyle(mPlayer->getHairStyle() + NR_HAIR_STYLES - 1, -1); } else if (event.getId() == "statslider") { UpdateSliders(); |