diff options
Diffstat (limited to 'src/gui/char_select.cpp')
-rw-r--r-- | src/gui/char_select.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index 6e7548e8..208e3b56 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -1,9 +1,8 @@ /* - * Aethyra + * The Mana World * Copyright (C) 2004 The Mana World Development Team * - * This file is part of Aethyra based on original code - * from The Mana World. + * This file is part of The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,6 +37,7 @@ #include "../game.h" #include "../localplayer.h" #include "../main.h" +#include "../units.h" #include "../net/charserverhandler.h" #include "../net/messageout.h" @@ -86,6 +86,9 @@ CharSelectDialog::CharSelectDialog(Network *network, Window(_("Select Character")), mNetwork(network), mCharInfo(charInfo), mGender(gender), mCharSelected(false) { + LocalPlayer *pi = mCharInfo->getEntry(); + if (pi) + mMoney = Units::formatCurrency(pi->mGp); // Control that shows the Player mPlayerBox = new PlayerBox; mPlayerBox->setWidth(74); @@ -93,7 +96,7 @@ CharSelectDialog::CharSelectDialog(Network *network, mNameLabel = new gcn::Label(strprintf(_("Name: %s"), "")); mLevelLabel = new gcn::Label(strprintf(_("Level: %d"), 0)); mJobLevelLabel = new gcn::Label(strprintf(_("Job Level: %d"), 0)); - mMoneyLabel = new gcn::Label(strprintf(_("Money: %d"), 0)); + mMoneyLabel = new gcn::Label(strprintf(_("Money: %s"), mMoney.c_str())); const std::string tempString = getFont()->getWidth(_("New")) < getFont()->getWidth(_("Delete")) ? @@ -164,10 +167,16 @@ void CharSelectDialog::action(const gcn::ActionEvent &event) else if (event.getId() == "previous") { mCharInfo->prev(); + LocalPlayer *pi = mCharInfo->getEntry(); + if (pi) + mMoney = Units::formatCurrency(pi->mGp); } else if (event.getId() == "next") { mCharInfo->next(); + LocalPlayer *pi = mCharInfo->getEntry(); + if (pi) + mMoney = Units::formatCurrency(pi->mGp); } } @@ -177,10 +186,12 @@ void CharSelectDialog::updatePlayerInfo() if (pi) { - mNameLabel->setCaption(strprintf(_("Name: %s"), pi->getName().c_str())); + mNameLabel->setCaption(strprintf(_("Name: %s"), + pi->getName().c_str())); mLevelLabel->setCaption(strprintf(_("Level: %d"), pi->mLevel)); - mJobLevelLabel->setCaption(strprintf(_("Job Level: %d"), pi->mJobLevel)); - mMoneyLabel->setCaption(strprintf(_("Gold: %d"), pi->mGp)); + mJobLevelLabel->setCaption(strprintf(_("Job Level: %d"), + pi->mJobLevel)); + mMoneyLabel->setCaption(strprintf(_("Money: %s"), mMoney.c_str())); if (!mCharSelected) { mNewDelCharButton->setCaption(_("Delete")); @@ -192,7 +203,7 @@ void CharSelectDialog::updatePlayerInfo() mNameLabel->setCaption(strprintf(_("Name: %s"), "")); mLevelLabel->setCaption(strprintf(_("Level: %d"), 0)); mJobLevelLabel->setCaption(strprintf(_("Job Level: %d"), 0)); - mMoneyLabel->setCaption(strprintf(_("Money: %d"), 0)); + mMoneyLabel->setCaption(strprintf(_("Money: %s"), "")); mNewDelCharButton->setCaption(_("New")); mSelectButton->setEnabled(false); } |