frontend_common: config: Only write setting related to opened config file
If we tried to write a switchable setting to config that was not using global in the global config instance, we could write the per-game setting accidentally. This ensures that we always use the global setting for global config and the currently applied setting for custom config.
This commit is contained in:
parent
1c278974a8
commit
fa04dea7c4
@ -894,9 +894,10 @@ void Config::WriteSettingGeneric(const Settings::BasicSetting* const setting) {
|
||||
WriteBooleanSetting(std::string(key).append("\\use_global"), setting->UsingGlobal());
|
||||
}
|
||||
if (global || !setting->UsingGlobal()) {
|
||||
auto value = global ? setting->ToStringGlobal() : setting->ToString();
|
||||
WriteBooleanSetting(std::string(key).append("\\default"),
|
||||
setting->ToString() == setting->DefaultToString());
|
||||
WriteStringSetting(key, setting->ToString());
|
||||
value == setting->DefaultToString());
|
||||
WriteStringSetting(key, value);
|
||||
}
|
||||
} else if (global) {
|
||||
WriteBooleanSetting(std::string(key).append("\\default"),
|
||||
|
Loading…
Reference in New Issue
Block a user