New mods for small fixes

This commit is contained in:
SDraw 2023-09-06 20:05:23 +00:00 committed by SDraw
parent 3bed6f4201
commit 3a1c6774e7
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
10 changed files with 227 additions and 0 deletions

View file

@ -11,6 +11,8 @@ Merged set of MelonLoader mods for ChilloutVR.
| [Pickup Arm Movement](/ml_pam/README.md)| ml_pam | 1.0.6 [:arrow_down:](../../releases/latest/download/ml_pam.dll)| ✔ Yes |
| [Player Movement Copycat](/ml_pmc/README.md)| ml_pmc | 1.0.2 [:arrow_down:](../../releases/latest/download/ml_pmc.dll)| ✔ Yes |
| [Player Ragdoll Mod](/ml_prm/README.md)| ml_prm | 1.0.8 [:arrow_down:](../../releases/latest/download/ml_prm.dll)| ✔ Yes<br>:hourglass_flowing_sand: Update review |
| [PostprocessVolumeFix](/ml_pvf/README.md) | ml_pvf | 1.0.0 [:arrow_down:](../../releases/latest/download/ml_pvf.dll)| ❔ No |
| [ViveGesturesMovement](/ml_vgm/README.md) | ml_vgm | 1.0.0 [:arrow_down:](../../releases/latest/download/ml_vgm.dll)| ❔ No |
**Archived mods:**
| Full name | Short name | Notes |

View file

@ -26,6 +26,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_prm", "ml_prm\ml_prm.csp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_pmc", "ml_pmc\ml_pmc.csproj", "{118675AA-9AC7-4B0C-BFB1-FA1691619502}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_ppf", "ml_ppf\ml_ppf.csproj", "{0FA0B041-8347-4087-BCED-56A4F825F078}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_vgm", "ml_vgm\ml_vgm.csproj", "{5183529F-F7B7-439C-8908-1F288CFE6D51}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_pvf", "ml_pvf\ml_pvf.csproj", "{476B7470-60DC-41DB-8324-DEA41C80D26A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@ -56,6 +62,17 @@ Global
{118675AA-9AC7-4B0C-BFB1-FA1691619502}.Debug|x64.ActiveCfg = Debug|x64
{118675AA-9AC7-4B0C-BFB1-FA1691619502}.Release|x64.ActiveCfg = Release|x64
{118675AA-9AC7-4B0C-BFB1-FA1691619502}.Release|x64.Build.0 = Release|x64
{0FA0B041-8347-4087-BCED-56A4F825F078}.Debug|x64.ActiveCfg = Debug|x64
{0FA0B041-8347-4087-BCED-56A4F825F078}.Release|x64.ActiveCfg = Release|x64
{0FA0B041-8347-4087-BCED-56A4F825F078}.Release|x64.Build.0 = Release|x64
{5183529F-F7B7-439C-8908-1F288CFE6D51}.Debug|x64.ActiveCfg = Debug|x64
{5183529F-F7B7-439C-8908-1F288CFE6D51}.Debug|x64.Build.0 = Debug|x64
{5183529F-F7B7-439C-8908-1F288CFE6D51}.Release|x64.ActiveCfg = Release|x64
{5183529F-F7B7-439C-8908-1F288CFE6D51}.Release|x64.Build.0 = Release|x64
{476B7470-60DC-41DB-8324-DEA41C80D26A}.Debug|x64.ActiveCfg = Debug|x64
{476B7470-60DC-41DB-8324-DEA41C80D26A}.Debug|x64.Build.0 = Debug|x64
{476B7470-60DC-41DB-8324-DEA41C80D26A}.Release|x64.ActiveCfg = Release|x64
{476B7470-60DC-41DB-8324-DEA41C80D26A}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

31
ml_pvf/Main.cs Normal file
View file

@ -0,0 +1,31 @@
using System.Collections;
using ABI_RC.Core.Player;
namespace ml_pvf
{
public class PostprocessVolumeFix : MelonLoader.MelonMod
{
public override void OnInitializeMelon()
{
MelonLoader.MelonCoroutines.Start(FixVRCameraVolumeTarget());
}
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;
}
}
}

View file

@ -0,0 +1,4 @@
[assembly: MelonLoader.MelonInfo(typeof(ml_pvf.PostprocessVolumeFix), "PostprocessVolumeFix", "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)]

10
ml_pvf/README.md Normal file
View file

@ -0,0 +1,10 @@
# Post-Process Volume Fix
Fixes reported [issue with wrong volume trigger for post-processing layer](https://feedback.abinteractive.net/p/2023r171ex1-post-process-volume-effects-are-applied-based-on-playspace-center-instead-of-camera-s-in-vr-mode).
# Installation
* Install [latest MelonLoader](https://github.com/LavaGang/MelonLoader)
* Get [latest release DLL](../../../releases/latest):
* Put `ml_pvf.dll` in `Mods` folder of game
# Notes
* Will be implemented natively in game after 2023r172ex3.

48
ml_pvf/ml_pvf.csproj Normal file
View file

@ -0,0 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Platforms>x64</Platforms>
<PackageId>PostprocessVolumeFix</PackageId>
<Version>1.0.0</Version>
<Authors>SDraw</Authors>
<Company>None</Company>
<Product>PostprocessVolumeFix</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.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 &quot;$(TargetPath)&quot; &quot;D:\Games\Steam\steamapps\common\ChilloutVR\Mods\&quot;" />
</Target>
</Project>

60
ml_vgm/Main.cs Normal file
View file

@ -0,0 +1,60 @@
using System;
using System.Reflection;
using ABI_RC.Systems.InputManagement;
using ABI_RC.Systems.InputManagement.XR;
namespace ml_vgm
{
public class ViveGesturesMovement : MelonLoader.MelonMod
{
public override void OnInitializeMelon()
{
HarmonyInstance.Patch(
typeof(CVRXRModule).GetMethod("Update_Gestures_Vive", BindingFlags.NonPublic | BindingFlags.Instance),
null,
new HarmonyLib.HarmonyMethod(typeof(ViveGesturesMovement).GetMethod(nameof(OnViveGesturesUpdate_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
);
HarmonyInstance.Patch(
typeof(CVRXRModule).GetMethod(nameof(CVRXRModule.Reset), BindingFlags.Public | BindingFlags.Instance),
new HarmonyLib.HarmonyMethod(typeof(ViveGesturesMovement).GetMethod(nameof(OnCVRXRModuleReset_Prefix), BindingFlags.NonPublic | BindingFlags.Static)),
new HarmonyLib.HarmonyMethod(typeof(ViveGesturesMovement).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;
}
}
}

View file

@ -0,0 +1,4 @@
[assembly: MelonLoader.MelonInfo(typeof(ml_vgm.ViveGesturesMovement), "ViveGesturesMovement", "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)]

7
ml_vgm/README.md Normal file
View file

@ -0,0 +1,7 @@
# Vive Gestures Movement
Fixes broken `Vive Advanced Controls` input settings option and disables gestures when moving for Vive controllers.
# Installation
* Install [latest MelonLoader](https://github.com/LavaGang/MelonLoader)
* Get [latest release DLL](../../../releases/latest):
* Put `ml_vgm.dll` in `Mods` folder of game

44
ml_vgm/ml_vgm.csproj Normal file
View file

@ -0,0 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Platforms>x64</Platforms>
<PackageId>ViveGesturesMovement</PackageId>
<Version>1.0.0</Version>
<Authors>SDraw</Authors>
<Company>None</Company>
<Product>ViveGesturesMovement</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="UnityEngine">
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.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 &quot;$(TargetPath)&quot; &quot;D:\Games\Steam\steamapps\common\ChilloutVR\Mods\&quot;" />
</Target>
</Project>