summaryrefslogtreecommitdiff
path: root/src/gui/status.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-02-15 11:29:40 +0000
committerJared Adams <jaxad0127@gmail.com>2009-02-15 11:29:40 +0000
commit79e803232438d41cce80467a97e9efde8e6c0c70 (patch)
treef8fd399a13913ccbc6942f6385f9852426f9ebf1 /src/gui/status.cpp
parent0a106989bd16c48525f01cb8515809e74f37a8d8 (diff)
downloadmana-79e803232438d41cce80467a97e9efde8e6c0c70.tar.gz
mana-79e803232438d41cce80467a97e9efde8e6c0c70.tar.bz2
mana-79e803232438d41cce80467a97e9efde8e6c0c70.tar.xz
mana-79e803232438d41cce80467a97e9efde8e6c0c70.zip
Add configurable units system
Diffstat (limited to 'src/gui/status.cpp')
-rw-r--r--src/gui/status.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/status.cpp b/src/gui/status.cpp
index 683a9a41..cb02a57a 100644
--- a/src/gui/status.cpp
+++ b/src/gui/status.cpp
@@ -29,6 +29,7 @@
#include "widgets/layout.h"
#include "../localplayer.h"
+#include "../units.h"
#include "../utils/gettext.h"
#include "../utils/strprintf.h"
@@ -36,7 +37,9 @@
StatusWindow::StatusWindow(LocalPlayer *player):
Window(player->getName()),
- mPlayer(player)
+ mPlayer(player),
+ currency(-1),
+ currencyS("?")
{
setWindowName(_("Status"));
setCloseButton(true);
@@ -49,7 +52,7 @@ StatusWindow::StatusWindow(LocalPlayer *player):
mLvlLabel = new gcn::Label(strprintf(_("Level: %d"), 0));
mJobLvlLabel = new gcn::Label(strprintf(_("Job: %d"), 0));
- mGpLabel = new gcn::Label(strprintf(_("Money: %d GP"), 0));
+ mGpLabel = new gcn::Label(strprintf(_("Money: %s"), ""));
mHpLabel = new gcn::Label(_("HP:"));
mHpBar = new ProgressBar(1.0f, 80, 15, 0, 171, 34);
@@ -171,8 +174,12 @@ void StatusWindow::update()
mJobLvlLabel->setCaption(strprintf(_("Job: %d"), mPlayer->mJobLevel));
mJobLvlLabel->adjustSize();
- mGpLabel->setCaption(strprintf(_("Money: %d GP"), mPlayer->mGp));
- mGpLabel->adjustSize();
+ if (currency != mPlayer->mGp) {
+ currency = mPlayer->mGp;
+ currencyS = strprintf(_("Money: %s"), Units::formatCurrency(currency).c_str());
+ mGpLabel->setCaption(currencyS);
+ mGpLabel->adjustSize();
+ }
mHpBar->setText(toString(mPlayer->mHp) +
"/" + toString(mPlayer->mMaxHp));