diff --git a/README.md b/README.md
index b54a2b2..c441ee2 100644
--- a/README.md
+++ b/README.md
@@ -3,16 +3,15 @@ Merged set of MelonLoader mods for ChilloutVR.
**Table for game build 2022r171p2:**
| Full name | Short name | Latest version | Available in [CVRMA](https://github.com/knah/CVRMelonAssistant) |
|:---------:|:----------:|:--------------:| :----------------------------------------------------------------|
-| [Avatar Motion Tweaker](/ml_amt/README.md) | ml_amt | 1.3.1 [:arrow_down:](../../releases/latest/download/ml_amt.dll)| ✔ Yes
:hourglass_flowing_sand: Update review |
+| [Avatar Motion Tweaker](/ml_amt/README.md) | ml_amt | 1.3.1 [:arrow_down:](../../releases/latest/download/ml_amt.dll)| ✔ Yes |
| [Desktop Head Tracking](/ml_dht/README.md)| ml_dht | - | ✔ Yes
:warning:Broken |
| [Desktop Reticle Switch](/ml_drs/README.md)| ml_drs | 1.0.1 [:arrow_down:](../../releases/latest/download/ml_drs.dll)| ✔ Yes |
| [Extended Game Notifications](/ml_egn/README.md) | ml_egn | 1.0.3 [:arrow_down:](../../releases/latest/download/ml_egn.dll)| ✔ Yes |
| [Leap Motion Extension](/ml_lme/README.md)| ml_lme | 1.4.1 [:arrow_down:](../../releases/latest/download/ml_lme.dll)| ✔ Yes |
| [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
:hourglass_flowing_sand: Update review |
-| [Post-Process Volume Fix](/ml_pvf/README.md) | ml_pvf | 1.0.0 [:arrow_down:](../../releases/latest/download/ml_pvf.dll)| ❔ No |
-| [Vive Gestures Movement](/ml_vgm/README.md) | ml_vgm | 1.0.0 [:arrow_down:](../../releases/latest/download/ml_vgm.dll)| ❔ No |
+| [Player Ragdoll Mod](/ml_prm/README.md)| ml_prm | 1.0.8 [:arrow_down:](../../releases/latest/download/ml_prm.dll)| ✔ Yes |
+| [Game Main Fixes](/ml_gmf/README.md) | ml_gmf | 1.0.0 [:arrow_down:](../../releases/latest/download/ml_gmf.dll)| ❔ No |
**Archived mods:**
| Full name | Short name | Notes |
diff --git a/ml_gmf/Fixes/AvatarOverrides.cs b/ml_gmf/Fixes/AvatarOverrides.cs
new file mode 100644
index 0000000..cadb73b
--- /dev/null
+++ b/ml_gmf/Fixes/AvatarOverrides.cs
@@ -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();
+ if((l_avatar != null) && (l_avatar.overrides != null))
+ l_avatar.overrides = UnityEngine.Object.Instantiate(l_avatar.overrides);
+ }
+ catch(Exception e)
+ {
+ MelonLoader.MelonLogger.Error(e);
+ }
+ }
+ }
+}
diff --git a/ml_pvf/Main.cs b/ml_gmf/Fixes/PostProccesVolumes.cs
similarity index 75%
rename from ml_pvf/Main.cs
rename to ml_gmf/Fixes/PostProccesVolumes.cs
index aaac182..93fa38e 100644
--- a/ml_pvf/Main.cs
+++ b/ml_gmf/Fixes/PostProccesVolumes.cs
@@ -1,16 +1,16 @@
-using System.Collections;
-using ABI_RC.Core.Player;
+using ABI_RC.Core.Player;
+using System.Collections;
-namespace ml_pvf
+namespace ml_gmf.Fixes
{
- public class PostprocessVolumeFix : MelonLoader.MelonMod
+ static class PostProccesVolumes
{
- public override void OnInitializeMelon()
+ internal static void Init()
{
MelonLoader.MelonCoroutines.Start(FixVRCameraVolumeTarget());
}
- IEnumerator FixVRCameraVolumeTarget()
+ static IEnumerator FixVRCameraVolumeTarget()
{
while(PlayerSetup.Instance == null)
yield return null;
diff --git a/ml_vgm/Main.cs b/ml_gmf/Fixes/ViveControls.cs
similarity index 69%
rename from ml_vgm/Main.cs
rename to ml_gmf/Fixes/ViveControls.cs
index 0e1bd80..f4b229c 100644
--- a/ml_vgm/Main.cs
+++ b/ml_gmf/Fixes/ViveControls.cs
@@ -1,23 +1,23 @@
-using System;
-using System.Reflection;
-using ABI_RC.Systems.InputManagement;
+using ABI_RC.Systems.InputManagement;
using ABI_RC.Systems.InputManagement.XR;
+using System;
+using System.Reflection;
-namespace ml_vgm
+namespace ml_gmf.Fixes
{
- public class ViveGesturesMovement : MelonLoader.MelonMod
+ static class ViveControls
{
- public override void OnInitializeMelon()
+ internal static void Init(HarmonyLib.Harmony p_instance)
{
- HarmonyInstance.Patch(
+ p_instance.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))
+ new HarmonyLib.HarmonyMethod(typeof(ViveControls).GetMethod(nameof(OnViveGesturesUpdate_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
);
- HarmonyInstance.Patch(
+ p_instance.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))
+ 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))
);
}
diff --git a/ml_gmf/Main.cs b/ml_gmf/Main.cs
new file mode 100644
index 0000000..a4c840c
--- /dev/null
+++ b/ml_gmf/Main.cs
@@ -0,0 +1,12 @@
+namespace ml_gmf
+{
+ public class GameMainFixes : MelonLoader.MelonMod
+ {
+ public override void OnInitializeMelon()
+ {
+ Fixes.ViveControls.Init(HarmonyInstance);
+ Fixes.AvatarOverrides.Init(HarmonyInstance);
+ Fixes.PostProccesVolumes.Init();
+ }
+ }
+}
diff --git a/ml_vgm/Properties/AssemblyInfo.cs b/ml_gmf/Properties/AssemblyInfo.cs
similarity index 63%
rename from ml_vgm/Properties/AssemblyInfo.cs
rename to ml_gmf/Properties/AssemblyInfo.cs
index 67375c6..090e44c 100644
--- a/ml_vgm/Properties/AssemblyInfo.cs
+++ b/ml_gmf/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-[assembly: MelonLoader.MelonInfo(typeof(ml_vgm.ViveGesturesMovement), "ViveGesturesMovement", "1.0.0", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
+[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)]
\ No newline at end of file
diff --git a/ml_gmf/README.md b/ml_gmf/README.md
new file mode 100644
index 0000000..f504474
--- /dev/null
+++ b/ml_gmf/README.md
@@ -0,0 +1,16 @@
+# 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
+
+# Notes
+Some of fixes will be implemented natively in game after 2023r172ex3
diff --git a/ml_pvf/ml_pvf.csproj b/ml_gmf/ml_gmf.csproj
similarity index 82%
rename from ml_pvf/ml_pvf.csproj
rename to ml_gmf/ml_gmf.csproj
index 2455c13..e073452 100644
--- a/ml_pvf/ml_pvf.csproj
+++ b/ml_gmf/ml_gmf.csproj
@@ -3,11 +3,11 @@
netstandard2.1
x64
- PostprocessVolumeFix
+ GameMainFixes
1.0.0
SDraw
None
- PostprocessVolumeFix
+ GameMainFixes
@@ -35,8 +35,12 @@
D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.dll
false
+
+ D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.AnimationModule.dll
+ false
+
- D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.CoreModule.dll
+ D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.CoreModule.dll
false
diff --git a/ml_mods_cvr.sln b/ml_mods_cvr.sln
index 8acc416..1fc727f 100644
--- a/ml_mods_cvr.sln
+++ b/ml_mods_cvr.sln
@@ -26,11 +26,7 @@ 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}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_gmf", "ml_gmf\ml_gmf.csproj", "{90D47D36-15A0-437E-957C-E1EF75C39657}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -62,17 +58,10 @@ 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
+ {90D47D36-15A0-437E-957C-E1EF75C39657}.Debug|x64.ActiveCfg = Debug|x64
+ {90D47D36-15A0-437E-957C-E1EF75C39657}.Debug|x64.Build.0 = Debug|x64
+ {90D47D36-15A0-437E-957C-E1EF75C39657}.Release|x64.ActiveCfg = Release|x64
+ {90D47D36-15A0-437E-957C-E1EF75C39657}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/ml_pvf/Properties/AssemblyInfo.cs b/ml_pvf/Properties/AssemblyInfo.cs
deleted file mode 100644
index b137375..0000000
--- a/ml_pvf/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-[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)]
\ No newline at end of file
diff --git a/ml_pvf/README.md b/ml_pvf/README.md
deleted file mode 100644
index 1a0c762..0000000
--- a/ml_pvf/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# 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.
diff --git a/ml_vgm/README.md b/ml_vgm/README.md
deleted file mode 100644
index eab98fe..0000000
--- a/ml_vgm/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# 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
diff --git a/ml_vgm/ml_vgm.csproj b/ml_vgm/ml_vgm.csproj
deleted file mode 100644
index 83505cb..0000000
--- a/ml_vgm/ml_vgm.csproj
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
- netstandard2.1
- x64
- ViveGesturesMovement
- 1.0.0
- SDraw
- None
- ViveGesturesMovement
-
-
-
-
-
-
-
-
- D:\games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\0Harmony.dll
- false
-
-
- D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp.dll
- false
-
-
- D:\games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\MelonLoader.dll
- false
-
-
- D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.dll
- false
-
-
- D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.CoreModule.dll
- false
-
-
-
-
-
-
-
-