mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 18:39:23 +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
17
archived/ml_drs/Main.cs
Normal file
17
archived/ml_drs/Main.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using ABI_RC.Core.UI;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ml_drs
|
||||
{
|
||||
public class DesktopReticleSwitch : MelonLoader.MelonMod
|
||||
{
|
||||
public override void OnUpdate()
|
||||
{
|
||||
if(Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.R))
|
||||
{
|
||||
if((CohtmlHud.Instance != null) && (CohtmlHud.Instance.desktopPointer != null))
|
||||
CohtmlHud.Instance.desktopPointer.SetActive(!CohtmlHud.Instance.desktopPointer.activeSelf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
4
archived/ml_drs/Properties/AssemblyInfo.cs
Normal file
4
archived/ml_drs/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,4 @@
|
|||
[assembly: MelonLoader.MelonInfo(typeof(ml_drs.DesktopReticleSwitch), "DesktopReticleSwitch", "1.0.1", "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
archived/ml_drs/README.md
Normal file
10
archived/ml_drs/README.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Desktop Reticle Switch
|
||||
This mod allows to toggle desktop reticle.
|
||||
|
||||
# Installation
|
||||
* Install [latest MelonLoader](https://github.com/LavaGang/MelonLoader)
|
||||
* Get [latest release DLL](../../../releases/latest):
|
||||
* Put `ml_drs.dll` in `Mods` folder of game
|
||||
|
||||
# Usage
|
||||
* Press `LCtrl-R` combination to toggle desktop reticle
|
49
archived/ml_drs/ml_drs.csproj
Normal file
49
archived/ml_drs/ml_drs.csproj
Normal file
|
@ -0,0 +1,49 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<PackageId>DesktopReticleSwitch</PackageId>
|
||||
<Product>DesktopReticleSwitch</Product>
|
||||
<Authors>SDraw</Authors>
|
||||
<Company>None</Company>
|
||||
<Version>1.0.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DebugType>none</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="DesktopReticleSwitch.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="cohtml.Net">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\cohtml.Net.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.CoreModule">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.InputLegacyModule">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.InputLegacyModule.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>
|
161
archived/ml_egn/Main.cs
Normal file
161
archived/ml_egn/Main.cs
Normal file
|
@ -0,0 +1,161 @@
|
|||
using ABI_RC.Core.EventSystem;
|
||||
using ABI_RC.Core.IO;
|
||||
using ABI_RC.Core.Networking;
|
||||
using ABI_RC.Core.Util;
|
||||
using DarkRift.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ml_egn
|
||||
{
|
||||
public class ExtendedGameNotifications : MelonLoader.MelonMod
|
||||
{
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
HarmonyInstance.Patch(
|
||||
typeof(AssetManagement).GetMethod(nameof(AssetManagement.LoadLocalAvatar)),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(ExtendedGameNotifications).GetMethod(nameof(OnLocalAvatarLoad), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
HarmonyInstance.Patch(
|
||||
typeof(CVRSyncHelper).GetMethod(nameof(CVRSyncHelper.SpawnProp)),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(ExtendedGameNotifications).GetMethod(nameof(OnPropSpawned), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
HarmonyInstance.Patch(
|
||||
typeof(NetworkManager).GetMethod("OnGameNetworkConnectionClosed", BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(ExtendedGameNotifications).GetMethod(nameof(OnGameNetworkConnectionClosed), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
HarmonyInstance.Patch(
|
||||
typeof(CVRCamImageSaver).GetMethod(nameof(CVRCamImageSaver.SavePicture), BindingFlags.Public | BindingFlags.Static),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(ExtendedGameNotifications).GetMethod(nameof(OnPictureSave), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
HarmonyInstance.Patch(
|
||||
typeof(CVRSyncHelper).GetMethod(nameof(CVRSyncHelper.DeleteAllProps), BindingFlags.Public | BindingFlags.Static),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(ExtendedGameNotifications).GetMethod(nameof(OnAllPropsDelete), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
HarmonyInstance.Patch(
|
||||
typeof(CVRSyncHelper).GetMethod(nameof(CVRSyncHelper.DeleteMyProps), BindingFlags.Public | BindingFlags.Static),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(ExtendedGameNotifications).GetMethod(nameof(OnOwnPropsDelete), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
}
|
||||
|
||||
static void OnLocalAvatarLoad()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(Utils.IsMenuOpened())
|
||||
Utils.ShowMenuNotification("Avatar changed", 1f);
|
||||
else
|
||||
Utils.ShowHUDNotification("(Synced) Client", "Avatar changed");
|
||||
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnPropSpawned()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(Utils.ArePropsEnabled())
|
||||
{
|
||||
if(Utils.ArePropsAllowed())
|
||||
{
|
||||
if(Utils.IsConnected())
|
||||
{
|
||||
if(Utils.IsMenuOpened())
|
||||
Utils.ShowMenuNotification("Prop spawned", 1f);
|
||||
else
|
||||
Utils.ShowHUDNotification("(Synced) Client", "Prop spawned");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Utils.IsMenuOpened())
|
||||
Utils.ShowMenuAlert("Prop Error", "Not connected to live instance");
|
||||
else
|
||||
Utils.ShowHUDNotification("(Local) Client", "Unable to spawn prop", "Not connected to live instance");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Utils.IsMenuOpened())
|
||||
Utils.ShowMenuAlert("Prop Error", "Props are not allowed in this world");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Utils.IsMenuOpened())
|
||||
Utils.ShowMenuAlert("Prop Error", "Props are disabled in game settings");
|
||||
else
|
||||
Utils.ShowHUDNotification("(Local) Client", "Unable to spawn prop", "Props are disabled in game settings");
|
||||
}
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnGameNetworkConnectionClosed(DisconnectedEventArgs __1)
|
||||
{
|
||||
try
|
||||
{
|
||||
if((__1 != null) && (!__1.LocalDisconnect))
|
||||
Utils.ShowHUDNotification("(Local) Client", "Connection lost", (__1.Error != System.Net.Sockets.SocketError.Success) ? ("Reason: " + __1.Error.ToString()) : "", true);
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnPictureSave()
|
||||
{
|
||||
try
|
||||
{
|
||||
Utils.ShowHUDNotification("(Local) Client", "Screenshot saved");
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnAllPropsDelete()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(Utils.IsMenuOpened())
|
||||
Utils.ShowMenuNotification("Props are removed");
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnOwnPropsDelete()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(Utils.IsMenuOpened())
|
||||
Utils.ShowMenuNotification("Own props are removed");
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
4
archived/ml_egn/Properties/AssemblyInfo.cs
Normal file
4
archived/ml_egn/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,4 @@
|
|||
[assembly: MelonLoader.MelonInfo(typeof(ml_egn.ExtendedGameNotifications), "ExtendedGameNotifications", "1.0.3", "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)]
|
13
archived/ml_egn/README.md
Normal file
13
archived/ml_egn/README.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Extended Game Notifications
|
||||
This mod shows main menu notifications and HUD popups upon:
|
||||
* Avatar changing
|
||||
* Prop spawning/deletion
|
||||
* Server connection loss
|
||||
* Screenshot saving
|
||||
|
||||
Basically, merged previous `Avatar Change Info` and `Server Connection Info` mods in one.
|
||||
|
||||
# Installation
|
||||
* Install [latest MelonLoader](https://github.com/LavaGang/MelonLoader)
|
||||
* Get [latest release DLL](../../../releases/latest):
|
||||
* Put `ml_egn.dll` in `Mods` folder of game
|
50
archived/ml_egn/Utils.cs
Normal file
50
archived/ml_egn/Utils.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.Networking;
|
||||
using ABI_RC.Core.Savior;
|
||||
using ABI_RC.Core.UI;
|
||||
using DarkRift;
|
||||
|
||||
namespace ml_egn
|
||||
{
|
||||
static class Utils
|
||||
{
|
||||
public static bool IsMenuOpened()
|
||||
{
|
||||
return ((ViewManager.Instance != null) ? ViewManager.Instance.isGameMenuOpen() : false);
|
||||
}
|
||||
|
||||
public static void ShowMenuNotification(string p_message, float p_time = 1f)
|
||||
{
|
||||
if(ViewManager.Instance != null)
|
||||
ViewManager.Instance.TriggerPushNotification(p_message, p_time);
|
||||
}
|
||||
|
||||
public static void ShowMenuAlert(string p_title, string p_message)
|
||||
{
|
||||
if(ViewManager.Instance != null)
|
||||
ViewManager.Instance.TriggerAlert(p_title, p_message, -1, true);
|
||||
}
|
||||
|
||||
public static void ShowHUDNotification(string p_title, string p_message, string p_small = "", bool p_immediate = false)
|
||||
{
|
||||
if(CohtmlHud.Instance != null)
|
||||
{
|
||||
if(p_immediate)
|
||||
CohtmlHud.Instance.ViewDropTextImmediate(p_title, p_message, p_small);
|
||||
else
|
||||
CohtmlHud.Instance.ViewDropText(p_title, p_message, p_small);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsConnected()
|
||||
{
|
||||
bool l_result = false;
|
||||
if((NetworkManager.Instance != null) && (NetworkManager.Instance.GameNetwork != null))
|
||||
l_result = (NetworkManager.Instance.GameNetwork.ConnectionState == ConnectionState.Connected);
|
||||
return l_result;
|
||||
}
|
||||
|
||||
public static bool ArePropsAllowed() => ((MetaPort.Instance != null) && MetaPort.Instance.worldAllowProps);
|
||||
public static bool ArePropsEnabled() => ((MetaPort.Instance != null) && MetaPort.Instance.settings.GetSettingsBool("ContentFilterPropsEnabled"));
|
||||
}
|
||||
}
|
55
archived/ml_egn/ml_egn.csproj
Normal file
55
archived/ml_egn/ml_egn.csproj
Normal file
|
@ -0,0 +1,55 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<PackageId>ExtendedGameNotifications</PackageId>
|
||||
<Version>1.0.3</Version>
|
||||
<Authors>SDraw</Authors>
|
||||
<Company>None</Company>
|
||||
<Product>ExtendedGameNotifications</Product>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DebugType>none</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="ExtendedGameNotifications.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\0Harmony.dll</HintPath>
|
||||
</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="cohtml.Net">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\cohtml.Net.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="DarkRift">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\DarkRift.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="DarkRift.Client">
|
||||
<HintPath>D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\DarkRift.Client.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="MelonLoader">
|
||||
<HintPath>D:\Games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\MelonLoader.dll</HintPath>
|
||||
</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>
|
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