mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
settings: enable dynamic reload of some emu values
This commit is contained in:
parent
f2b530823b
commit
d91f8193b0
9 changed files with 100 additions and 63 deletions
|
@ -296,19 +296,36 @@ void emu_settings::SaveSettings()
|
|||
YAML::Emitter out;
|
||||
emitData(out, m_currentSettings);
|
||||
|
||||
if (!m_title_id.empty())
|
||||
std::string config_name;
|
||||
|
||||
if (m_title_id.empty())
|
||||
{
|
||||
config = fs::file(Emulator::GetCustomConfigPath(m_title_id), fs::read + fs::write + fs::create);
|
||||
config_name = fs::get_config_dir() + "/config.yml";
|
||||
}
|
||||
else
|
||||
{
|
||||
config = fs::file(fs::get_config_dir() + "/config.yml", fs::read + fs::write + fs::create);
|
||||
config_name = Emulator::GetCustomConfigPath(m_title_id);
|
||||
}
|
||||
|
||||
config = fs::file(config_name, fs::read + fs::write + fs::create);
|
||||
|
||||
// Save config
|
||||
config.seek(0);
|
||||
config.trunc(0);
|
||||
config.write(out.c_str(), out.size());
|
||||
|
||||
// Check if the running config/title is the same as the edited config/title.
|
||||
if (config_name == g_cfg.name || m_title_id == Emu.GetTitleID())
|
||||
{
|
||||
// Update current config
|
||||
g_cfg.from_string(config.to_string(), true);
|
||||
|
||||
if (!Emu.IsStopped()) // Don't spam the log while emulation is stopped. The config will be logged on boot anyway.
|
||||
{
|
||||
LOG_NOTICE(LOADER, "Updated configuration:\n%s\n", g_cfg.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
config.close();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue