Boot: Initialize Wii root before saving SYSCONF file

Fixes netplay and movie overrides of SYSCONF settings not applying.
This commit is contained in:
JosJuice
2021-03-06 19:14:18 +01:00
parent 359ed5348a
commit 46dbb455e1
7 changed files with 44 additions and 16 deletions

View File

@@ -6,6 +6,7 @@
#include <algorithm>
#include <cstring>
#include <functional>
#include <list>
#include <map>
#include <memory>
@@ -29,7 +30,7 @@
namespace ConfigLoaders
{
void SaveToSYSCONF(Config::LayerType layer)
void SaveToSYSCONF(Config::LayerType layer, std::function<bool(const Config::Location&)> predicate)
{
if (Core::IsRunning())
return;
@@ -40,7 +41,10 @@ void SaveToSYSCONF(Config::LayerType layer)
for (const Config::SYSCONFSetting& setting : Config::SYSCONF_SETTINGS)
{
std::visit(
[layer, &setting, &sysconf](auto* info) {
[&](auto* info) {
if (predicate && !predicate(info->GetLocation()))
return;
const std::string key = info->GetLocation().section + "." + info->GetLocation().key;
if (setting.type == SysConf::Entry::Type::Long)