Merge pull request #9319 from JosJuice/default-enabled-no-propagate

Core: Don't copy default _Enabled sections to user INIs
This commit is contained in:
Léo Lam 2020-12-11 17:24:52 +01:00 committed by GitHub
commit 9bb8107a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 12 deletions

View File

@ -285,10 +285,8 @@ void SaveCodes(IniFile* local_ini, const std::vector<ARCode>& codes)
for (const ActionReplay::ARCode& code : codes) for (const ActionReplay::ARCode& code : codes)
{ {
if (code.enabled) if (code.enabled != code.default_enabled)
enabled_lines.emplace_back('$' + code.name); (code.enabled ? enabled_lines : disabled_lines).emplace_back('$' + code.name);
else if (code.default_enabled)
disabled_lines.emplace_back('$' + code.name);
if (code.user_defined) if (code.user_defined)
{ {

View File

@ -242,10 +242,8 @@ void SaveCodes(IniFile& inifile, const std::vector<GeckoCode>& gcodes)
for (const GeckoCode& geckoCode : gcodes) for (const GeckoCode& geckoCode : gcodes)
{ {
if (geckoCode.enabled) if (geckoCode.enabled != geckoCode.default_enabled)
enabled_lines.emplace_back('$' + geckoCode.name); (geckoCode.enabled ? enabled_lines : disabled_lines).emplace_back('$' + geckoCode.name);
else if (geckoCode.default_enabled)
disabled_lines.emplace_back('$' + geckoCode.name);
SaveGeckoCode(lines, geckoCode); SaveGeckoCode(lines, geckoCode);
} }

View File

@ -133,10 +133,8 @@ void PatchesWidget::SavePatches()
for (const auto& patch : m_patches) for (const auto& patch : m_patches)
{ {
if (patch.enabled) if (patch.enabled != patch.default_enabled)
lines_enabled.emplace_back('$' + patch.name); (patch.enabled ? lines_enabled : lines_disabled).emplace_back('$' + patch.name);
else if (patch.default_enabled)
lines_disabled.emplace_back('$' + patch.name);
if (!patch.user_defined) if (!patch.user_defined)
continue; continue;