diff options
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"); |