mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
Move mods to Depricated folder.
This commit is contained in:
parent
e61f119f32
commit
5d1cb2ebec
70 changed files with 44 additions and 119 deletions
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netstandard1.0</TargetFramework>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="BTKUILib">
|
|
||||||
<HintPath>$(MsBuildThisFileDirectory)\..\.ManagedLibs\BTKUILib.dll</HintPath>
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
|
@ -6,9 +6,15 @@ namespace NAK.MuteSFX;
|
||||||
|
|
||||||
public static class AudioModuleManager
|
public static class AudioModuleManager
|
||||||
{
|
{
|
||||||
|
#region SFX Strings
|
||||||
|
|
||||||
public const string sfx_mute = "MuteSFX_sfx_mute";
|
public const string sfx_mute = "MuteSFX_sfx_mute";
|
||||||
public const string sfx_unmute = "MuteSFX_sfx_unmute";
|
public const string sfx_unmute = "MuteSFX_sfx_unmute";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
public static void SetupDefaultAudioClips()
|
public static void SetupDefaultAudioClips()
|
||||||
{
|
{
|
||||||
string path = Application.streamingAssetsPath + "/Cohtml/UIResources/GameUI/mods/MuteSFX/audio/";
|
string path = Application.streamingAssetsPath + "/Cohtml/UIResources/GameUI/mods/MuteSFX/audio/";
|
||||||
|
@ -42,8 +48,7 @@ public static class AudioModuleManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void PlayAudioModule(string module)
|
public static void PlayAudioModule(string module) => InterfaceAudio.PlayModule(module);
|
||||||
{
|
|
||||||
InterfaceAudio.PlayModule(module);
|
#endregion
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,11 +1,14 @@
|
||||||
using ABI_RC.Core.Base;
|
using ABI_RC.Core.Base;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
namespace NAK.MuteSFX;
|
namespace NAK.MuteSFX;
|
||||||
|
|
||||||
public class MuteSFX : MelonMod
|
public class MuteSFX : MelonMod
|
||||||
{
|
{
|
||||||
|
#region Mod Settings
|
||||||
|
|
||||||
internal static MelonLogger.Instance Logger;
|
internal static MelonLogger.Instance Logger;
|
||||||
internal const string SettingsCategory = nameof(MuteSFX);
|
internal const string SettingsCategory = nameof(MuteSFX);
|
||||||
|
|
||||||
|
@ -15,21 +18,39 @@ public class MuteSFX : MelonMod
|
||||||
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
|
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
|
||||||
Category.CreateEntry("Enabled", true, description: "Toggle MuteSFX entirely.");
|
Category.CreateEntry("Enabled", true, description: "Toggle MuteSFX entirely.");
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Melon Initialization
|
||||||
|
|
||||||
public override void OnInitializeMelon()
|
public override void OnInitializeMelon()
|
||||||
{
|
{
|
||||||
Logger = LoggerInstance;
|
Logger = LoggerInstance;
|
||||||
|
|
||||||
HarmonyInstance.Patch(
|
HarmonyInstance.Patch(
|
||||||
typeof(Audio).GetMethod(nameof(Audio.SetMicrophoneActive)),
|
typeof(AudioManagement).GetMethod(nameof(AudioManagement.SetMicrophoneActive)),
|
||||||
postfix: new HarmonyLib.HarmonyMethod(typeof(MuteSFX).GetMethod(nameof(OnSetMicrophoneActive_Postfix), BindingFlags.NonPublic | BindingFlags.Static))
|
postfix: new HarmonyMethod(typeof(MuteSFX).GetMethod(nameof(OnSetMicrophoneActive_Postfix), BindingFlags.NonPublic | BindingFlags.Static))
|
||||||
);
|
);
|
||||||
|
|
||||||
AudioModuleManager.SetupDefaultAudioClips();
|
AudioModuleManager.SetupDefaultAudioClips();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void OnSetMicrophoneActive_Postfix(bool muted)
|
#endregion
|
||||||
|
|
||||||
|
#region Patched Methods
|
||||||
|
|
||||||
|
private static void OnSetMicrophoneActive_Postfix(bool active)
|
||||||
{
|
{
|
||||||
if (EntryEnabled.Value)
|
try
|
||||||
AudioModuleManager.PlayAudioModule(muted ? AudioModuleManager.sfx_mute : AudioModuleManager.sfx_unmute);
|
{
|
||||||
|
if (EntryEnabled.Value)
|
||||||
|
AudioModuleManager.PlayAudioModule(active ? AudioModuleManager.sfx_unmute : AudioModuleManager.sfx_mute);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Error($"Error during the patched method {nameof(OnSetMicrophoneActive_Postfix)}");
|
||||||
|
Logger.Error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
|
@ -20,10 +20,13 @@ using System.Reflection;
|
||||||
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
||||||
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||||
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||||
|
[assembly: MelonColor(255, 146, 228, 146)]
|
||||||
|
[assembly: MelonAuthorColor(255, 158, 21, 32)]
|
||||||
|
[assembly: HarmonyDontPatchAll]
|
||||||
|
|
||||||
namespace NAK.MuteSFX.Properties;
|
namespace NAK.MuteSFX.Properties;
|
||||||
internal static class AssemblyInfoParams
|
internal static class AssemblyInfoParams
|
||||||
{
|
{
|
||||||
public const string Version = "1.0.0";
|
public const string Version = "1.0.1";
|
||||||
public const string Author = "NotAKidoS";
|
public const string Author = "NotAKidoS";
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"_id": 172,
|
"_id": 172,
|
||||||
"name": "MuteSFX",
|
"name": "MuteSFX",
|
||||||
"modversion": "1.0.0",
|
"modversion": "1.0.1",
|
||||||
"gameversion": "2022r170p1",
|
"gameversion": "2023r171",
|
||||||
"loaderversion": "0.6.1",
|
"loaderversion": "0.6.1",
|
||||||
"modtype": "Mod",
|
"modtype": "Mod",
|
||||||
"author": "Exterrata & NotAKidoS",
|
"author": "Exterrata & NotAKidoS",
|
||||||
|
@ -16,8 +16,8 @@
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"None"
|
"None"
|
||||||
],
|
],
|
||||||
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r13/MuteSFX.dll",
|
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r14/MuteSFX.dll",
|
||||||
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/MuteSFX/",
|
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/MuteSFX/",
|
||||||
"changelog": "- Initial CVRMG release",
|
"changelog": "- Fixes for 2023r171.",
|
||||||
"embedcolor": "92e492"
|
"embedcolor": "#92e492"
|
||||||
}
|
}
|
|
@ -1,55 +0,0 @@
|
||||||
using ABI_RC.Core.Player;
|
|
||||||
using ABI_RC.Core.Savior;
|
|
||||||
using MelonLoader;
|
|
||||||
using System.Reflection;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace NAK.ViewpointHeadScaleFix;
|
|
||||||
|
|
||||||
// Makes initialCameraPos scale with head bone scale
|
|
||||||
|
|
||||||
public class ViewpointHeadScaleFix : MelonMod
|
|
||||||
{
|
|
||||||
public override void OnInitializeMelon()
|
|
||||||
{
|
|
||||||
HarmonyInstance.Patch(
|
|
||||||
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.CalibrateAvatar)),
|
|
||||||
postfix: new HarmonyLib.HarmonyMethod(typeof(ViewpointHeadScaleFix).GetMethod(nameof(OnPlayerSetupCalibrateAvatar_Postfix), BindingFlags.NonPublic | BindingFlags.Static))
|
|
||||||
);
|
|
||||||
HarmonyInstance.Patch(
|
|
||||||
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.SetViewPointOffset)),
|
|
||||||
prefix: new HarmonyLib.HarmonyMethod(typeof(ViewpointHeadScaleFix).GetMethod(nameof(OnPlayerSetupSetViewPointOffset_Prefix), BindingFlags.NonPublic | BindingFlags.Static))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnPlayerSetupCalibrateAvatar_Postfix(ref PlayerSetup __instance)
|
|
||||||
{
|
|
||||||
if (!MetaPort.Instance.isUsingVr)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Transform headTransform = __instance._animator.GetBoneTransform(HumanBodyBones.Head);
|
|
||||||
if (headTransform == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_originalCameraPos = __instance.initialCameraPos;
|
|
||||||
_initialHeadScale = headTransform.localScale;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnPlayerSetupSetViewPointOffset_Prefix(ref PlayerSetup __instance)
|
|
||||||
{
|
|
||||||
if (!MetaPort.Instance.isUsingVr)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Transform headTransform = __instance._animator.GetBoneTransform(HumanBodyBones.Head);
|
|
||||||
if (headTransform == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
__instance.initialCameraPos = __instance.MultiplyVectors(
|
|
||||||
_originalCameraPos,
|
|
||||||
__instance.DivideVectors(headTransform.localScale, _initialHeadScale)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Vector3 _originalCameraPos = Vector3.one;
|
|
||||||
private static Vector3 _initialHeadScale = Vector3.one;
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
using MelonLoader;
|
|
||||||
using NAK.ViewpointHeadScaleFix.Properties;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
|
||||||
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
|
||||||
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
|
||||||
[assembly: AssemblyTitle(nameof(NAK.ViewpointHeadScaleFix))]
|
|
||||||
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
|
||||||
[assembly: AssemblyProduct(nameof(NAK.ViewpointHeadScaleFix))]
|
|
||||||
|
|
||||||
[assembly: MelonInfo(
|
|
||||||
typeof(NAK.ViewpointHeadScaleFix.ViewpointHeadScaleFix),
|
|
||||||
nameof(NAK.ViewpointHeadScaleFix),
|
|
||||||
AssemblyInfoParams.Version,
|
|
||||||
AssemblyInfoParams.Author,
|
|
||||||
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/AvatarScale"
|
|
||||||
)]
|
|
||||||
|
|
||||||
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
|
||||||
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
|
||||||
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
|
||||||
[assembly: MelonColor(255, 241, 200, 82)]
|
|
||||||
[assembly: MelonAuthorColor(255, 114, 17, 25)]
|
|
||||||
[assembly: HarmonyDontPatchAll]
|
|
||||||
|
|
||||||
namespace NAK.ViewpointHeadScaleFix.Properties;
|
|
||||||
internal static class AssemblyInfoParams
|
|
||||||
{
|
|
||||||
public const string Version = "1.0.0";
|
|
||||||
public const string Author = "NotAKidoS";
|
|
||||||
}
|
|
|
@ -1,2 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project Sdk="Microsoft.NET.Sdk"/>
|
|
Loading…
Add table
Add a link
Reference in a new issue