-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to MelonLoader 0.6.1
- Loading branch information
Showing
18 changed files
with
640 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\;D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\;D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\;D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\;D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ReferencePath>C:\Games\Steam\common\ChilloutVR\MelonLoader\;C:\Games\Steam\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\;D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\;D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\;D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\;D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\;D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\;D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
<ReferencePath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\;D:\Games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\</ReferencePath> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
using ABI_RC.Core.Player; | ||
using System; | ||
using System.Reflection; | ||
using ABI_RC.Core.InteractionSystem; | ||
using UnityEngine; | ||
|
||
namespace ml_prm | ||
{ | ||
public class PlayerRagdollMod : MelonLoader.MelonMod | ||
{ | ||
static PlayerRagdollMod ms_instance = null; | ||
|
||
RagdollController m_localController = null; | ||
|
||
public override void OnInitializeMelon() | ||
{ | ||
if(ms_instance == null) | ||
ms_instance = this; | ||
|
||
Settings.Init(); | ||
|
||
HarmonyInstance.Patch( | ||
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.ClearAvatar)), | ||
null, | ||
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnAvatarClear_Postfix), BindingFlags.NonPublic | BindingFlags.Static)) | ||
); | ||
HarmonyInstance.Patch( | ||
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.SetupAvatar)), | ||
null, | ||
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnSetupAvatar_Postfix), BindingFlags.Static | BindingFlags.NonPublic)) | ||
); | ||
HarmonyInstance.Patch( | ||
typeof(CVRSeat).GetMethod(nameof(CVRSeat.SitDown)), | ||
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnCVRSeatSitDown_Prefix), BindingFlags.Static | BindingFlags.NonPublic)), | ||
null | ||
); | ||
|
||
MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer()); | ||
} | ||
|
||
public override void OnDeinitializeMelon() | ||
{ | ||
if(ms_instance == this) | ||
ms_instance = null; | ||
} | ||
|
||
System.Collections.IEnumerator WaitForLocalPlayer() | ||
{ | ||
while(PlayerSetup.Instance == null) | ||
yield return null; | ||
|
||
m_localController = PlayerSetup.Instance.gameObject.AddComponent<RagdollController>(); | ||
} | ||
|
||
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear(); | ||
void OnAvatarClear() | ||
{ | ||
try | ||
{ | ||
if(m_localController != null) | ||
m_localController.OnAvatarClear(); | ||
} | ||
catch(Exception e) | ||
{ | ||
MelonLoader.MelonLogger.Error(e); | ||
} | ||
} | ||
|
||
static void OnSetupAvatar_Postfix() => ms_instance?.OnSetupAvatar(); | ||
void OnSetupAvatar() | ||
{ | ||
try | ||
{ | ||
if(m_localController != null) | ||
m_localController.OnAvatarSetup(); | ||
} | ||
catch(Exception e) | ||
{ | ||
MelonLoader.MelonLogger.Error(e); | ||
} | ||
} | ||
|
||
static void OnCVRSeatSitDown_Prefix(ref CVRSeat __instance) => ms_instance?.OnCVRSeatSitDown(__instance); | ||
void OnCVRSeatSitDown(CVRSeat p_seat) | ||
{ | ||
try | ||
{ | ||
if(m_localController != null) | ||
m_localController.OnSeatSitDown(p_seat); | ||
} | ||
catch(Exception e) | ||
{ | ||
MelonLoader.MelonLogger.Error(e); | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Reflection; | ||
|
||
[assembly: AssemblyTitle("PlayerRagdollMod")] | ||
[assembly: AssemblyVersion("1.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0")] | ||
|
||
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.0.0", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] | ||
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")] | ||
[assembly: MelonLoader.MelonPriority(2)] | ||
[assembly: MelonLoader.MelonOptionalDependencies("BTKUILib")] | ||
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] | ||
[assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Player Ragdoll Mod | ||
This mod turns your player's avatar into ragdoll puppet. | ||
|
||
# Installation | ||
* Install [latest MelonLoader](https://github.com/LavaGang/MelonLoader) | ||
* Get [latest release DLL](../../../releases/latest): | ||
* Put `ml_prm.dll` in `Mods` folder of game | ||
|
||
# Usage | ||
* Press `R` to turn into ragdoll and back. | ||
|
||
Optional mod's settings with [BTKUILib](https://github.com/BTK-Development/BTKUILib): | ||
* **Switch ragdoll:** turns into ragdoll state and back, made for VR usage primarily. | ||
* **Use hotkey:** enables/disables ragdoll state switch with `R` key; `true` by default. | ||
* **Restore position:** returns to position of ragdoll state activation upon ragdoll state exit; `false` by default. | ||
* **Velocity multiplier:** velocity force multiplier based on player's movement direction; `2.0` by default. | ||
|
||
# Notes | ||
* Incompatible with `Follow hips on IK override` option in AvatarMotionTweaker. | ||
* Even if locally ragdoll state is activated in the middle of playing emote, remote players still see whole emote animation. | ||
* Not suggested to activate fly mode with enabled ragdoll state. |
Oops, something went wrong.