From 68a7dd225969fcdfb9c07b99db43756a2b1dec7c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 Sep 2017 01:34:49 +0300 Subject: Change attributes value type to int64. --- src/gui/windows/ministatuswindow.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src/gui/windows/ministatuswindow.cpp') diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index ba92a0739..64d1a1175 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -268,8 +268,8 @@ void MiniStatusWindow::statChanged(const AttributesT id A_UNUSED, } void MiniStatusWindow::attributeChanged(const AttributesT id, - const int oldVal A_UNUSED, - const int newVal A_UNUSED) + const int64_t oldVal A_UNUSED, + const int64_t newVal A_UNUSED) { PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wswitch-enum") @@ -366,20 +366,28 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event) PlayerInfo::getAttribute(Attributes::PLAYER_LEVEL)); } - const int exp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP); - const int expNeed = PlayerInfo::getAttribute( + const int64_t exp = PlayerInfo::getAttribute64(Attributes::PLAYER_EXP); + const int64_t expNeed = PlayerInfo::getAttribute64( Attributes::PLAYER_EXP_NEEDED); + const std::string str = toString(CAST_U64(exp)) + + "/" + + toString(CAST_U64(expNeed)); if (exp > expNeed) { - textPopup->show(x + rect.x, y + rect.y, level, strprintf("%d/%d", - exp, expNeed)); + textPopup->show(x + rect.x, + y + rect.y, + level, + str); } else { - textPopup->show(x + rect.x, y + rect.y, level, strprintf("%d/%d", - exp, expNeed), + const std::string str2 = toString(CAST_U64(expNeed - exp)); + textPopup->show(x + rect.x, + y + rect.y, + level, + str, // TRANSLATORS: status bar label - strprintf("%s: %d", _("Need"), expNeed - exp)); + strprintf("%s: %s", _("Need"), str2.c_str())); } mStatusPopup->hide(); } -- cgit v1.2.3-60-g2f50