diff --git a/src/duckstation-qt/achievementlogindialog.cpp b/src/duckstation-qt/achievementlogindialog.cpp index 6522e9238..1f1413957 100644 --- a/src/duckstation-qt/achievementlogindialog.cpp +++ b/src/duckstation-qt/achievementlogindialog.cpp @@ -75,6 +75,45 @@ void AchievementLoginDialog::processLoginResult(bool result, const QString& mess return; } + if (!Host::GetBaseBoolSettingValue("Cheevos", "Enabled", false) && + QMessageBox::question(this, tr("Enable Achievements"), + tr("Achievement tracking is not currently enabled. Your login will have no effect until " + "after tracking is enabled.\n\nDo you want to enable tracking now?"), + QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + { + Host::SetBaseBoolSettingValue("Cheevos", "Enabled", true); + Host::CommitBaseSettingChanges(); + g_emu_thread->applySettings(); + } + + if (!Host::GetBaseBoolSettingValue("Cheevos", "ChallengeMode", false) && + QMessageBox::question( + this, tr("Enable Hardcore Mode"), + tr("Hardcore mode is not currently enabled. Enabling hardcore mode allows you to set times, scores, and " + "participate in game-specific leaderboards.\n\nHowever, hardcore mode also prevents the usage of save " + "states, cheats and slowdown functionality.\n\nDo you want to enable hardcore mode?"), + QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + { + Host::SetBaseBoolSettingValue("Cheevos", "ChallengeMode", true); + Host::CommitBaseSettingChanges(); + g_emu_thread->applySettings(); + + bool has_active_game; + { + auto lock = Achievements::GetLock(); + has_active_game = Achievements::HasActiveGame(); + } + + if (has_active_game && + QMessageBox::question( + QtUtils::GetRootWidget(this), tr("Reset System"), + tr("Hardcore mode will not be enabled until the system is reset. Do you want to reset the system now?")) == + QMessageBox::Yes) + { + g_emu_thread->resetSystem(); + } + } + done(0); } diff --git a/src/duckstation-qt/achievementsettingswidget.cpp b/src/duckstation-qt/achievementsettingswidget.cpp index 663b65091..0c224e233 100644 --- a/src/duckstation-qt/achievementsettingswidget.cpp +++ b/src/duckstation-qt/achievementsettingswidget.cpp @@ -210,6 +210,19 @@ void AchievementSettingsWidget::onLoginLogoutPressed() return; updateLoginState(); + + // Login can enable achievements/hardcore. + if (!m_ui.enable->isChecked() && Host::GetBaseBoolSettingValue("Cheevos", "Enabled", false)) + { + QSignalBlocker sb(m_ui.enable); + m_ui.enable->setChecked(true); + updateEnableState(); + } + if (!m_ui.hardcoreMode->isChecked() && Host::GetBaseBoolSettingValue("Cheevos", "ChallengeMode", false)) + { + QSignalBlocker sb(m_ui.hardcoreMode); + m_ui.hardcoreMode->setChecked(true); + } } void AchievementSettingsWidget::onViewProfilePressed()