diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-18 14:47:14 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-18 14:47:14 +0000 |
commit | ab678324e3d73e2354cef331624ecef7cfc03203 (patch) | |
tree | 29394a5aca6e59f817f7cfa3b9281891a273d259 /src/gui/char_select.cpp | |
parent | 32badd4b6f843cb74fdc3238fe92119518c8c0ab (diff) | |
download | mana-ab678324e3d73e2354cef331624ecef7cfc03203.tar.gz mana-ab678324e3d73e2354cef331624ecef7cfc03203.tar.bz2 mana-ab678324e3d73e2354cef331624ecef7cfc03203.tar.xz mana-ab678324e3d73e2354cef331624ecef7cfc03203.zip |
Added a toString conversion function.
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"); |