1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

Merged pull request #2051

This commit is contained in:
Marc Zinnschlag 2018-12-06 13:10:48 +01:00
commit d791dcfbf3
6 changed files with 39 additions and 6 deletions

View file

@ -12,6 +12,7 @@
Bug #4746: Non-solid player can't run or sneak Bug #4746: Non-solid player can't run or sneak
Feature #2229: Improve pathfinding AI Feature #2229: Improve pathfinding AI
Feature #3442: Default values for fallbacks from ini file Feature #3442: Default values for fallbacks from ini file
Feature #3610: Option to invert X axis
Feature #4673: Weapon sheathing Feature #4673: Weapon sheathing
Task #4686: Upgrade media decoder to a more current FFmpeg API Task #4686: Upgrade media decoder to a more current FFmpeg API

View file

@ -52,6 +52,7 @@ namespace MWInput
, mUserFile(userFile) , mUserFile(userFile)
, mDragDrop(false) , mDragDrop(false)
, mGrabCursor (Settings::Manager::getBool("grab cursor", "Input")) , mGrabCursor (Settings::Manager::getBool("grab cursor", "Input"))
, mInvertX (Settings::Manager::getBool("invert x axis", "Input"))
, mInvertY (Settings::Manager::getBool("invert y axis", "Input")) , mInvertY (Settings::Manager::getBool("invert y axis", "Input"))
, mControlsDisabled(false) , mControlsDisabled(false)
, mCameraSensitivity (Settings::Manager::getFloat("camera sensitivity", "Input")) , mCameraSensitivity (Settings::Manager::getFloat("camera sensitivity", "Input"))
@ -467,7 +468,7 @@ namespace MWInput
float rot[3]; float rot[3];
rot[0] = yAxis * (dt * 100.0f) * 10.0f * mCameraSensitivity * (1.0f/256.f) * (mInvertY ? -1 : 1) * mCameraYMultiplier; rot[0] = yAxis * (dt * 100.0f) * 10.0f * mCameraSensitivity * (1.0f/256.f) * (mInvertY ? -1 : 1) * mCameraYMultiplier;
rot[1] = 0.0f; rot[1] = 0.0f;
rot[2] = xAxis * (dt * 100.0f) * 10.0f * mCameraSensitivity * (1.0f/256.f); rot[2] = xAxis * (dt * 100.0f) * 10.0f * mCameraSensitivity * (1.0f/256.f) * (mInvertX ? -1 : 1);
// Only actually turn player when we're not in vanity mode // Only actually turn player when we're not in vanity mode
if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot)) if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot))
@ -646,6 +647,9 @@ namespace MWInput
for (Settings::CategorySettingVector::const_iterator it = changed.begin(); for (Settings::CategorySettingVector::const_iterator it = changed.begin();
it != changed.end(); ++it) it != changed.end(); ++it)
{ {
if (it->first == "Input" && it->second == "invert x axis")
mInvertX = Settings::Manager::getBool("invert x axis", "Input");
if (it->first == "Input" && it->second == "invert y axis") if (it->first == "Input" && it->second == "invert y axis")
mInvertY = Settings::Manager::getBool("invert y axis", "Input"); mInvertY = Settings::Manager::getBool("invert y axis", "Input");
@ -827,7 +831,7 @@ namespace MWInput
{ {
resetIdleTime(); resetIdleTime();
float x = arg.xrel * mCameraSensitivity * (1.0f/256.f); float x = arg.xrel * mCameraSensitivity * (1.0f/256.f) * (mInvertX ? -1 : 1);
float y = arg.yrel * mCameraSensitivity * (1.0f/256.f) * (mInvertY ? -1 : 1) * mCameraYMultiplier; float y = arg.yrel * mCameraSensitivity * (1.0f/256.f) * (mInvertY ? -1 : 1) * mCameraYMultiplier;
float rot[3]; float rot[3];

View file

@ -175,6 +175,7 @@ namespace MWInput
bool mGrabCursor; bool mGrabCursor;
bool mInvertX;
bool mInvertY; bool mInvertY;
bool mControlsDisabled; bool mControlsDisabled;

View file

@ -94,6 +94,20 @@ meaning that it should remain set at 1.0 unless the player desires to have diffe
This setting can only be configured by editing the settings configuration file. This setting can only be configured by editing the settings configuration file.
invert x axis
-------------
:Type: boolean
:Range: True/False
:Default: False
Invert the horizontal axis while not in GUI mode.
If this setting is true, moving the mouse to the left will cause the view to rotate counter-clockwise,
while moving it to the right will cause the view to rotate clockwise. This setting does not affect cursor movement in GUI mode.
This setting can be toggled in game with the Invert X Axis button in the Controls panel of the Options menu.
invert y axis invert y axis
------------- -------------

View file

@ -214,6 +214,16 @@
<Property key="Caption" value="#{sControlsMenu1}"/> <Property key="Caption" value="#{sControlsMenu1}"/>
</Widget> </Widget>
<Widget type="HBox" skin="" position="4 224 300 24" align="Left Bottom"> <Widget type="HBox" skin="" position="4 224 300 24" align="Left Bottom">
<Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Bottom">
<UserString key="SettingCategory" value="Input"/>
<UserString key="SettingName" value="invert x axis"/>
<UserString key="SettingType" value="CheckButton"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" position="28 4 78 16" align="Left Bottom">
<Property key="Caption" value="Invert X Axis"/>
</Widget>
</Widget>
<Widget type="HBox" skin="" position="4 254 300 24" align="Left Bottom">
<Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Bottom"> <Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Bottom">
<UserString key="SettingCategory" value="Input"/> <UserString key="SettingCategory" value="Input"/>
<UserString key="SettingName" value="invert y axis"/> <UserString key="SettingName" value="invert y axis"/>
@ -223,10 +233,10 @@
<Property key="Caption" value="#{sMouseFlip}"/> <Property key="Caption" value="#{sMouseFlip}"/>
</Widget> </Widget>
</Widget> </Widget>
<Widget type="TextBox" skin="NormalText" position="4 254 336 18" align="Left Bottom"> <Widget type="TextBox" skin="NormalText" position="4 284 336 18" align="Left Bottom">
<Property key="Caption" value="Camera Sensitivity"/> <Property key="Caption" value="Camera Sensitivity"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 278 336 18" align="HStretch Bottom"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 308 336 18" align="HStretch Bottom">
<Property key="Range" value="10000"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/> <Property key="Page" value="300"/>
<UserString key="SettingType" value="Slider"/> <UserString key="SettingType" value="Slider"/>
@ -236,11 +246,11 @@
<UserString key="SettingMin" value="0.2"/> <UserString key="SettingMin" value="0.2"/>
<UserString key="SettingMax" value="5.0"/> <UserString key="SettingMax" value="5.0"/>
</Widget> </Widget>
<Widget type="TextBox" skin="SandText" position="4 302 336 18" align="Left Bottom"> <Widget type="TextBox" skin="SandText" position="4 332 336 18" align="Left Bottom">
<Property key="Caption" value="#{sLow}"/> <Property key="Caption" value="#{sLow}"/>
<Property key="TextAlign" value="Left"/> <Property key="TextAlign" value="Left"/>
</Widget> </Widget>
<Widget type="TextBox" skin="SandText" position="4 302 336 18" align="Right Bottom"> <Widget type="TextBox" skin="SandText" position="4 332 336 18" align="Right Bottom">
<Property key="Caption" value="#{sHigh}"/> <Property key="Caption" value="#{sHigh}"/>
<Property key="TextAlign" value="Right"/> <Property key="TextAlign" value="Right"/>
</Widget> </Widget>

View file

@ -333,6 +333,9 @@ camera sensitivity = 1.0
# (>0.0, Because it's a multiplier values should be near 1.0) # (>0.0, Because it's a multiplier values should be near 1.0)
camera y multiplier = 1.0 camera y multiplier = 1.0
# Invert the horizontal axis while not in GUI mode.
invert x axis = false
# Invert the vertical axis while not in GUI mode. # Invert the vertical axis while not in GUI mode.
invert y axis = false invert y axis = false