mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
user settings cleanup
This commit is contained in:
parent
ed44f3ec7d
commit
4b921c3876
6 changed files with 92 additions and 96 deletions
|
@ -331,7 +331,7 @@ std::auto_ptr<sh::Factory> CS::Editor::setupGraphics()
|
||||||
|
|
||||||
factory->loadAllFiles();
|
factory->loadAllFiles();
|
||||||
|
|
||||||
bool shaders = mUserSettings.setting("Objects/shaders", QString("true")) == "true" ? true : false;
|
bool shaders = mUserSettings.setting("3d-render/shaders", QString("true")) == "true" ? true : false;
|
||||||
sh::Factory::getInstance ().setShadersEnabled (shaders);
|
sh::Factory::getInstance ().setShadersEnabled (shaders);
|
||||||
|
|
||||||
std::string fog = mUserSettings.setting("Shader/fog", QString("true")).toStdString();
|
std::string fog = mUserSettings.setting("Shader/fog", QString("true")).toStdString();
|
||||||
|
|
|
@ -46,105 +46,111 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
|
||||||
{
|
{
|
||||||
QString section;
|
QString section;
|
||||||
|
|
||||||
declareSection ("Objects", "Objects");
|
declareSection ("3d-render", "3D Rendering");
|
||||||
{
|
{
|
||||||
Setting *numLights = createSetting (Type_SpinBox, "num_lights", "num_lights");
|
|
||||||
numLights->setDefaultValue(8);
|
|
||||||
numLights->setRange (0, 100);
|
|
||||||
|
|
||||||
Setting *shaders = createSetting (Type_CheckBox, "shaders", "Enable Shaders");
|
Setting *shaders = createSetting (Type_CheckBox, "shaders", "Enable Shaders");
|
||||||
shaders->setDefaultValue("true");
|
shaders->setDefaultValue ("true");
|
||||||
}
|
|
||||||
|
|
||||||
declareSection ("Scene", "Scene");
|
Setting *farClipDist = createSetting (Type_DoubleSpinBox, "far-clip-distance", "Far clipping distance");
|
||||||
{
|
farClipDist->setDefaultValue (300000);
|
||||||
Setting *fastFactor = createSetting (Type_SpinBox, "fast factor", "fast factor");
|
|
||||||
fastFactor->setDefaultValue(4);
|
|
||||||
fastFactor->setRange (1, 100);
|
|
||||||
|
|
||||||
Setting *farClipDist = createSetting (Type_DoubleSpinBox, "far clip distance", "far clip distance");
|
|
||||||
farClipDist->setDefaultValue(300000);
|
|
||||||
farClipDist->setRange (0, 1000000);
|
farClipDist->setRange (0, 1000000);
|
||||||
|
farClipDist->setToolTip ("The maximum distance objects are still rendered at.");
|
||||||
|
|
||||||
Setting *timerStart = createSetting (Type_SpinBox, "timer start", "timer start");
|
QString defaultValue = "None";
|
||||||
timerStart->setDefaultValue(20);
|
Setting *antialiasing = createSetting (Type_ComboBox, "antialiasing", "Antialiasing");
|
||||||
timerStart->setRange (1, 100);
|
antialiasing->setDeclaredValues (QStringList()
|
||||||
|
<< defaultValue << "MSAA 2" << "MSAA 4" << "MSAA 8" << "MSAA 16");
|
||||||
|
antialiasing->setDefaultValue (defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
declareSection ("SubView", "SubView");
|
declareSection ("scene-input", "Scene Input");
|
||||||
{
|
{
|
||||||
Setting *maxSubView = createSetting (Type_SpinBox, "max subviews", "max subviews");
|
Setting *timer = createSetting (Type_SpinBox, "timer", "Input responsiveness");
|
||||||
maxSubView->setDefaultValue(256);
|
timer->setDefaultValue (20);
|
||||||
maxSubView->setRange (1, 256);
|
timer->setRange (1, 100);
|
||||||
|
timer->setToolTip ("The time between two checks for user input in milliseconds.<p>"
|
||||||
|
"Lower value result in higher responsiveness.");
|
||||||
|
|
||||||
Setting *minWidth = createSetting (Type_SpinBox, "minimum width", "minimum width");
|
Setting *fastFactor = createSetting (Type_SpinBox, "fast-factor",
|
||||||
minWidth->setDefaultValue(325);
|
"Fast movement factor");
|
||||||
minWidth->setRange (50, 10000);
|
fastFactor->setDefaultValue (4);
|
||||||
|
fastFactor->setRange (1, 100);
|
||||||
Setting *reuse = createSetting (Type_CheckBox, "reuse", "Reuse SubView");
|
fastFactor->setToolTip (
|
||||||
reuse->setDefaultValue("true");
|
"Factor by which movement is speed up while the shift key is held down.");
|
||||||
}
|
}
|
||||||
|
|
||||||
declareSection ("Window Size", "Window Size");
|
declareSection ("window", "Window");
|
||||||
{
|
{
|
||||||
Setting *width = createSetting (Type_LineEdit, "Width", "Width");
|
Setting *preDefined = createSetting (Type_ComboBox, "pre-defined",
|
||||||
Setting *height = createSetting (Type_LineEdit, "Height", "Height");
|
"Default window size");
|
||||||
|
|
||||||
width->setDefaultValues (QStringList() << "1024");
|
|
||||||
height->setDefaultValues (QStringList() << "768");
|
|
||||||
|
|
||||||
height->setViewLocation (2,2);
|
|
||||||
width->setViewLocation (2,1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*Create the proxy setting for predefined values
|
|
||||||
*/
|
|
||||||
Setting *preDefined = createSetting (Type_ComboBox, "Pre-Defined", "Pre-Defined");
|
|
||||||
|
|
||||||
preDefined->setEditorSetting (false);
|
preDefined->setEditorSetting (false);
|
||||||
|
preDefined->setDeclaredValues (
|
||||||
preDefined->setDeclaredValues (QStringList() << "640 x 480"
|
QStringList() << "640 x 480" << "800 x 600" << "1024 x 768" << "1440 x 900");
|
||||||
<< "800 x 600" << "1024 x 768" << "1440 x 900");
|
|
||||||
|
|
||||||
preDefined->setViewLocation (1, 1);
|
preDefined->setViewLocation (1, 1);
|
||||||
preDefined->setColumnSpan (2);
|
preDefined->setColumnSpan (2);
|
||||||
|
preDefined->setToolTip ("Newly opened top-level windows will open with this size "
|
||||||
|
"(picked from a list of pre-defined values)");
|
||||||
|
|
||||||
preDefined->addProxy (width,
|
Setting *width = createSetting (Type_LineEdit, "default-width",
|
||||||
QStringList() << "640" << "800" << "1024" << "1440"
|
"Default window width");
|
||||||
);
|
width->setDefaultValues (QStringList() << "1024");
|
||||||
|
width->setViewLocation (2, 1);
|
||||||
|
width->setColumnSpan (1);
|
||||||
|
width->setToolTip ("Newly opened top-level windows will open with this width.");
|
||||||
|
preDefined->addProxy (width, QStringList() << "640" << "800" << "1024" << "1440");
|
||||||
|
|
||||||
preDefined->addProxy (height,
|
Setting *height = createSetting (Type_LineEdit, "default-height",
|
||||||
QStringList() << "480" << "600" << "768" << "900"
|
"Default window height");
|
||||||
);
|
height->setDefaultValues (QStringList() << "768");
|
||||||
|
height->setViewLocation (2, 2);
|
||||||
|
height->setColumnSpan (1);
|
||||||
|
height->setToolTip ("Newly opened top-level windows will open with this height.");
|
||||||
|
preDefined->addProxy (height, QStringList() << "480" << "600" << "768" << "900");
|
||||||
|
|
||||||
|
Setting *reuse = createSetting (Type_CheckBox, "reuse", "Reuse Subviews");
|
||||||
|
reuse->setDefaultValue ("true");
|
||||||
|
reuse->setToolTip ("When a new subview is requested and a matching subview already "
|
||||||
|
" exist, do not open a new subview and use the existing one instead.");
|
||||||
|
|
||||||
|
Setting *maxSubView = createSetting (Type_SpinBox, "max-subviews",
|
||||||
|
"Maximum number of subviews per top-level window");
|
||||||
|
maxSubView->setDefaultValue (256);
|
||||||
|
maxSubView->setRange (1, 256);
|
||||||
|
maxSubView->setToolTip ("If the maximum number is reached and a new subview is opened "
|
||||||
|
"it will be placed into a new top-level window.");
|
||||||
|
|
||||||
|
Setting *minWidth = createSetting (Type_SpinBox, "minimum-width",
|
||||||
|
"Minimum subview width");
|
||||||
|
minWidth->setDefaultValue (325);
|
||||||
|
minWidth->setRange (50, 10000);
|
||||||
|
minWidth->setToolTip ("Minimum width of subviews.");
|
||||||
}
|
}
|
||||||
|
|
||||||
declareSection ("Display Format", "Display Format");
|
declareSection ("records", "Records");
|
||||||
{
|
{
|
||||||
QString defaultValue = "Icon and Text";
|
QString defaultValue = "Icon and Text";
|
||||||
|
QStringList values = QStringList() << defaultValue << "Icon Only" << "Text Only";
|
||||||
|
|
||||||
QStringList values = QStringList()
|
Setting *rsd = createSetting (Type_RadioButton, "status-format",
|
||||||
<< defaultValue << "Icon Only" << "Text Only";
|
"Modification status display format");
|
||||||
|
|
||||||
Setting *rsd = createSetting (Type_RadioButton, "Record Status Display", "Record Status Display");
|
|
||||||
|
|
||||||
Setting *ritd = createSetting (Type_RadioButton, "Referenceable ID Type Display", "Referenceable ID Type Display");
|
|
||||||
|
|
||||||
rsd->setDefaultValue (defaultValue);
|
rsd->setDefaultValue (defaultValue);
|
||||||
ritd->setDefaultValue (defaultValue);
|
|
||||||
|
|
||||||
rsd->setDeclaredValues (values);
|
rsd->setDeclaredValues (values);
|
||||||
|
|
||||||
|
Setting *ritd = createSetting (Type_RadioButton, "type-format",
|
||||||
|
"ID type display format");
|
||||||
|
ritd->setDefaultValue (defaultValue);
|
||||||
ritd->setDeclaredValues (values);
|
ritd->setDeclaredValues (values);
|
||||||
}
|
}
|
||||||
|
|
||||||
declareSection ("Video", "Video");
|
declareSection ("Objects", "Objects");
|
||||||
{
|
{
|
||||||
QString defaultValue = "None";
|
|
||||||
QStringList values = QStringList()
|
Setting *numLights = createSetting (Type_SpinBox, "num_lights", "num_lights");
|
||||||
<< defaultValue << "MSAA 2" << "MSAA 4" << "MSAA 8" << "MSAA 16";
|
numLights->setDefaultValue(8);
|
||||||
Setting *antialiasing = createSetting (Type_SpinBox, "antialiasing", "antialiasing");
|
numLights->setRange (0, 100);
|
||||||
antialiasing->setDeclaredValues (values);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* There are three types of values:
|
* There are three types of values:
|
||||||
|
@ -411,7 +417,7 @@ void CSMSettings::UserSettings::updateUserSetting(const QString &settingKey,
|
||||||
{
|
{
|
||||||
sh::Factory::getInstance ().setGlobalSetting ("num_lights", list.at(0).toStdString());
|
sh::Factory::getInstance ().setGlobalSetting ("num_lights", list.at(0).toStdString());
|
||||||
}
|
}
|
||||||
else if(settingKey == "Objects/shaders" && !list.empty())
|
else if(settingKey == "3d-render/shaders" && !list.empty())
|
||||||
{
|
{
|
||||||
sh::Factory::getInstance ().setShadersEnabled (list.at(0).toStdString() == "true" ? true : false);
|
sh::Factory::getInstance ().setShadersEnabled (list.at(0).toStdString() == "true" ? true : false);
|
||||||
}
|
}
|
||||||
|
@ -492,19 +498,9 @@ CSMSettings::Setting *CSMSettings::UserSettings::createSetting
|
||||||
if (!mSettings.empty())
|
if (!mSettings.empty())
|
||||||
row = mSettings.back()->viewRow()+1;
|
row = mSettings.back()->viewRow()+1;
|
||||||
|
|
||||||
int column = 2;
|
setting->setViewLocation (row, 1);
|
||||||
|
|
||||||
if (type==Type_CheckBox)
|
setting->setColumnSpan (3);
|
||||||
column = 1;
|
|
||||||
|
|
||||||
setting->setViewLocation (row, column);
|
|
||||||
|
|
||||||
int span = 1;
|
|
||||||
|
|
||||||
if (type==Type_CheckBox)
|
|
||||||
span = 3;
|
|
||||||
|
|
||||||
setting->setColumnSpan (span);
|
|
||||||
|
|
||||||
int width = 10;
|
int width = 10;
|
||||||
|
|
||||||
|
|
|
@ -369,10 +369,10 @@ CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int to
|
||||||
mViewTotal (totalViews)
|
mViewTotal (totalViews)
|
||||||
{
|
{
|
||||||
QString width = CSMSettings::UserSettings::instance().settingValue
|
QString width = CSMSettings::UserSettings::instance().settingValue
|
||||||
("Window Size/Width");
|
("window/default-width");
|
||||||
|
|
||||||
QString height = CSMSettings::UserSettings::instance().settingValue
|
QString height = CSMSettings::UserSettings::instance().settingValue
|
||||||
("Window Size/Height");
|
("window/default-height");
|
||||||
|
|
||||||
// trick to get the window decorations and their sizes
|
// trick to get the window decorations and their sizes
|
||||||
show();
|
show();
|
||||||
|
@ -459,7 +459,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
||||||
|
|
||||||
// User setting to reuse sub views (on a per top level view basis)
|
// User setting to reuse sub views (on a per top level view basis)
|
||||||
bool reuse =
|
bool reuse =
|
||||||
userSettings.setting("SubView/reuse", QString("true")) == "true" ? true : false;
|
userSettings.setting ("window/reuse", QString("true")) == "true" ? true : false;
|
||||||
if(reuse)
|
if(reuse)
|
||||||
{
|
{
|
||||||
foreach(SubView *sb, mSubViews)
|
foreach(SubView *sb, mSubViews)
|
||||||
|
@ -478,7 +478,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
||||||
//
|
//
|
||||||
// If the sub view limit setting is one, the sub view title bar is hidden and the
|
// If the sub view limit setting is one, the sub view title bar is hidden and the
|
||||||
// text in the main title bar is adjusted accordingly
|
// text in the main title bar is adjusted accordingly
|
||||||
int maxSubView = userSettings.setting("SubView/max subviews", QString("256")).toInt();
|
int maxSubView = userSettings.setting("window/max-subviews", QString("256")).toInt();
|
||||||
if(mSubViews.size() >= maxSubView) // create a new top level view
|
if(mSubViews.size() >= maxSubView) // create a new top level view
|
||||||
{
|
{
|
||||||
mViewManager.addView(mDocument, id, hint);
|
mViewManager.addView(mDocument, id, hint);
|
||||||
|
@ -501,7 +501,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
||||||
if (!hint.empty())
|
if (!hint.empty())
|
||||||
view->useHint (hint);
|
view->useHint (hint);
|
||||||
|
|
||||||
int minWidth = userSettings.setting("SubView/minimum width", QString("325")).toInt();
|
int minWidth = userSettings.setting ("window/minimum-width", QString("325")).toInt();
|
||||||
view->setMinimumWidth(minWidth);
|
view->setMinimumWidth(minWidth);
|
||||||
|
|
||||||
view->setStatusBar (mShowStatusBar->isChecked());
|
view->setStatusBar (mShowStatusBar->isChecked());
|
||||||
|
|
|
@ -50,10 +50,10 @@ namespace CSVRender
|
||||||
|
|
||||||
CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance();
|
CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance();
|
||||||
|
|
||||||
float farClipDist = userSettings.setting("Scene/far clip distance", QString("300000")).toFloat();
|
float farClipDist = userSettings.setting("3d-render/far-clip-distance", QString("300000")).toFloat();
|
||||||
mCamera->setFarClipDistance (farClipDist);
|
mCamera->setFarClipDistance (farClipDist);
|
||||||
|
|
||||||
mFastFactor = userSettings.setting("Scene/fast factor", QString("4")).toInt();
|
mFastFactor = userSettings.setting("scene-input/fast-factor", QString("4")).toInt();
|
||||||
|
|
||||||
mCamera->roll (Ogre::Degree (90));
|
mCamera->roll (Ogre::Degree (90));
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ namespace CSVRender
|
||||||
|
|
||||||
connect (timer, SIGNAL (timeout()), this, SLOT (update()));
|
connect (timer, SIGNAL (timeout()), this, SLOT (update()));
|
||||||
|
|
||||||
int timerStart = userSettings.setting("Scene/timer start", QString("20")).toInt();
|
int timerStart = userSettings.setting("scene-input/timer", QString("20")).toInt();
|
||||||
timer->start (timerStart);
|
timer->start (timerStart);
|
||||||
|
|
||||||
/// \todo make shortcut configurable
|
/// \todo make shortcut configurable
|
||||||
|
@ -132,7 +132,7 @@ namespace CSVRender
|
||||||
params.insert(std::make_pair("title", windowTitle.str()));
|
params.insert(std::make_pair("title", windowTitle.str()));
|
||||||
|
|
||||||
std::string antialiasing =
|
std::string antialiasing =
|
||||||
CSMSettings::UserSettings::instance().settingValue("Video/antialiasing").toStdString();
|
CSMSettings::UserSettings::instance().settingValue("3d-render/antialiasing").toStdString();
|
||||||
if(antialiasing == "MSAA 16") antialiasing = "16";
|
if(antialiasing == "MSAA 16") antialiasing = "16";
|
||||||
else if(antialiasing == "MSAA 8") antialiasing = "8";
|
else if(antialiasing == "MSAA 8") antialiasing = "8";
|
||||||
else if(antialiasing == "MSAA 4") antialiasing = "4";
|
else if(antialiasing == "MSAA 4") antialiasing = "4";
|
||||||
|
@ -409,14 +409,14 @@ namespace CSVRender
|
||||||
if(key.contains(QRegExp("^\\b(Objects|Shader|Scene)", Qt::CaseInsensitive)))
|
if(key.contains(QRegExp("^\\b(Objects|Shader|Scene)", Qt::CaseInsensitive)))
|
||||||
flagAsModified();
|
flagAsModified();
|
||||||
|
|
||||||
if(key == "Scene/far clip distance" && !list.empty())
|
if(key == "3d-render/far-clip-distance" && !list.empty())
|
||||||
{
|
{
|
||||||
if(mCamera->getFarClipDistance() != list.at(0).toFloat())
|
if(mCamera->getFarClipDistance() != list.at(0).toFloat())
|
||||||
mCamera->setFarClipDistance(list.at(0).toFloat());
|
mCamera->setFarClipDistance(list.at(0).toFloat());
|
||||||
}
|
}
|
||||||
|
|
||||||
// minimise unnecessary ogre window creation by updating only when there is a change
|
// minimise unnecessary ogre window creation by updating only when there is a change
|
||||||
if(key == "Video/antialiasing")
|
if(key == "3d-render/antialiasing")
|
||||||
{
|
{
|
||||||
unsigned int aa = mWindow->getFSAA();
|
unsigned int aa = mWindow->getFSAA();
|
||||||
unsigned int antialiasing = 0;
|
unsigned int antialiasing = 0;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
CSVWorld::IdTypeDelegate::IdTypeDelegate
|
CSVWorld::IdTypeDelegate::IdTypeDelegate
|
||||||
(const ValueList &values, const IconList &icons, CSMDoc::Document& document, QObject *parent)
|
(const ValueList &values, const IconList &icons, CSMDoc::Document& document, QObject *parent)
|
||||||
: DataDisplayDelegate (values, icons, document,
|
: DataDisplayDelegate (values, icons, document,
|
||||||
"Display Format", "Referenceable ID Type Display",
|
"records", "type-format",
|
||||||
parent)
|
parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ CSVWorld::RecordStatusDelegate::RecordStatusDelegate(const ValueList& values,
|
||||||
const IconList & icons,
|
const IconList & icons,
|
||||||
CSMDoc::Document& document, QObject *parent)
|
CSMDoc::Document& document, QObject *parent)
|
||||||
: DataDisplayDelegate (values, icons, document,
|
: DataDisplayDelegate (values, icons, document,
|
||||||
"Display Format", "Record Status Display",
|
"records", "status-format",
|
||||||
parent)
|
parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue