diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index deb1116d0..fab953ebb 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -11,9 +11,12 @@ #include +#include + #include #include #include +#include #include #include @@ -127,13 +130,22 @@ namespace MWGui MyGUI::ScrollBar* scroll = current->castType(); std::string valueStr; std::string valueType = getSettingValueType(current); - if (valueType == "Float" || valueType == "Integer") + if (valueType == "Float" || valueType == "Integer" || valueType == "Cell") { // TODO: ScrollBar isn't meant for this. should probably use a dedicated FloatSlider widget float min,max; getSettingMinMax(scroll, min, max); float value = Settings::Manager::getFloat(getSettingName(current), getSettingCategory(current)); - valueStr = MyGUI::utility::toString((int)value); + + if (valueType == "Cell") + { + std::stringstream ss; + ss << std::fixed << std::setprecision(2) << value/Constants::CellSizeInUnits; + valueStr = ss.str(); + } + else + valueStr = MyGUI::utility::toString(int(value)); + value = std::max(min, std::min(value, max)); value = (value-min)/(max-min); @@ -146,7 +158,8 @@ namespace MWGui scroll->setScrollPosition(value); } scroll->eventScrollChangePosition += MyGUI::newDelegate(this, &SettingsWindow::onSliderChangePosition); - updateSliderLabel(scroll, valueStr); + if (scroll->getVisible()) + updateSliderLabel(scroll, valueStr); } configureWidgets(current); @@ -170,6 +183,12 @@ namespace MWGui WindowBase("openmw_settings_window.layout"), mKeyboardMode(true) { + bool terrain = Settings::Manager::getBool("distant terrain", "Terrain"); + const std::string widgetName = terrain ? "RenderingDistanceSlider" : "LargeRenderingDistanceSlider"; + MyGUI::Widget* unusedSlider; + getWidget(unusedSlider, widgetName); + unusedSlider->setVisible(false); + configureWidgets(mMainWidget); setTitle("#{sOptions}"); @@ -425,7 +444,7 @@ namespace MWGui { std::string valueStr; std::string valueType = getSettingValueType(scroller); - if (valueType == "Float" || valueType == "Integer") + if (valueType == "Float" || valueType == "Integer" || valueType == "Cell") { float value = pos / float(scroller->getScrollRange()-1); @@ -436,7 +455,15 @@ namespace MWGui Settings::Manager::setFloat(getSettingName(scroller), getSettingCategory(scroller), value); else Settings::Manager::setInt(getSettingName(scroller), getSettingCategory(scroller), (int)value); - valueStr = MyGUI::utility::toString(int(value)); + + if (valueType == "Cell") + { + std::stringstream ss; + ss << std::fixed << std::setprecision(2) << value/Constants::CellSizeInUnits; + valueStr = ss.str(); + } + else + valueStr = MyGUI::utility::toString(int(value)); } else { diff --git a/docs/source/reference/modding/settings/camera.rst b/docs/source/reference/modding/settings/camera.rst index 6f13e3305..92267a4a0 100644 --- a/docs/source/reference/modding/settings/camera.rst +++ b/docs/source/reference/modding/settings/camera.rst @@ -46,7 +46,7 @@ viewing distance :Type: floating point :Range: > 0 -:Default: 6666.0 +:Default: 6656.0 This value controls the maximum visible distance (also called the far clipping plane). Larger values significantly improve rendering in exterior spaces, @@ -87,7 +87,7 @@ Enabling the distant terrain setting is an alternative to increasing exterior ce Note that the distant land setting does not include rendering of distant static objects, so the resulting visual effect is not the same. -This setting can be adjusted in game from the ridiculously low value of 2000.0 to a maximum of 6666.0 +This setting can be adjusted in game from the ridiculously low value of 2048.0 to a maximum of 81920.0 using the View Distance slider in the Detail tab of the Video panel of the Options menu. field of view diff --git a/files/mygui/openmw_settings_window.layout b/files/mygui/openmw_settings_window.layout index 2341bfa19..1b9901d8c 100644 --- a/files/mygui/openmw_settings_window.layout +++ b/files/mygui/openmw_settings_window.layout @@ -376,18 +376,30 @@ - - - + + + - - + + + + + + + + + + + + + + diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 7e7e04b78..40a84f1c1 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -21,9 +21,9 @@ small feature culling = true small feature culling pixel size = 2.0 -# Maximum visible distance (e.g. 2000.0 to 6666.0). Caution: this setting +# Maximum visible distance. Caution: this setting # can dramatically affect performance, see documentation for details. -viewing distance = 6666.0 +viewing distance = 6656.0 # Camera field of view in degrees (e.g. 30.0 to 110.0). # Does not affect the player's hands in the first person camera.