mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-04 10:59:22 +00:00
Update for 2023r172 game build
This commit is contained in:
parent
8d3baf7eb5
commit
7328c30838
27 changed files with 21 additions and 142 deletions
34
archived/ml_gmf/Fixes/AnimationOverrides.cs
Normal file
34
archived/ml_gmf/Fixes/AnimationOverrides.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using ABI_RC.Core;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ml_gmf.Fixes
|
||||
{
|
||||
static class AnimationOverrides
|
||||
{
|
||||
internal static void Init(HarmonyLib.Harmony p_instance)
|
||||
{
|
||||
p_instance.Patch(
|
||||
typeof(CVRAnimatorManager).GetMethod(nameof(CVRAnimatorManager.SetOverrideAnimation)),
|
||||
new HarmonyLib.HarmonyMethod(typeof(AnimationOverrides).GetMethod(nameof(OnOverride_Prefix), BindingFlags.Static | BindingFlags.NonPublic))
|
||||
);
|
||||
p_instance.Patch(
|
||||
typeof(CVRAnimatorManager).GetMethod(nameof(CVRAnimatorManager.RestoreOverrideAnimation)),
|
||||
new HarmonyLib.HarmonyMethod(typeof(AnimationOverrides).GetMethod(nameof(OnOverride_Prefix), BindingFlags.Static | BindingFlags.NonPublic))
|
||||
);
|
||||
}
|
||||
|
||||
static void OnOverride_Prefix(ref CVRAnimatorManager __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(__instance.animator != null)
|
||||
__instance.animator.WriteDefaultValues();
|
||||
}
|
||||
catch(Exception l_exception)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(l_exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
48
archived/ml_gmf/Fixes/AvatarOverrides.cs
Normal file
48
archived/ml_gmf/Fixes/AvatarOverrides.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using ABI.CCK.Components;
|
||||
using ABI_RC.Core.Player;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ml_gmf.Fixes
|
||||
{
|
||||
static class AvatarOverrides
|
||||
{
|
||||
internal static void Init(HarmonyLib.Harmony p_instance)
|
||||
{
|
||||
p_instance.Patch(
|
||||
typeof(PlayerSetup).GetMethod("SetupAvatarGeneral", BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
new HarmonyLib.HarmonyMethod(typeof(AvatarOverrides).GetMethod(nameof(OnSetupAvatarGeneral_Prefix), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
p_instance.Patch(
|
||||
typeof(PuppetMaster).GetMethod(nameof(PuppetMaster.AvatarInstantiated), BindingFlags.Public | BindingFlags.Instance),
|
||||
new HarmonyLib.HarmonyMethod(typeof(AvatarOverrides).GetMethod(nameof(OnPuppetAvatarInstantiated_Prefix), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
}
|
||||
|
||||
static void OnSetupAvatarGeneral_Prefix(CVRAvatar ____avatarDescriptor)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(____avatarDescriptor.overrides != null)
|
||||
____avatarDescriptor.overrides = UnityEngine.Object.Instantiate(____avatarDescriptor.overrides);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
static void OnPuppetAvatarInstantiated_Prefix(ref PuppetMaster __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
CVRAvatar l_avatar = __instance.avatarObject.GetComponent<CVRAvatar>();
|
||||
if((l_avatar != null) && (l_avatar.overrides != null))
|
||||
l_avatar.overrides = UnityEngine.Object.Instantiate(l_avatar.overrides);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
31
archived/ml_gmf/Fixes/PostProccesVolumes.cs
Normal file
31
archived/ml_gmf/Fixes/PostProccesVolumes.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using System.Collections;
|
||||
|
||||
namespace ml_gmf.Fixes
|
||||
{
|
||||
static class PostProccesVolumes
|
||||
{
|
||||
internal static void Init()
|
||||
{
|
||||
MelonLoader.MelonCoroutines.Start(FixVRCameraVolumeTarget());
|
||||
}
|
||||
|
||||
static IEnumerator FixVRCameraVolumeTarget()
|
||||
{
|
||||
while(PlayerSetup.Instance == null)
|
||||
yield return null;
|
||||
|
||||
while(PlayerSetup.Instance.vrCamera == null)
|
||||
yield return null;
|
||||
|
||||
UnityEngine.Rendering.PostProcessing.PostProcessLayer l_layer = null;
|
||||
while(l_layer == null)
|
||||
{
|
||||
l_layer = PlayerSetup.Instance.vrCamera.GetComponent<UnityEngine.Rendering.PostProcessing.PostProcessLayer>();
|
||||
yield return null;
|
||||
}
|
||||
|
||||
l_layer.volumeTrigger = PlayerSetup.Instance.vrCamera.transform;
|
||||
}
|
||||
}
|
||||
}
|
60
archived/ml_gmf/Fixes/ViveControls.cs
Normal file
60
archived/ml_gmf/Fixes/ViveControls.cs
Normal file
|
@ -0,0 +1,60 @@
|
|||
using ABI_RC.Systems.InputManagement;
|
||||
using ABI_RC.Systems.InputManagement.XR;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ml_gmf.Fixes
|
||||
{
|
||||
static class ViveControls
|
||||
{
|
||||
internal static void Init(HarmonyLib.Harmony p_instance)
|
||||
{
|
||||
p_instance.Patch(
|
||||
typeof(CVRXRModule).GetMethod("Update_Gestures_Vive", BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(ViveControls).GetMethod(nameof(OnViveGesturesUpdate_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
|
||||
);
|
||||
p_instance.Patch(
|
||||
typeof(CVRXRModule).GetMethod(nameof(CVRXRModule.Reset), BindingFlags.Public | BindingFlags.Instance),
|
||||
new HarmonyLib.HarmonyMethod(typeof(ViveControls).GetMethod(nameof(OnCVRXRModuleReset_Prefix), BindingFlags.NonPublic | BindingFlags.Static)),
|
||||
new HarmonyLib.HarmonyMethod(typeof(ViveControls).GetMethod(nameof(OnCVRXRModuleReset_Postfix), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
}
|
||||
|
||||
static void OnViveGesturesUpdate_Postfix(ref CVRXRModule __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
float l_mag = ((!__instance.HasEmoteOverride) ? __instance.Primary2DAxis : __instance.EmoteOverride).magnitude;
|
||||
if(__instance.ViveDirectionPressed && (l_mag >= CVRInputManager.VrViveGestureDeadZone))
|
||||
{
|
||||
if(__instance.Grip > 0.5f)
|
||||
{
|
||||
__instance.GestureRaw = -1f;
|
||||
__instance.Gesture = -1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
__instance.GestureRaw = __instance.Trigger;
|
||||
__instance.Gesture = __instance.Trigger;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnCVRXRModuleReset_Prefix(ref CVRXRModule __instance, out bool __state)
|
||||
{
|
||||
__state = __instance.ViveDirectionPressed;
|
||||
}
|
||||
|
||||
static void OnCVRXRModuleReset_Postfix(ref CVRXRModule __instance, bool __state)
|
||||
{
|
||||
if((__instance.Type == EXRControllerType.Vive) && CVRInputManager._moduleXR.ViveAdvancedControls)
|
||||
__instance.ViveDirectionPressed = __state;
|
||||
}
|
||||
}
|
||||
}
|
13
archived/ml_gmf/Main.cs
Normal file
13
archived/ml_gmf/Main.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
namespace ml_gmf
|
||||
{
|
||||
public class GameMainFixes : MelonLoader.MelonMod
|
||||
{
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
Fixes.ViveControls.Init(HarmonyInstance);
|
||||
Fixes.AvatarOverrides.Init(HarmonyInstance);
|
||||
Fixes.PostProccesVolumes.Init();
|
||||
Fixes.AnimationOverrides.Init(HarmonyInstance);
|
||||
}
|
||||
}
|
||||
}
|
4
archived/ml_gmf/Properties/AssemblyInfo.cs
Normal file
4
archived/ml_gmf/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,4 @@
|
|||
[assembly: MelonLoader.MelonInfo(typeof(ml_gmf.GameMainFixes), "GameMainFixes", "1.0.0", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
||||
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
|
||||
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||
[assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
17
archived/ml_gmf/README.md
Normal file
17
archived/ml_gmf/README.md
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Game Main Fixes
|
||||
This mod fixes some issues that are present in game
|
||||
|
||||
# Installation
|
||||
* Install [latest MelonLoader](https://github.com/LavaGang/MelonLoader)
|
||||
* Get [latest release DLL](../../../releases/latest):
|
||||
* Put `ml_gmf.dll` in `Mods` folder of game
|
||||
|
||||
# Implemented fixes
|
||||
* Fix of broken `Vive Advanced Controls` game input option
|
||||
* Additional feature: Disables gestures when moving with Vive controllers
|
||||
* Fix of post-processing layer volume trigger for VR camera ([feedback post](https://feedback.abinteractive.net/p/2023r171ex1-post-process-volume-effects-are-applied-based-on-playspace-center-instead-of-camera-s-in-vr-mode))
|
||||
* Fix of shared `AnimatorOverrideController` between same avatars that leads to broken avatar animator
|
||||
* Fix of animation replacement (chairs, etc.) that leads to broken avatar animator ([feedback post](https://feedback.abinteractive.net/p/gestures-getting-stuck-locally-upon-entering-vehicles-chairs))
|
||||
|
||||
# Notes
|
||||
All these fixes are implemented natively in 2023r172ex4 build.
|
52
archived/ml_gmf/ml_gmf.csproj
Normal file
52
archived/ml_gmf/ml_gmf.csproj
Normal file
|
@ -0,0 +1,52 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<PackageId>GameMainFixes</PackageId>
|
||||
<Version>1.0.0</Version>
|
||||
<Authors>SDraw</Authors>
|
||||
<Company>None</Company>
|
||||
<Product>GameMainFixes</Product>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="PlayerRagdollMod.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\0Harmony.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="MelonLoader">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\MelonLoader.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Postprocessing.Runtime">
|
||||
<HintPath>D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Unity.Postprocessing.Runtime.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.AnimationModule">
|
||||
<HintPath>D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="copy /y "$(TargetPath)" "D:\Games\Steam\steamapps\common\ChilloutVR\Mods\"" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue