Add more settings to openmw-launcher

pull/593/head
Petr Mikheev 4 years ago committed by psi29a
parent 5c7ecb865c
commit 6a4fa8a8b5

@ -119,15 +119,22 @@ bool Launcher::AdvancedPage::loadSettings()
loadSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game");
loadSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game");
loadSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game");
loadSettingBool(swimUpwardCorrectionCheckBox, "swim upward correction", "Game");
int unarmedFactorsStrengthIndex = mEngineSettings.getInt("strength influences hand to hand", "Game");
if (unarmedFactorsStrengthIndex >= 0 && unarmedFactorsStrengthIndex <= 2)
unarmedFactorsStrengthComboBox->setCurrentIndex(unarmedFactorsStrengthIndex);
loadSettingBool(stealingFromKnockedOutCheckBox, "always allow stealing from knocked out actors", "Game");
loadSettingBool(enableNavigatorCheckBox, "enable", "Navigator");
}
// Visuals
{
loadSettingBool(autoUseObjectNormalMapsCheckBox, "auto use object normal maps", "Shaders");
loadSettingBool(autoUseObjectSpecularMapsCheckBox, "auto use object specular maps", "Shaders");
loadSettingBool(autoUseTerrainNormalMapsCheckBox, "auto use terrain normal maps", "Shaders");
loadSettingBool(autoUseTerrainSpecularMapsCheckBox, "auto use terrain specular maps", "Shaders");
loadSettingBool(bumpMapLocalLightingCheckBox, "apply lighting to environment maps", "Shaders");
loadSettingBool(radialFogCheckBox, "radial fog", "Shaders");
loadSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game");
connect(animSourcesCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotAnimSourcesToggled(bool)));
loadSettingBool(animSourcesCheckBox, "use additional anim sources", "Game");
@ -136,7 +143,6 @@ bool Launcher::AdvancedPage::loadSettings()
loadSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game");
loadSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game");
}
loadSettingBool(viewOverShoulderCheckBox, "view over shoulder", "Camera");
loadSettingBool(turnToMovementDirectionCheckBox, "turn to movement direction", "Game");
const bool distantTerrain = mEngineSettings.getBool("distant terrain", "Terrain");
@ -149,6 +155,18 @@ bool Launcher::AdvancedPage::loadSettings()
viewingDistanceComboBox->setValue(convertToCells(mEngineSettings.getInt("viewing distance", "Camera")));
}
// Camera
{
loadSettingBool(viewOverShoulderCheckBox, "view over shoulder", "Camera");
connect(viewOverShoulderCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotViewOverShoulderToggled(bool)));
viewOverShoulderGroup->setEnabled(viewOverShoulderCheckBox->checkState());
loadSettingBool(autoSwitchShoulderCheckBox, "auto switch shoulder", "Camera");
loadSettingBool(previewIfStandStillCheckBox, "preview if stand still", "Camera");
loadSettingBool(deferredPreviewRotationCheckBox, "deferred preview rotation", "Camera");
defaultShoulderComboBox->setCurrentIndex(
mEngineSettings.getVector2("view over shoulder offset", "Camera").x() >= 0 ? 0 : 1);
}
// Interface Changes
{
loadSettingBool(showEffectDurationCheckBox, "show effect duration", "Game");
@ -213,20 +231,26 @@ void Launcher::AdvancedPage::saveSettings()
saveSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game");
saveSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game");
saveSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game");
saveSettingBool(swimUpwardCorrectionCheckBox, "swim upward correction", "Game");
int unarmedFactorsStrengthIndex = unarmedFactorsStrengthComboBox->currentIndex();
if (unarmedFactorsStrengthIndex != mEngineSettings.getInt("strength influences hand to hand", "Game"))
mEngineSettings.setInt("strength influences hand to hand", "Game", unarmedFactorsStrengthIndex);
saveSettingBool(stealingFromKnockedOutCheckBox, "always allow stealing from knocked out actors", "Game");
saveSettingBool(enableNavigatorCheckBox, "enable", "Navigator");
}
// Visuals
{
saveSettingBool(autoUseObjectNormalMapsCheckBox, "auto use object normal maps", "Shaders");
saveSettingBool(autoUseObjectSpecularMapsCheckBox, "auto use object specular maps", "Shaders");
saveSettingBool(autoUseTerrainNormalMapsCheckBox, "auto use terrain normal maps", "Shaders");
saveSettingBool(autoUseTerrainSpecularMapsCheckBox, "auto use terrain specular maps", "Shaders");
saveSettingBool(bumpMapLocalLightingCheckBox, "apply lighting to environment maps", "Shaders");
saveSettingBool(radialFogCheckBox, "radial fog", "Shaders");
saveSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game");
saveSettingBool(animSourcesCheckBox, "use additional anim sources", "Game");
saveSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game");
saveSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game");
saveSettingBool(viewOverShoulderCheckBox, "view over shoulder", "Camera");
saveSettingBool(turnToMovementDirectionCheckBox, "turn to movement direction", "Game");
const bool distantTerrain = mEngineSettings.getBool("distant terrain", "Terrain");
@ -245,6 +269,24 @@ void Launcher::AdvancedPage::saveSettings()
}
}
// Camera
{
saveSettingBool(viewOverShoulderCheckBox, "view over shoulder", "Camera");
saveSettingBool(autoSwitchShoulderCheckBox, "auto switch shoulder", "Camera");
saveSettingBool(previewIfStandStillCheckBox, "preview if stand still", "Camera");
saveSettingBool(deferredPreviewRotationCheckBox, "deferred preview rotation", "Camera");
osg::Vec2f shoulderOffset = mEngineSettings.getVector2("view over shoulder offset", "Camera");
if (defaultShoulderComboBox->currentIndex() != (shoulderOffset.x() >= 0 ? 0 : 1))
{
if (defaultShoulderComboBox->currentIndex() == 0)
shoulderOffset.x() = std::abs(shoulderOffset.x());
else
shoulderOffset.x() = -std::abs(shoulderOffset.x());
mEngineSettings.setVector2("view over shoulder offset", "Camera", shoulderOffset);
}
}
// Interface Changes
{
saveSettingBool(showEffectDurationCheckBox, "show effect duration", "Game");
@ -326,3 +368,8 @@ void Launcher::AdvancedPage::slotAnimSourcesToggled(bool checked)
shieldSheathingCheckBox->setCheckState(Qt::Unchecked);
}
}
void Launcher::AdvancedPage::slotViewOverShoulderToggled(bool checked)
{
viewOverShoulderGroup->setEnabled(viewOverShoulderCheckBox->checkState());
}

@ -32,6 +32,7 @@ namespace Launcher
void on_skipMenuCheckBox_stateChanged(int state);
void on_runScriptAfterStartupBrowseButton_clicked();
void slotAnimSourcesToggled(bool checked);
void slotViewOverShoulderToggled(bool checked);
private:
Files::ConfigurationManager &mCfgMgr;

@ -2243,7 +2243,8 @@ void CharacterController::update(float duration, bool animationOnly)
swimmingPitch += osg::clampBetween(targetSwimmingPitch - swimmingPitch, -maxSwimPitchDelta, maxSwimPitchDelta);
mAnimation->setBodyPitchRadians(swimmingPitch);
}
if (inwater && isPlayer && !isFirstPersonPlayer)
static const bool swimUpwardCorrection = Settings::Manager::getBool("swim upward correction", "Game");
if (inwater && isPlayer && !isFirstPersonPlayer && swimUpwardCorrection)
{
static const float swimUpwardCoef = Settings::Manager::getFloat("swim upward coef", "Game");
static const float swimForwardCoef = sqrtf(1.0f - swimUpwardCoef * swimUpwardCoef);

@ -160,7 +160,7 @@ auto switch shoulder
This setting makes difference only in third person mode if 'view over shoulder' is enabled.
When player is close to an obstacle, automatically switches camera to the shoulder that is farther away from the obstacle.
This setting can only be configured by editing the settings configuration file.
This setting can be controlled in Advanced tab of the launcher.
zoom out when move coef
-----------------------
@ -181,9 +181,10 @@ preview if stand still
:Range: True/False
:Default: False
Makes difference only in third person mode.
If enabled then the character rotation is not synchonized with the camera rotation while the character doesn't move and not in combat mode.
This setting can only be configured by editing the settings configuration file.
This setting can be controlled in Advanced tab of the launcher.
deferred preview rotation
-------------------------
@ -196,5 +197,5 @@ Makes difference only in third person mode.
If enabled then the character smoothly rotates to the view direction after exiting preview or vanity mode.
If disabled then the camera rotates rather than the character.
This setting can only be configured by editing the settings configuration file.
This setting can be controlled in Advanced tab of the launcher.

@ -327,7 +327,18 @@ Affects side and diagonal movement. Enabling this setting makes movement more re
If disabled then the whole character's body is pointed to the direction of view. Diagonal movement has no special animation and causes sliding.
If enabled then the character turns lower body to the direction of movement. Upper body is turned partially. Head is always pointed to the direction of view. In combat mode it works only for diagonal movement. In non-combat mode it also changes straight right and straight left movement.
If enabled then the character turns lower body to the direction of movement. Upper body is turned partially. Head is always pointed to the direction of view. In combat mode it works only for diagonal movement. In non-combat mode it changes straight right and straight left movement as well. Also turns the whole body up or down when swimming according to the movement direction.
This setting can be controlled in Advanced tab of the launcher.
swim upward correction
----------------
:Type: boolean
:Range: True/False
:Default: False
Makes player swim a bit upward from the line of sight. Applies only in third person mode. Intended to make simpler swimming without diving.
This setting can be controlled in Advanced tab of the launcher.
@ -336,9 +347,10 @@ swim upward coef
:Type: floating point
:Range: -1.0 to 1.0
:Default: 0.0
:Default: 0.2
Makes player swim a bit upward (or downward in case of negative value) from the line of sight. Intended to make simpler swimming without diving. Recommened range of values is from 0.0 to 0.2.
Regulates strength of the "swim upward correction" effect (if enabled).
Makes player swim a bit upward (or downward in case of negative value) from the line of sight. Recommened range of values is from 0.0 to 0.25.
This setting can only be configured by editing the settings configuration file.

@ -325,8 +325,11 @@ uncapped damage fatigue = false
# Turn lower body to movement direction. 'true' makes diagonal movement more realistic.
turn to movement direction = false
# Makes player swim a bit upward (or downward in case of negative value) from the line of sight.
swim upward coef = 0.0
# Makes player swim a bit upward from the line of sight.
swim upward correction = false
# Strength of the 'swim upward correction' effect (if enabled).
swim upward coef = 0.2
# Make the training skills proposed by a trainer based on its base attribute instead of its modified ones
trainers training skills based on base skill = false

@ -116,6 +116,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="swimUpwardCorrectionCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Makes player swim a bit upward from the line of sight. Applies only in third person mode. Intended to make simpler swimming without diving.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Swim upward correction</string>
</property>
</widget>
</item>
<item alignment="Qt::AlignLeft">
<widget class="QWidget" name="unarmedFactorsStrengthGroup">
<property name="toolTip">
@ -164,6 +174,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="enableNavigatorCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable navigator. When enabled background threads are started to build nav mesh for world geometry. Pathfinding system uses nav mesh to build paths. When disabled only pathgrid is used to build paths. Single-core CPU systems may have big performance impact on exiting interior location and moving across exterior world. May slightly affect performance on multi-core CPU systems. Multi-core CPU systems may have different latency for nav mesh update depending on other settings and system performance. Moving across external world, entering/exiting location produce nav mesh update. NPC and creatures may not be able to find path before nav mesh is built around them. Try to disable this if you want to have old fashioned AI which doesnt know where to go when you stand behind that stone and casting a firebolt.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Build nav mesh for world geometry</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
@ -178,6 +198,52 @@
<string>Visuals</string>
</attribute>
<layout class="QVBoxLayout">
<item>
<widget class="QCheckBox" name="autoUseObjectNormalMapsCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If this option is enabled, normal maps are automatically recognized and used if they are named appropriately
(see 'normal map pattern', e.g. for a base texture foo.dds, the normal map texture would have to be named foo_n.dds).
If this option is disabled, normal maps are only used if they are explicitly listed within the mesh file (.nif or .osg file). Affects objects.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Auto use object normal maps</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoUseObjectSpecularMapsCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If this option is enabled, specular maps are automatically recognized and used if they are named appropriately
(see 'specular map pattern', e.g. for a base texture foo.dds,
the specular map texture would have to be named foo_spec.dds).
If this option is disabled, normal maps are only used if they are explicitly listed within the mesh file
(.osg file, not supported in .nif files). Affects objects.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Auto use object specular maps</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoUseTerrainNormalMapsCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;See 'auto use object normal maps'. Affects terrain.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Auto use terrain normal maps</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoUseTerrainSpecularMapsCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If a file with pattern 'terrain specular map pattern' exists, use that file as a 'diffuse specular' map. The texture must contain the layer colour in the RGB channel (as usual), and a specular multiplier in the alpha channel.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Auto use terrain specular maps</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="bumpMapLocalLightingCheckBox">
<property name="toolTip">
@ -191,6 +257,17 @@ Affected objects will use shaders.
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="radialFogCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;By default, the fog becomes thicker proportionally to your distance from the clipping plane set at the clipping distance, which causes distortion at the edges of the screen.
This setting makes the fog use the actual eye point distance (or so called Euclidean distance) to calculate the fog, which makes the fog look less artificial, especially if you have a wide FOV.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Radial fog</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="magicItemAnimationsCheckBox">
<property name="toolTip">
@ -246,22 +323,10 @@ Affected objects will use shaders.
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="viewOverShoulderCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This setting controls third person view mode.&lt;/p&gt;&lt;p&gt;False: View is centered on the character's head. Crosshair is hidden.
True: In non-combat mode camera is positioned behind the character's shoulder. Crosshair is visible in third person mode as well.
&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>View over the shoulder</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="turnToMovementDirectionCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Affects side and diagonal movement. Enabling this setting makes movement more realistic.&lt;/p&gt;&lt;p&gt;If disabled then the whole character's body is pointed to the direction of view. Diagonal movement has no special animation and causes sliding.&lt;/p&gt;&lt;p&gt;If enabled then the character turns lower body to the direction of movement. Upper body is turned partially. Head is always pointed to the direction of view. In combat mode it works only for diagonal movement. In non-combat mode it also changes straight right and straight left movement.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Affects side and diagonal movement. Enabling this setting makes movement more realistic.&lt;/p&gt;&lt;p&gt;If disabled then the whole character's body is pointed to the direction of view. Diagonal movement has no special animation and causes sliding.&lt;/p&gt;&lt;p&gt;If enabled then the character turns lower body to the direction of movement. Upper body is turned partially. Head is always pointed to the direction of view. In combat mode it works only for diagonal movement. In non-combat mode it changes straight right and straight left movement as well. Also turns the whole body up or down when swimming according to the movement direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Turn to movement direction</string>
@ -328,6 +393,122 @@ but also increase the amount of rendered geometry and significantly reduce the f
</item>
</layout>
</widget>
<widget class="QWidget" name="cameraSettings">
<attribute name="title">
<string>Camera</string>
</attribute>
<layout class="QVBoxLayout">
<item>
<widget class="QCheckBox" name="viewOverShoulderCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This setting controls third person view mode.&lt;/p&gt;&lt;p&gt;False: View is centered on the character's head. Crosshair is hidden.
True: In non-combat mode camera is positioned behind the character's shoulder. Crosshair is visible in third person mode as well.
&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>View over the shoulder</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="viewOverShoulderGroup">
<layout class="QVBoxLayout" name="viewOverShoulderVerticalLayout">
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="defaultShoulderGroup">
<layout class="QHBoxLayout" name="defaultShoulderHorizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="defaultShoulderLabel">
<property name="text">
<string>Default shoulder:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="defaultShoulderComboBox">
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>Right</string>
</property>
</item>
<item>
<property name="text">
<string>Left</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoSwitchShoulderCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;When player is close to an obstacle, automatically switches camera to the shoulder that is farther away from the obstacle.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Auto switch shoulder</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="previewIfStandStillCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If enabled then the character rotation is not synchonized with the camera rotation while the character doesn't move and not in combat mode.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Preview if stand still</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="deferredPreviewRotationCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If enabled then the character smoothly rotates to the view direction after exiting preview or vanity mode. If disabled then the camera rotates rather than the character.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Deferred preview rotation</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="InterfaceChanges">
<attribute name="title">
<string>Interface changes</string>

Loading…
Cancel
Save