diff options
author | Ira Rice <irarice@gmail.com> | 2008-10-23 11:46:21 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2008-10-23 11:46:21 +0000 |
commit | 7a88c394584cb02cec8d1d7eb70ac2020e033d41 (patch) | |
tree | d19c75ea94072c9b54abb0c679a9bf6984b485c4 /src/gui/char_select.cpp | |
parent | e57f4ec64f53091dd254c2ee2db9592d30a5af0b (diff) | |
download | mana-7a88c394584cb02cec8d1d7eb70ac2020e033d41.tar.gz mana-7a88c394584cb02cec8d1d7eb70ac2020e033d41.tar.bz2 mana-7a88c394584cb02cec8d1d7eb70ac2020e033d41.tar.xz mana-7a88c394584cb02cec8d1d7eb70ac2020e033d41.zip |
Cleaned up ColorDB code so that it loads with all other databases, as
well as fixed color cycling.
Diffstat (limited to 'src/gui/char_select.cpp')
-rw-r--r-- | src/gui/char_select.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index 628ab35f..b83f98de 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -257,7 +257,6 @@ CharCreateDialog::CharCreateDialog(Window *parent, int slot, Network *network, mPlayer = new Player(0, 0, NULL); mPlayer->setGender(gender); - ColorDB::load(); int numberOfHairColors = ColorDB::size(); printf("%d\n", numberOfHairColors); @@ -344,16 +343,16 @@ CharCreateDialog::action(const gcn::ActionEvent &event) scheduleDelete(); } else if (event.getId() == "nextcolor") { - mPlayer->setHairStyle(-1, mPlayer->getHairColor() + 1); + mPlayer->setHairStyle(mPlayer->getHairStyle(), (mPlayer->getHairColor() + 1) % numberOfColors); } else if (event.getId() == "prevcolor") { - mPlayer->setHairStyle(-1, mPlayer->getHairColor() + numberOfColors - 1); + mPlayer->setHairStyle(mPlayer->getHairStyle(), (mPlayer->getHairColor() + numberOfColors - 1) % numberOfColors); } else if (event.getId() == "nextstyle") { - mPlayer->setHairStyle(mPlayer->getHairStyle() + 1, -1); + mPlayer->setHairStyle(mPlayer->getHairStyle() + 1, mPlayer->getHairColor()); } else if (event.getId() == "prevstyle") { - mPlayer->setHairStyle(mPlayer->getHairStyle() + NR_HAIR_STYLES - 1, -1); + mPlayer->setHairStyle(mPlayer->getHairStyle() + NR_HAIR_STYLES - 1, mPlayer->getHairColor()); } } |