Skip to content

Commit

Permalink
Merge pull request dolphin-emu#12940 from LillyJadeKatrin/retroachiev…
Browse files Browse the repository at this point in the history
…ements-prior-unlock-bug

Fixed incorrect unlock information in Achievements dialog
  • Loading branch information
AdmiralCurtiss committed Jul 18, 2024
2 parents cc3ff34 + d19aa93 commit 3169bc9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Source/Core/DolphinQt/Achievements/AchievementBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
{
Expand Down

0 comments on commit 3169bc9

Please sign in to comment.