From 70cd0040a3330f7e758c2c4021276a92bddd9766 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sun, 10 Dec 2023 21:04:23 +0100 Subject: [PATCH] AchievementManager: Only nag user about disabled achievements when they were actually enabled before. --- Source/Core/Core/AchievementManager.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/AchievementManager.cpp b/Source/Core/Core/AchievementManager.cpp index 2862fbdac3..5f033f2a52 100644 --- a/Source/Core/Core/AchievementManager.cpp +++ b/Source/Core/Core/AchievementManager.cpp @@ -846,21 +846,24 @@ AchievementManager::RichPresence AchievementManager::GetRichPresence() void AchievementManager::SetDisabled(bool disable) { + bool previously_disabled; { std::lock_guard lg{m_lock}; + previously_disabled = m_disabled; m_disabled = disable; + if (disable && m_is_game_loaded) + CloseGame(); } - if (disable) + + if (!previously_disabled && disable && Config::Get(Config::RA_ENABLED)) { INFO_LOG_FMT(ACHIEVEMENTS, "Achievement Manager has been disabled."); OSD::AddMessage("Please close all games to re-enable achievements.", OSD::Duration::VERY_LONG, OSD::Color::RED); - CloseGame(); } - else - { + + if (previously_disabled && !disable) INFO_LOG_FMT(ACHIEVEMENTS, "Achievement Manager has been re-enabled."); - } }; const AchievementManager::NamedIconMap& AchievementManager::GetChallengeIcons() const