mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 21:35:24 +00:00
Merge branch 'fix_cell_settings_type' into 'master'
Map SettingValueType Cell to float setting type (#7382) Closes #7382 See merge request OpenMW/openmw!3035
This commit is contained in:
commit
5b36ea0179
@ -697,26 +697,27 @@ namespace MWGui
|
|||||||
float min, max;
|
float min, max;
|
||||||
getSettingMinMax(scroller, min, max);
|
getSettingMinMax(scroller, min, max);
|
||||||
value = min + (max - min) * value;
|
value = min + (max - min) * value;
|
||||||
if (valueType == "Float")
|
|
||||||
Settings::get<float>(getSettingCategory(scroller), getSettingName(scroller)).set(value);
|
|
||||||
else
|
|
||||||
Settings::get<int>(getSettingCategory(scroller), getSettingName(scroller))
|
|
||||||
.set(static_cast<int>(value));
|
|
||||||
|
|
||||||
if (valueType == "Cell")
|
if (valueType == "Cell")
|
||||||
{
|
{
|
||||||
|
Settings::get<float>(getSettingCategory(scroller), getSettingName(scroller)).set(value);
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << std::fixed << std::setprecision(2) << value / Constants::CellSizeInUnits;
|
ss << std::fixed << std::setprecision(2) << value / Constants::CellSizeInUnits;
|
||||||
valueStr = ss.str();
|
valueStr = ss.str();
|
||||||
}
|
}
|
||||||
else if (valueType == "Float")
|
else if (valueType == "Float")
|
||||||
{
|
{
|
||||||
|
Settings::get<float>(getSettingCategory(scroller), getSettingName(scroller)).set(value);
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << std::fixed << std::setprecision(2) << value;
|
ss << std::fixed << std::setprecision(2) << value;
|
||||||
valueStr = ss.str();
|
valueStr = ss.str();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
Settings::get<int>(getSettingCategory(scroller), getSettingName(scroller))
|
||||||
|
.set(static_cast<int>(value));
|
||||||
valueStr = MyGUI::utility::toString(int(value));
|
valueStr = MyGUI::utility::toString(int(value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user