summaryrefslogtreecommitdiff
path: root/src/gui/ministatus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/ministatus.cpp')
-rw-r--r--src/gui/ministatus.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp
index ab894b3a8..8308fe15b 100644
--- a/src/gui/ministatus.cpp
+++ b/src/gui/ministatus.cpp
@@ -263,12 +263,14 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
> PlayerInfo::getAttribute(EXP_NEEDED))
{
mTextPopup->show(x + getX(), y + getY(),
+ event.getSource()->getId(),
strprintf("%u/%u", PlayerInfo::getAttribute(EXP),
PlayerInfo::getAttribute(EXP_NEEDED)));
}
else
{
mTextPopup->show(x + getX(), y + getY(),
+ event.getSource()->getId(),
strprintf("%u/%u", PlayerInfo::getAttribute(EXP),
PlayerInfo::getAttribute(EXP_NEEDED)),
strprintf("%s: %u", _("Need"),
@@ -280,6 +282,7 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
else if (event.getSource() == mHpBar)
{
mTextPopup->show(x + getX(), y + getY(),
+ event.getSource()->getId(),
strprintf("%u/%u", PlayerInfo::getAttribute(HP),
PlayerInfo::getAttribute(MAX_HP)));
mStatusPopup->hide();
@@ -287,6 +290,7 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
else if (event.getSource() == mMpBar)
{
mTextPopup->show(x + getX(), y + getY(),
+ event.getSource()->getId(),
strprintf("%u/%u", PlayerInfo::getAttribute(MP),
PlayerInfo::getAttribute(MAX_MP)));
mStatusPopup->hide();
@@ -299,12 +303,14 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
if (exp.first > exp.second)
{
mTextPopup->show(x + getX(), y + getY(),
+ event.getSource()->getId(),
strprintf("%u/%u", exp.first,
exp.second));
}
else
{
mTextPopup->show(x + getX(), y + getY(),
+ event.getSource()->getId(),
strprintf("%u/%u", exp.first,
exp.second),
strprintf("%s: %u", _("Need"),
@@ -313,6 +319,28 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
}
mStatusPopup->hide();
}
+ else if (event.getSource() == mWeightBar)
+ {
+ mTextPopup->show(x + getX(), y + getY(),
+ event.getSource()->getId(),
+ strprintf("%u/%u", PlayerInfo::getAttribute(TOTAL_WEIGHT),
+ PlayerInfo::getAttribute(MAX_WEIGHT)));
+ mStatusPopup->hide();
+ }
+ else if (event.getSource() == mInvSlotsBar)
+ {
+ Inventory *inv = PlayerInfo::getInventory();
+ if (inv)
+ {
+ const int usedSlots = inv->getNumberOfSlotsUsed();
+ const int maxSlots = inv->getSize();
+
+ mTextPopup->show(x + getX(), y + getY(),
+ event.getSource()->getId(),
+ strprintf("%u/%u", usedSlots, maxSlots));
+ }
+ mStatusPopup->hide();
+ }
else
{
mTextPopup->hide();