diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-27 22:35:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-27 22:35:38 +0300 |
commit | 9429dc4f5b5b6102a8b575de25ce5d8e7170551f (patch) | |
tree | d4603ddbea06f75e8637a1ff94da4432d7b96951 /src/gui/windows/ministatuswindow.cpp | |
parent | 64d30eda264c342aced8d791b47a35def0e4d15c (diff) | |
download | plus-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.tar.gz plus-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.tar.bz2 plus-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.tar.xz plus-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.zip |
Change player job level, exp from stat object to attribute.
Diffstat (limited to 'src/gui/windows/ministatuswindow.cpp')
-rw-r--r-- | src/gui/windows/ministatuswindow.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index fcaff8759..c97fa1cd4 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -407,24 +407,36 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event) } else if (event.getSource() == mJobBar) { - const std::pair<int, int> exp = PlayerInfo::getStatExperience( + const int64_t exp = PlayerInfo::getAttribute64( + Attributes::PLAYER_JOB_EXP); + const int64_t expNeed = PlayerInfo::getAttribute64( + Attributes::PLAYER_JOB_EXP_NEEDED); + const int32_t jobLevel = PlayerInfo::getAttribute( Attributes::PLAYER_JOB); + const std::string expStr = toString(CAST_U64(exp)); + const std::string expNeedStr = toString(CAST_U64(expNeed)); + const std::string jobLevelStr = toString(CAST_U64(jobLevel)); + const std::string expLeftStr = toString(CAST_U64(expNeed - exp)); // TRANSLATORS: job bar label const std::string level = strprintf(_("Job level: %d"), - PlayerInfo::getStatBase(Attributes::PLAYER_JOB)); + jobLevel); - if (exp.first > exp.second) + if (exp > expNeed) { - textPopup->show(x + rect.x, y + rect.y, level, - strprintf("%d/%d", exp.first, exp.second)); + textPopup->show(x + rect.x, + y + rect.y, + level, + strprintf("%s/%s", expStr.c_str(), expNeedStr.c_str())); } else { - textPopup->show(x + rect.x, y + rect.y, level, - strprintf("%d/%d", exp.first, exp.second), + textPopup->show(x + rect.x, + y + rect.y, + level, + strprintf("%s/%s", expStr.c_str(), expNeedStr.c_str()), // TRANSLATORS: status bar label - strprintf("%s: %d", _("Need"), exp.second - exp.first)); + strprintf("%s: %s", _("Need"), expLeftStr.c_str())); } mStatusPopup->hide(); } |