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/statuswindow.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/gui/windows/statuswindow.cpp') diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp index cfff8e62f..62da4e71d 100644 --- a/src/gui/windows/statuswindow.cpp +++ b/src/gui/windows/statuswindow.cpp @@ -125,11 +125,13 @@ StatusWindow::StatusWindow() : getThemeColor(ThemeColorId::HP_BAR_OUTLINE)); mHpBar->setSelectable(false); - max = PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED); + const int64_t maxExp = PlayerInfo::getAttribute64( + Attributes::PLAYER_EXP_NEEDED); mXpBar = new ProgressBar(this, - max != 0 ? - static_cast(PlayerInfo::getAttribute(Attributes::PLAYER_EXP)) / - static_cast(max) : static_cast(0), + maxExp != 0 ? + static_cast(PlayerInfo::getAttribute64( + Attributes::PLAYER_EXP)) / + static_cast(maxExp) : static_cast(0), 80, 0, ProgressColorId::PROG_EXP, @@ -340,8 +342,8 @@ void StatusWindow::statChanged(const AttributesT id, } void StatusWindow::attributeChanged(const AttributesT id, - const int oldVal A_UNUSED, - const int newVal) + const int64_t oldVal A_UNUSED, + const int64_t newVal) { PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wswitch-enum") @@ -371,7 +373,8 @@ void StatusWindow::attributeChanged(const AttributesT id, case Attributes::PLAYER_LEVEL: // TRANSLATORS: status window label - mLvlLabel->setCaption(strprintf(_("Level: %d"), newVal)); + mLvlLabel->setCaption(strprintf(_("Level: %d"), + CAST_S32(newVal))); mLvlLabel->adjustSize(); break; @@ -439,8 +442,8 @@ void StatusWindow::updateMPBar(ProgressBar *const bar, } void StatusWindow::updateProgressBar(ProgressBar *const bar, - const int value, - const int max, + const int64_t value, + const int64_t max, const bool percent) { if (bar == nullptr) @@ -451,7 +454,7 @@ void StatusWindow::updateProgressBar(ProgressBar *const bar, // TRANSLATORS: status bar label bar->setText(_("Max")); bar->setProgress(1); - bar->setText(toString(value)); + bar->setText(toString(CAST_U64(value))); } else { @@ -464,7 +467,10 @@ void StatusWindow::updateProgressBar(ProgressBar *const bar, } else { - bar->setText(toString(value).append("/").append(toString(max))); + bar->setText(toString( + CAST_U64(value)).append( + "/").append(toString( + CAST_U64(max)))); } bar->setProgress(progress); } -- cgit v1.2.3-60-g2f50