mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-04 02:49:23 +00:00
Flight mode consideration
Possible IK pose consideration Minor fixes
This commit is contained in:
parent
fb2a7ed119
commit
823a76d95a
3 changed files with 62 additions and 22 deletions
|
@ -1,13 +1,14 @@
|
|||
using ABI_RC.Core;
|
||||
using ABI.CCK.Components;
|
||||
using ABI_RC.Core;
|
||||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core.Util.AssetFiltering;
|
||||
using ABI_RC.Systems.IK.SubSystems;
|
||||
using ABI_RC.Systems.MovementSystem;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using ABI_RC.Core.Util.AssetFiltering;
|
||||
using ABI.CCK.Components;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ml_prm
|
||||
{
|
||||
|
@ -54,6 +55,11 @@ namespace ml_prm
|
|||
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnCombatDown_Prefix), BindingFlags.Static | BindingFlags.NonPublic)),
|
||||
null
|
||||
);
|
||||
HarmonyInstance.Patch(
|
||||
typeof(MovementSystem).GetMethod(nameof(MovementSystem.ToggleFlight)),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnToggleFlight_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
|
||||
);
|
||||
|
||||
// Whitelist the toggle script
|
||||
(typeof(SharedFilter).GetField("_localComponentWhitelist", BindingFlags.NonPublic | BindingFlags.Static)?.GetValue(null) as HashSet<Type>)?.Add(typeof(RagdollToggle));
|
||||
|
@ -77,6 +83,7 @@ namespace ml_prm
|
|||
m_localController = PlayerSetup.Instance.gameObject.AddComponent<RagdollController>();
|
||||
}
|
||||
|
||||
// Patches
|
||||
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
||||
void OnAvatarClear()
|
||||
{
|
||||
|
@ -164,5 +171,19 @@ namespace ml_prm
|
|||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnToggleFlight_Postfix() => ms_instance?.OnToggleFlight();
|
||||
void OnToggleFlight()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(m_localController != null)
|
||||
m_localController.OnToggleFlight();
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue