mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
tweak head turn return to respect X angles
Head turn would be janky if Y angle reached 0 before X axis reached target angle.
This commit is contained in:
parent
ff70ae9652
commit
3ebd743227
3 changed files with 8 additions and 4 deletions
|
@ -28,7 +28,9 @@ public class MSP_MenuInfo
|
|||
//reflection
|
||||
internal static readonly FieldInfo _desktopMouseModeQM = typeof(ViewManager).GetField("_desktopMouseMode", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
internal static readonly FieldInfo _desktopMouseModeMM = typeof(CVR_MenuManager).GetField("_desktopMouseMode", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
internal static readonly FieldInfo ms_followAngleX = typeof(MovementSystem).GetField("_followAngleX", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
internal static readonly FieldInfo ms_followAngleY = typeof(MovementSystem).GetField("_followAngleY", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
internal static readonly FieldInfo ms_manualAngleX = typeof(MovementSystem).GetField("_manualAngleX", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
internal static bool isIndependentHeadTurn = false;
|
||||
|
||||
|
@ -57,8 +59,10 @@ public class MSP_MenuInfo
|
|||
}
|
||||
else if (!isPressed && isIndependentHeadTurn)
|
||||
{
|
||||
float angle = (float)ms_followAngleY.GetValue(MovementSystem.Instance);
|
||||
if (angle == 0f)
|
||||
float angleX = (float)ms_followAngleX.GetValue(MovementSystem.Instance);
|
||||
float angleY = (float)ms_followAngleY.GetValue(MovementSystem.Instance);
|
||||
float manualAngleX = (float)ms_manualAngleX.GetValue(MovementSystem.Instance);
|
||||
if (angleY == 0f && angleX == manualAngleX)
|
||||
{
|
||||
isIndependentHeadTurn = false;
|
||||
MSP_MenuInfo.ToggleDesktopInputMethod(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue