summaryrefslogtreecommitdiff
path: root/src/gui/ministatus.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-13 18:33:04 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-13 18:33:04 +0200
commit3aba05585b85989b5d0927939812f612c3b0d4d9 (patch)
treeff6ecef24d5bad6ced0112c8d81ea5c185c5f914 /src/gui/ministatus.cpp
parent15b8c6e64326caf9cea7e948f48cf487cef625b5 (diff)
downloadplus-3aba05585b85989b5d0927939812f612c3b0d4d9.tar.gz
plus-3aba05585b85989b5d0927939812f612c3b0d4d9.tar.bz2
plus-3aba05585b85989b5d0927939812f612c3b0d4d9.tar.xz
plus-3aba05585b85989b5d0927939812f612c3b0d4d9.zip
Add money bar.
Diffstat (limited to 'src/gui/ministatus.cpp')
-rw-r--r--src/gui/ministatus.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp
index 8308fe15b..ed124d3b4 100644
--- a/src/gui/ministatus.cpp
+++ b/src/gui/ministatus.cpp
@@ -90,6 +90,9 @@ MiniStatusWindow::MiniStatusWindow():
mInvSlotsBar = createBar(0, 45, 20, Theme::PROG_INVY_SLOTS,
"inventory slots bar", _("inventory slots bar"));
+ mMoneyBar = createBar(0, 130, 20, Theme::PROG_INVY_SLOTS,
+ "money bar", _("money bar"));
+
mStatusBar = createBar(100, 150, 20, Theme::PROG_EXP,
"status bar", _("status bar"));
@@ -105,6 +108,8 @@ MiniStatusWindow::MiniStatusWindow():
Inventory *inv = PlayerInfo::getInventory();
if (inv)
inv->addInventoyListener(this);
+
+ StatusWindow::updateMoneyBar(mMoneyBar);
updateStatus();
}
@@ -214,6 +219,8 @@ void MiniStatusWindow::event(Channels channel _UNUSED_,
StatusWindow::updateXPBar(mXpBar);
else if (id == TOTAL_WEIGHT || id == MAX_WEIGHT)
StatusWindow::updateWeightBar(mWeightBar);
+ else if (id == MONEY)
+ StatusWindow::updateMoneyBar(mMoneyBar);
}
else if (event.getName() == EVENT_UPDATESTAT)
{
@@ -341,6 +348,12 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
}
mStatusPopup->hide();
}
+ else if (event.getSource() == mMoneyBar)
+ {
+ mTextPopup->show(x + getX(), y + getY(),
+ event.getSource()->getId(),
+ toString(PlayerInfo::getAttribute(MONEY)));
+ }
else
{
mTextPopup->hide();
@@ -392,6 +405,8 @@ void MiniStatusWindow::loadBars()
mWeightBar->setVisible(false);
if (mInvSlotsBar)
mInvSlotsBar->setVisible(false);
+ if (mMoneyBar)
+ mMoneyBar->setVisible(false);
return;
}