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.
This commit is contained in:
Léo Lam 2017-07-31 13:39:35 +08:00
parent 131c97e87c
commit 4129aa2438
2 changed files with 3 additions and 6 deletions

View File

@ -241,12 +241,6 @@ bool BootCore(std::unique_ptr<BootParameters> boot)
// Load game specific settings
if (!std::holds_alternative<BootParameters::IPL>(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

View File

@ -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?