Postshader: Don't save default setting values.

This way the defaults can change in the future without problems.
This commit is contained in:
Unknown W. Brackets committed 2022-12-12 19:09:14 -08:00
1 parent ff4971ff62
commit f202029d0b
4 files changed
+24 -12

No files matched your search

+6 -1
View File
@@ -418,7 +418,12 @@ void DisplayLayoutScreen::CreateViews() {
auto &setting = shaderInfo->settings[i];
if (!setting.name.empty()) {
// This map lookup will create the setting in the mPostShaderSetting map if it doesn't exist, with a default value of 0.0.
auto &value = g_Config.mPostShaderSetting[StringFromFormat("%sSettingValue%d", shaderInfo->section.c_str(), i + 1)];
std::string key = StringFromFormat("%sSettingValue%d", shaderInfo->section.c_str(), i + 1);
bool keyExisted = g_Config.mPostShaderSetting.find(key) != g_Config.mPostShaderSetting.end();
auto &value = g_Config.mPostShaderSetting[key];
if (!keyExisted)
value = setting.value;
if (duplicated) {
auto sliderName = StringFromFormat("%s %s", ps->T(setting.name), ps->T("(duplicated setting, previous slider will be used)"));
PopupSliderChoiceFloat *settingValue = settingContainer->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, sliderName, setting.step, screenManager()));