diff --git a/pcsx2-qt/Settings/AchievementLoginDialog.cpp b/pcsx2-qt/Settings/AchievementLoginDialog.cpp index 59b8414c77..9062e7016d 100644 --- a/pcsx2-qt/Settings/AchievementLoginDialog.cpp +++ b/pcsx2-qt/Settings/AchievementLoginDialog.cpp @@ -91,6 +91,48 @@ void AchievementLoginDialog::processLoginResult(bool result, const QString& mess return; } + if (m_reason == Achievements::LoginRequestReason::UserInitiated) + { + if (!Host::GetBaseBoolSettingValue("Achievements", "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("Achievements", "Enabled", true); + Host::CommitBaseSettingChanges(); + g_emu_thread->applySettings(); + } + + if (!Host::GetBaseBoolSettingValue("Achievements", "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("Achievements", "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(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->resetVM(); + } + } + + } + done(0); } diff --git a/pcsx2-qt/Settings/AchievementSettingsWidget.cpp b/pcsx2-qt/Settings/AchievementSettingsWidget.cpp index 5bf1400b3b..cca925d4b7 100644 --- a/pcsx2-qt/Settings/AchievementSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AchievementSettingsWidget.cpp @@ -194,6 +194,19 @@ void AchievementSettingsWidget::onLoginLogoutPressed() return; updateLoginState(); + + // Login can enable achievements/hardcore. + if (!m_ui.enable->isChecked() && Host::GetBaseBoolSettingValue("Achievements", "Enabled", false)) + { + QSignalBlocker sb(m_ui.enable); + m_ui.enable->setChecked(true); + updateEnableState(); + } + if (!m_ui.hardcoreMode->isChecked() && Host::GetBaseBoolSettingValue("Achievements", "ChallengeMode", false)) + { + QSignalBlocker sb(m_ui.hardcoreMode); + m_ui.hardcoreMode->setChecked(true); + } } void AchievementSettingsWidget::onViewProfilePressed()