Jump recover option

Preserve late update pose
Upcoming mod support
This commit is contained in:
SDraw 2023-05-02 11:22:17 +03:00
parent 988abd7d53
commit 4e0ddaadd4
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
7 changed files with 102 additions and 28 deletions

View file

@ -150,14 +150,17 @@ namespace ml_lme
}
}
if(m_inVR)
if(!ModSupporter.SkipFingersOverride())
{
m_inputManager.individualFingerTracking = !m_steamVrModule.GetIndexGestureToggle();
m_inputManager.individualFingerTracking |= (l_data.m_leftHand.m_present || l_data.m_rightHand.m_present);
if(m_inVR)
{
m_inputManager.individualFingerTracking = !m_steamVrModule.GetIndexGestureToggle();
m_inputManager.individualFingerTracking |= (l_data.m_leftHand.m_present || l_data.m_rightHand.m_present);
}
else
m_inputManager.individualFingerTracking = (l_data.m_leftHand.m_present || l_data.m_rightHand.m_present);
IKSystem.Instance.FingerSystem.controlActive = m_inputManager.individualFingerTracking;
}
else
m_inputManager.individualFingerTracking = (l_data.m_leftHand.m_present || l_data.m_rightHand.m_present);
IKSystem.Instance.FingerSystem.controlActive = m_inputManager.individualFingerTracking;
}
m_handRayLeft.enabled = (l_data.m_leftHand.m_present && (!m_inVR || !Utils.IsLeftHandTracked() || !Settings.FingersOnly));

37
ml_lme/ModSupporter.cs Normal file
View file

@ -0,0 +1,37 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ml_lme
{
static class ModSupporter
{
static bool ms_copycatMod = false;
public static void Init()
{
if(MelonLoader.MelonMod.RegisteredMelons.FirstOrDefault(m => m.Info.Name == "PlayerMovementCopycat") != null)
MelonLoader.MelonCoroutines.Start(WaitForCopycatInstance());
}
// PlayerMovementCopycat support
static IEnumerator WaitForCopycatInstance()
{
while(ml_pmc.PoseCopycat.Instance == null)
yield return null;
ms_copycatMod = true;
}
static bool IsCopycating() => (ml_pmc.PoseCopycat.Instance.IsActive() && ml_pmc.PoseCopycat.Instance.IsFingerTrackingActive());
public static bool SkipFingersOverride()
{
bool l_result = false;
l_result |= (ms_copycatMod && IsCopycating());
return l_result;
}
}
}

View file

@ -55,6 +55,10 @@
<HintPath>C:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\MelonLoader.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ml_pmc">
<HintPath>D:\Games\Steam\steamapps\common\ChilloutVR\Mods\ml_pmc.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@ -89,6 +93,7 @@
<Compile Include="LeapTracked.cs" />
<Compile Include="LeapTracking.cs" />
<Compile Include="Main.cs" />
<Compile Include="ModSupporter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Scripts.cs" />
<Compile Include="Settings.cs" />