diff options
-rw-r--r-- | src/gui/ministatus.cpp | 43 | ||||
-rw-r--r-- | src/gui/statuswindow.cpp | 10 |
2 files changed, 40 insertions, 13 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 diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index ba66e2587..d2460f68e 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -258,6 +258,10 @@ StatusWindow::StatusWindow(): void StatusWindow::event(Channels channel _UNUSED_, const Mana::Event &event) { + static bool blocked = false; + if (blocked) + return; + if (event.getName() == EVENT_UPDATEATTRIBUTE) { switch(event.getInt("id")) @@ -341,7 +345,9 @@ void StatusWindow::event(Channels channel _UNUSED_, else { lvl = (exp.second - 20000) / 150; + blocked = true; PlayerInfo::setStatBase(id, lvl); + blocked = false; } } @@ -349,8 +355,10 @@ void StatusWindow::event(Channels channel _UNUSED_, { // possible job level up. but server broken and dont send // new job exp limit, we fixing it lvl ++; + blocked = true; PlayerInfo::setStatExperience(id, exp.first, 20000 + lvl * 150); - PlayerInfo::setStatBase(id, lvl); + blocked = false; +// PlayerInfo::setStatBase(id, lvl); } mJobLvlLabel->setCaption(strprintf(_("Job: %d"), lvl)); |