summaryrefslogtreecommitdiff
path: root/src/gui/ministatus.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-10 04:36:19 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-10 04:36:19 +0200
commiteb1428dded5d2be98eff034fd26a08c109d2376c (patch)
tree3672f9023151e496d1066a1fcdf9ae03ec478917 /src/gui/ministatus.cpp
parentf74cf5eb61deccc478d2a4cbc7a352748d96c65e (diff)
downloadplus-eb1428dded5d2be98eff034fd26a08c109d2376c.tar.gz
plus-eb1428dded5d2be98eff034fd26a08c109d2376c.tar.bz2
plus-eb1428dded5d2be98eff034fd26a08c109d2376c.tar.xz
plus-eb1428dded5d2be98eff034fd26a08c109d2376c.zip
Add to text popups bar name in top left corner.
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();