mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-26 15:39:51 +00:00
Avoid using Settings::Manager::mDefaultSettings directly
This commit is contained in:
parent
8e487c283c
commit
39e867781e
@ -26,7 +26,7 @@
|
|||||||
#include <components/resource/resourcesystem.hpp>
|
#include <components/resource/resourcesystem.hpp>
|
||||||
#include <components/resource/scenemanager.hpp>
|
#include <components/resource/scenemanager.hpp>
|
||||||
#include <components/sceneutil/lightmanager.hpp>
|
#include <components/sceneutil/lightmanager.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
#include <components/vfs/manager.hpp>
|
#include <components/vfs/manager.hpp>
|
||||||
#include <components/widgets/sharedstatebutton.hpp>
|
#include <components/widgets/sharedstatebutton.hpp>
|
||||||
|
|
||||||
@ -620,21 +620,16 @@ namespace MWGui
|
|||||||
if (selectedButton == 1 || selectedButton == -1)
|
if (selectedButton == 1 || selectedButton == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
constexpr std::array<const char*, 6> settings = {
|
Settings::shaders().mLightBoundsMultiplier.reset();
|
||||||
"light bounds multiplier",
|
Settings::shaders().mMaximumLightDistance.reset();
|
||||||
"maximum light distance",
|
Settings::shaders().mLightFadeStart.reset();
|
||||||
"light fade start",
|
Settings::shaders().mMinimumInteriorBrightness.reset();
|
||||||
"minimum interior brightness",
|
Settings::shaders().mMaxLights.reset();
|
||||||
"max lights",
|
Settings::shaders().mLightingMethod.reset();
|
||||||
"lighting method",
|
|
||||||
};
|
|
||||||
for (const auto& setting : settings)
|
|
||||||
Settings::Manager::setString(
|
|
||||||
setting, "Shaders", Settings::Manager::mDefaultSettings[{ "Shaders", setting }]);
|
|
||||||
|
|
||||||
auto lightingMethod = SceneUtil::LightManager::getLightingMethodFromString(
|
const SceneUtil::LightingMethod lightingMethod
|
||||||
Settings::Manager::mDefaultSettings[{ "Shaders", "lighting method" }]);
|
= SceneUtil::LightManager::getLightingMethodFromString(Settings::shaders().mLightingMethod);
|
||||||
auto lightIndex = mLightingMethodButton->findItemIndexWith(lightingMethodToStr(lightingMethod));
|
const std::size_t lightIndex = mLightingMethodButton->findItemIndexWith(lightingMethodToStr(lightingMethod));
|
||||||
mLightingMethodButton->setIndexSelected(lightIndex);
|
mLightingMethodButton->setIndexSelected(lightIndex);
|
||||||
updateMaxLightsComboBox(mMaxLights);
|
updateMaxLightsComboBox(mMaxLights);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user