diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-03-19 20:43:10 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-03-19 20:43:10 +0000 |
commit | 654d24e74c56d240b8d622840c135e22a029636d (patch) | |
tree | 5eb8b94f7832bdbb6d21c7ded6e6da6b5f8f3464 /src/gui/char_select.cpp | |
parent | 3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (diff) | |
download | mana-654d24e74c56d240b8d622840c135e22a029636d.tar.gz mana-654d24e74c56d240b8d622840c135e22a029636d.tar.bz2 mana-654d24e74c56d240b8d622840c135e22a029636d.tar.xz mana-654d24e74c56d240b8d622840c135e22a029636d.zip |
Unreverted latest change by Doener due to my lack of proper communication abilities.
Diffstat (limited to 'src/gui/char_select.cpp')
-rw-r--r-- | src/gui/char_select.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index b1d08951..40c1d145 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -23,7 +23,6 @@ #include "char_select.h" -#include <sstream> #include <string> #include <guichan/widgets/label.hpp> @@ -40,6 +39,8 @@ #include "../net/messageout.h" +#include "./utils/tostring.h" + /** * Listener for confirming character deletion. */ @@ -69,7 +70,8 @@ void CharDeleteConfirm::action(const std::string &eventId) } CharSelectDialog::CharSelectDialog(Network *network, LockedArray<LocalPlayer*> *charInfo): - Window("Select Character"), mNetwork(network), mCharInfo(charInfo), mCharSelected(false) + Window("Select Character"), mNetwork(network), + mCharInfo(charInfo), mCharSelected(false) { mSelectButton = new Button("Ok", "ok", this); mCancelButton = new Button("Cancel", "cancel", this); @@ -171,17 +173,10 @@ void CharSelectDialog::updatePlayerInfo() LocalPlayer *pi = mCharInfo->getEntry(); if (pi) { - std::stringstream nameCaption, levelCaption, jobCaption, moneyCaption; - - nameCaption << pi->getName(); - levelCaption << "Lvl: " << pi->mLevel; - jobCaption << "Job Lvl: " << pi->mJobLevel; - moneyCaption << "Gold: " << pi->mGp; - - mNameLabel->setCaption(nameCaption.str()); - mLevelLabel->setCaption(levelCaption.str()); - mJobLevelLabel->setCaption(jobCaption.str()); - mMoneyLabel->setCaption(moneyCaption.str()); + mNameLabel->setCaption(pi->getName()); + mLevelLabel->setCaption("Lvl: " + toString(pi->mLevel)); + mJobLevelLabel->setCaption("Job Lvl: " + toString(pi->mJobLevel)); + mMoneyLabel->setCaption("Gold: " + toString(pi->mGp)); if (!mCharSelected) { mNewCharButton->setEnabled(false); @@ -191,8 +186,7 @@ void CharSelectDialog::updatePlayerInfo() mPlayerBox->mHairStyle = pi->getHairStyle() - 1; mPlayerBox->mHairColor = pi->getHairColor() - 1; mPlayerBox->mShowPlayer = true; - } - else { + } else { mNameLabel->setCaption("Name"); mLevelLabel->setCaption("Level"); mJobLevelLabel->setCaption("Job Level"); |