diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-02-13 18:33:04 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-02-13 18:33:04 +0200 |
commit | 3aba05585b85989b5d0927939812f612c3b0d4d9 (patch) | |
tree | ff6ecef24d5bad6ced0112c8d81ea5c185c5f914 /src/gui/ministatus.cpp | |
parent | 15b8c6e64326caf9cea7e948f48cf487cef625b5 (diff) | |
download | mv-3aba05585b85989b5d0927939812f612c3b0d4d9.tar.gz mv-3aba05585b85989b5d0927939812f612c3b0d4d9.tar.bz2 mv-3aba05585b85989b5d0927939812f612c3b0d4d9.tar.xz mv-3aba05585b85989b5d0927939812f612c3b0d4d9.zip |
Add money bar.
Diffstat (limited to 'src/gui/ministatus.cpp')
-rw-r--r-- | src/gui/ministatus.cpp | 15 |
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; } |