1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00

Merge branch 'launcher' into 'master'

Launcher consistency fixes

See merge request OpenMW/openmw!1983
This commit is contained in:
psi29a 2022-06-06 16:51:19 +00:00
commit 787f8fb627
4 changed files with 20 additions and 13 deletions

View file

@ -312,19 +312,24 @@ void Launcher::AdvancedPage::saveSettings()
saveSettingBool(postprocessEnabledCheckBox, "enabled", "Post Processing");
saveSettingBool(postprocessLiveReloadCheckBox, "live reload", "Post Processing");
saveSettingBool(postprocessTransparentPostpassCheckBox, "transparent postpass", "Post Processing");
Settings::Manager::setDouble("hdr exposure time", "Post Processing", postprocessHDRTimeComboBox->value());
double hdrExposureTime = postprocessHDRTimeComboBox->value();
if (hdrExposureTime != Settings::Manager::getDouble("hdr exposure time", "Post Processing"))
Settings::Manager::setDouble("hdr exposure time", "Post Processing", hdrExposureTime);
}
// Audio
{
int audioDeviceIndex = audioDeviceSelectorComboBox->currentIndex();
std::string prevAudioDevice = Settings::Manager::getString("device", "Sound");
if (audioDeviceIndex != 0)
{
Settings::Manager::setString("device", "Sound", audioDeviceSelectorComboBox->currentText().toUtf8().constData());
}
else
const std::string& newAudioDevice = audioDeviceSelectorComboBox->currentText().toUtf8().constData();
if (newAudioDevice != prevAudioDevice)
Settings::Manager::setString("device", "Sound", newAudioDevice);
}
else if (!prevAudioDevice.empty())
{
Settings::Manager::setString("device", "Sound", "");
Settings::Manager::setString("device", "Sound", {});
}
int hrtfEnabledIndex = enableHRTFComboBox->currentIndex() - 1;
if (hrtfEnabledIndex != Settings::Manager::getInt("hrtf enable", "Sound"))
@ -332,13 +337,16 @@ void Launcher::AdvancedPage::saveSettings()
Settings::Manager::setInt("hrtf enable", "Sound", hrtfEnabledIndex);
}
int selectedHRTFProfileIndex = hrtfProfileSelectorComboBox->currentIndex();
std::string prevHRTFProfile = Settings::Manager::getString("hrtf", "Sound");
if (selectedHRTFProfileIndex != 0)
{
Settings::Manager::setString("hrtf", "Sound", hrtfProfileSelectorComboBox->currentText().toUtf8().constData());
const std::string& newHRTFProfile = hrtfProfileSelectorComboBox->currentText().toUtf8().constData();
if (newHRTFProfile != prevHRTFProfile)
Settings::Manager::setString("hrtf", "Sound", newHRTFProfile);
}
else
else if (!prevHRTFProfile.empty())
{
Settings::Manager::setString("hrtf", "Sound", "");
Settings::Manager::setString("hrtf", "Sound", {});
}
}

View file

@ -233,7 +233,9 @@ void Launcher::GraphicsPage::saveSettings()
// Lighting
static std::array<std::string, 3> lightingMethodMap = {"legacy", "shaders compatibility", "shaders"};
Settings::Manager::setString("lighting method", "Shaders", lightingMethodMap[lightingMethodComboBox->currentIndex()]);
const std::string& cLightingMethod = lightingMethodMap[lightingMethodComboBox->currentIndex()];
if (cLightingMethod != Settings::Manager::getString("lighting method", "Shaders"))
Settings::Manager::setString("lighting method", "Shaders", cLightingMethod);
// Shadows
int cShadowDist = shadowDistanceCheckBox->checkState() != Qt::Unchecked ? shadowDistanceSpinBox->value() : 0;

View file

@ -34,9 +34,6 @@
</property>
<item>
<widget class="QGroupBox" name="contentGroupBox">
<property name="title">
<string>Content</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="bottomMargin">
<number>3</number>

View file

@ -156,7 +156,7 @@
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Navigation mesh cache</string>
<string>Navigation Mesh Cache</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>