summaryrefslogtreecommitdiff
path: root/src/gui/windows/ministatuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-27 01:34:49 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-27 01:34:49 +0300
commit68a7dd225969fcdfb9c07b99db43756a2b1dec7c (patch)
tree644c14f9b178a968a53e742fb5f37aaf29fc062d /src/gui/windows/ministatuswindow.cpp
parentd3f3ec92d583fcaecccb500c8940f33d7228ff89 (diff)
downloadmv-68a7dd225969fcdfb9c07b99db43756a2b1dec7c.tar.gz
mv-68a7dd225969fcdfb9c07b99db43756a2b1dec7c.tar.bz2
mv-68a7dd225969fcdfb9c07b99db43756a2b1dec7c.tar.xz
mv-68a7dd225969fcdfb9c07b99db43756a2b1dec7c.zip
Change attributes value type to int64.
Diffstat (limited to 'src/gui/windows/ministatuswindow.cpp')
-rw-r--r--src/gui/windows/ministatuswindow.cpp26
1 files changed, 17 insertions, 9 deletions
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();
}