From d19aa934aeacf9aaf1fd8db766eb638bc0cef2ae Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Wed, 17 Jul 2024 04:36:53 -0400 Subject: [PATCH] Fixed incorrect unlock information in Achievements dialog --- .../DolphinQt/Achievements/AchievementBox.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Source/Core/DolphinQt/Achievements/AchievementBox.cpp b/Source/Core/DolphinQt/Achievements/AchievementBox.cpp index 0beba5b06f..63562f2573 100644 --- a/Source/Core/DolphinQt/Achievements/AchievementBox.cpp +++ b/Source/Core/DolphinQt/Achievements/AchievementBox.cpp @@ -79,7 +79,7 @@ void AchievementBox::UpdateData() return; const auto& badge = AchievementManager::GetInstance().GetAchievementBadge( - m_achievement->id, m_achievement->state != RC_CLIENT_ACHIEVEMENT_STATE_UNLOCKED); + m_achievement->id, !m_achievement->unlocked); std::string_view color = AchievementManager::GRAY; if (m_achievement->unlocked & RC_CLIENT_ACHIEVEMENT_UNLOCKED_HARDCORE) color = AchievementManager::GOLD; @@ -92,11 +92,18 @@ void AchievementBox::UpdateData() m_badge->setStyleSheet( QStringLiteral("border: 4px solid %1").arg(QtUtils::FromStdString(color))); - if (m_achievement->state == RC_CLIENT_ACHIEVEMENT_STATE_UNLOCKED) + if (m_achievement->unlocked) { - m_status->setText( - tr("Unlocked at %1") - .arg(QDateTime::fromSecsSinceEpoch(m_achievement->unlock_time).toString())); + if (m_achievement->unlock_time != 0) + { + m_status->setText( + tr("Unlocked at %1") + .arg(QDateTime::fromSecsSinceEpoch(m_achievement->unlock_time).toString())); + } + else + { + m_status->setText(tr("Unlocked")); + } } else {