diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-27 01:34:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-27 01:34:49 +0300 |
commit | 68a7dd225969fcdfb9c07b99db43756a2b1dec7c (patch) | |
tree | 644c14f9b178a968a53e742fb5f37aaf29fc062d /src/gui/windows/statuswindow.cpp | |
parent | d3f3ec92d583fcaecccb500c8940f33d7228ff89 (diff) | |
download | mv-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/statuswindow.cpp')
-rw-r--r-- | src/gui/windows/statuswindow.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
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<float>(PlayerInfo::getAttribute(Attributes::PLAYER_EXP)) / - static_cast<float>(max) : static_cast<float>(0), + maxExp != 0 ? + static_cast<float>(PlayerInfo::getAttribute64( + Attributes::PLAYER_EXP)) / + static_cast<float>(maxExp) : static_cast<float>(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); } |