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.cpp43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp
index f892cdc8b..5aa49543a 100644
--- a/src/gui/ministatus.cpp
+++ b/src/gui/ministatus.cpp
@@ -219,12 +219,22 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
}
else if (event.getSource() == mXpBar)
{
- mTextPopup->show(x + getX(), y + getY(),
- strprintf("%u/%u", PlayerInfo::getAttribute(EXP),
- PlayerInfo::getAttribute(EXP_NEEDED)),
- strprintf("%s: %u", _("Need"),
- PlayerInfo::getAttribute(EXP_NEEDED)
- - PlayerInfo::getAttribute(EXP)));
+ if (PlayerInfo::getAttribute(EXP)
+ > PlayerInfo::getAttribute(EXP_NEEDED))
+ {
+ mTextPopup->show(x + getX(), y + getY(),
+ strprintf("%u/%u", PlayerInfo::getAttribute(EXP),
+ PlayerInfo::getAttribute(EXP_NEEDED)));
+ }
+ else
+ {
+ mTextPopup->show(x + getX(), y + getY(),
+ strprintf("%u/%u", PlayerInfo::getAttribute(EXP),
+ PlayerInfo::getAttribute(EXP_NEEDED)),
+ strprintf("%s: %u", _("Need"),
+ PlayerInfo::getAttribute(EXP_NEEDED)
+ - PlayerInfo::getAttribute(EXP)));
+ }
mStatusPopup->hide();
}
else if (event.getSource() == mHpBar)
@@ -246,12 +256,21 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
std::pair<int, int> exp = PlayerInfo::getStatExperience(
Net::getPlayerHandler()->getJobLocation());
- mTextPopup->show(x + getX(), y + getY(),
- strprintf("%u/%u", exp.first,
- exp.second),
- strprintf("%s: %u", _("Need"),
- exp.second
- - exp.first));
+ if (exp.first > exp.second)
+ {
+ mTextPopup->show(x + getX(), y + getY(),
+ strprintf("%u/%u", exp.first,
+ exp.second));
+ }
+ else
+ {
+ mTextPopup->show(x + getX(), y + getY(),
+ strprintf("%u/%u", exp.first,
+ exp.second),
+ strprintf("%s: %u", _("Need"),
+ exp.second
+ - exp.first));
+ }
mStatusPopup->hide();
}
else