From 654d24e74c56d240b8d622840c135e22a029636d Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Sun, 19 Mar 2006 20:43:10 +0000 Subject: Unreverted latest change by Doener due to my lack of proper communication abilities. --- src/gui/char_select.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/gui/char_select.cpp') 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 #include #include @@ -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 *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"); -- cgit v1.2.3-70-g09d2