From fe2b0ecc673d269327b6f5c32df65fad80193128 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 19 Jul 2012 21:53:51 +0300 Subject: Show level in experience bar popup. --- src/gui/ministatuswindow.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/gui') diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp index cc374d386..72064c335 100644 --- a/src/gui/ministatuswindow.cpp +++ b/src/gui/ministatuswindow.cpp @@ -25,6 +25,7 @@ #include "animatedsprite.h" #include "configuration.h" #include "graphics.h" +#include "localplayer.h" #include "playerinfo.h" #include "gui/chatwindow.h" @@ -293,18 +294,29 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event) } else if (event.getSource() == mXpBar) { + std::string level; + if (player_node && player_node->isGM()) + { + level = strprintf(_("Level: %d (GM %d)"), + PlayerInfo::getAttribute(PlayerInfo::LEVEL), + player_node->getGMLevel()); + } + else + { + level = strprintf(_("Level: %d"), + PlayerInfo::getAttribute(PlayerInfo::LEVEL)); + } + if (PlayerInfo::getAttribute(PlayerInfo::EXP) > PlayerInfo::getAttribute(PlayerInfo::EXP_NEEDED)) { - mTextPopup->show(x + getX(), y + getY(), - event.getSource()->getId(), strprintf("%d/%d", + mTextPopup->show(x + getX(), y + getY(), level, strprintf("%d/%d", PlayerInfo::getAttribute(PlayerInfo::EXP), PlayerInfo::getAttribute(PlayerInfo::EXP_NEEDED))); } else { - mTextPopup->show(x + getX(), y + getY(), - event.getSource()->getId(), strprintf("%d/%d", + mTextPopup->show(x + getX(), y + getY(), level, strprintf("%d/%d", PlayerInfo::getAttribute(PlayerInfo::EXP), PlayerInfo::getAttribute(PlayerInfo::EXP_NEEDED)), strprintf("%s: %d", _("Need"), -- cgit v1.2.3-60-g2f50