From 4129aa24389388de7cd02cb9add1f1c5e1e4a361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 31 Jul 2017 13:39:35 +0800 Subject: [PATCH] Config: Reload game INI on title change Enables any code that uses OnionConfig to use the correct config for the current title, not just the first title that was booted. --- Source/Core/Core/BootManager.cpp | 6 ------ Source/Core/Core/ConfigManager.cpp | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index 6cf09d3666..d24ebfb652 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -241,12 +241,6 @@ bool BootCore(std::unique_ptr boot) // Load game specific settings if (!std::holds_alternative(boot->parameters)) { - std::string game_id = SConfig::GetInstance().GetGameID(); - u16 revision = SConfig::GetInstance().GetRevision(); - - Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision)); - Config::AddLayer(ConfigLoaders::GenerateLocalGameConfigLoader(game_id, revision)); - IniFile game_ini = StartUp.LoadGameIni(); // General settings diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index 687bdadf8c..9a605fd563 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -791,6 +791,9 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, u64 title_id, u m_title_description = title_database.Describe(m_game_id, type); NOTICE_LOG(CORE, "Active title: %s", m_title_description.c_str()); + Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision)); + Config::AddLayer(ConfigLoaders::GenerateLocalGameConfigLoader(game_id, revision)); + if (Core::IsRunning()) { // TODO: have a callback mechanism for title changes?