From eb1428dded5d2be98eff034fd26a08c109d2376c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 10 Feb 2011 04:36:19 +0200 Subject: Add to text popups bar name in top left corner. --- src/gui/ministatus.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/gui/ministatus.cpp') 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(); -- cgit v1.2.3-70-g09d2