Reset button, animation cancel, world check, VR offset fix

This commit is contained in:
SDraw 2023-04-08 17:12:54 +03:00
parent 8ffc876376
commit 8bee0d2adf
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
5 changed files with 128 additions and 18 deletions

View file

@ -1,4 +1,5 @@
using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core;
using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core.Player;
using ABI_RC.Systems.IK.SubSystems;
using System;
@ -39,6 +40,11 @@ namespace ml_prm
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnStartCalibration_Prefix), BindingFlags.Static | BindingFlags.NonPublic)),
null
);
HarmonyInstance.Patch(
typeof(RootLogic).GetMethod(nameof(RootLogic.SpawnOnWorldInstance)),
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnWorldSpawn_Prefix), BindingFlags.Static | BindingFlags.NonPublic)),
null
);
MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer());
}
@ -115,5 +121,19 @@ namespace ml_prm
}
}
static void OnWorldSpawn_Prefix() => ms_instance?.OnWorldSpawn();
void OnWorldSpawn()
{
try
{
if(m_localController != null)
m_localController.OnWorldSpawn();
}
catch(Exception e)
{
MelonLoader.MelonLogger.Error(e);
}
}
}
}