From 4be43a2dcae37fe11fc791d01f92843768fc4973 Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 20 May 2023 15:00:00 +0200 Subject: [PATCH] Map SettingValueType Cell to float setting type --- apps/openmw/mwgui/settingswindow.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index 97560b1a0c..aa37e2bd02 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -697,26 +697,27 @@ namespace MWGui float min, max; getSettingMinMax(scroller, min, max); value = min + (max - min) * value; - if (valueType == "Float") - Settings::get(getSettingCategory(scroller), getSettingName(scroller)).set(value); - else - Settings::get(getSettingCategory(scroller), getSettingName(scroller)) - .set(static_cast(value)); if (valueType == "Cell") { + Settings::get(getSettingCategory(scroller), getSettingName(scroller)).set(value); std::stringstream ss; ss << std::fixed << std::setprecision(2) << value / Constants::CellSizeInUnits; valueStr = ss.str(); } else if (valueType == "Float") { + Settings::get(getSettingCategory(scroller), getSettingName(scroller)).set(value); std::stringstream ss; ss << std::fixed << std::setprecision(2) << value; valueStr = ss.str(); } else + { + Settings::get(getSettingCategory(scroller), getSettingName(scroller)) + .set(static_cast(value)); valueStr = MyGUI::utility::toString(int(value)); + } } else {