Fix of ragdolling with hips IK override option enabled

Hiding settings from UIExpansionKit
This commit is contained in:
SDraw 2023-04-16 11:47:36 +03:00
parent f983f2909c
commit b36f1009d9
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
14 changed files with 61 additions and 23 deletions

32
ml_amt/ModSupporter.cs Normal file
View file

@ -0,0 +1,32 @@
using System.Collections;
using System.Linq;
namespace ml_amt
{
static class ModSupporter
{
static bool ms_ragdollMod = false;
public static void Init()
{
if(MelonLoader.MelonMod.RegisteredMelons.FirstOrDefault(m => m.Info.Name == "PlayerRagdollMod") != null)
MelonLoader.MelonCoroutines.Start(WaitForRagdollInstance());
}
// PlayerRagdollMod support
static IEnumerator WaitForRagdollInstance()
{
while(ml_prm.RagdollController.Instance == null)
yield return null;
ms_ragdollMod = true;
}
static bool IsRagdolled() => ml_prm.RagdollController.Instance.IsRagdolled();
public static bool SkipHipsOverride()
{
bool l_result = false;
l_result |= (ms_ragdollMod && IsRagdolled());
return l_result;
}
}
}