From ef71c7545873f757db700d0cc6db0c52005e1e06 Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Thu, 7 Nov 2024 21:11:58 -0500 Subject: [PATCH] Add Config Changed Callback for Hardcore Mode --- Source/Core/Core/AchievementManager.cpp | 2 ++ .../Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/AchievementManager.cpp b/Source/Core/Core/AchievementManager.cpp index c724476ad7..73ace1af34 100644 --- a/Source/Core/Core/AchievementManager.cpp +++ b/Source/Core/Core/AchievementManager.cpp @@ -16,6 +16,7 @@ #include "Common/Assert.h" #include "Common/BitUtils.h" #include "Common/CommonPaths.h" +#include "Common/Config/Config.h" #include "Common/FileUtil.h" #include "Common/IOFile.h" #include "Common/Image.h" @@ -64,6 +65,7 @@ void AchievementManager::Init() [](const char* message, const rc_client_t* client) { INFO_LOG_FMT(ACHIEVEMENTS, "{}", message); }); + Config::AddConfigChangedCallback([this] { SetHardcoreMode(); }); SetHardcoreMode(); m_queue.Reset("AchievementManagerQueue", [](const std::function& func) { func(); }); m_image_queue.Reset("AchievementManagerImageQueue", diff --git a/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp b/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp index 93b9f35af3..75152c09ff 100644 --- a/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp +++ b/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp @@ -329,7 +329,6 @@ void AchievementSettingsWidget::ToggleProgress() void AchievementSettingsWidget::UpdateHardcoreMode() { - AchievementManager::GetInstance().SetHardcoreMode(); if (Config::Get(Config::RA_HARDCORE_ENABLED)) { Settings::Instance().SetDebugModeEnabled(false);