Move mods to Depricated folder.

This commit is contained in:
NotAKidoS 2023-07-26 11:30:19 -05:00
parent e61f119f32
commit 5d1cb2ebec
70 changed files with 44 additions and 119 deletions

View file

@ -6,9 +6,15 @@ namespace NAK.MuteSFX;
public static class AudioModuleManager
{
#region SFX Strings
public const string sfx_mute = "MuteSFX_sfx_mute";
public const string sfx_unmute = "MuteSFX_sfx_unmute";
#endregion
#region Public Methods
public static void SetupDefaultAudioClips()
{
string path = Application.streamingAssetsPath + "/Cohtml/UIResources/GameUI/mods/MuteSFX/audio/";
@ -42,8 +48,7 @@ public static class AudioModuleManager
}
}
public static void PlayAudioModule(string module)
{
InterfaceAudio.PlayModule(module);
}
public static void PlayAudioModule(string module) => InterfaceAudio.PlayModule(module);
#endregion
}

View file

@ -1,11 +1,14 @@
using ABI_RC.Core.Base;
using MelonLoader;
using System.Reflection;
using HarmonyLib;
namespace NAK.MuteSFX;
public class MuteSFX : MelonMod
{
#region Mod Settings
internal static MelonLogger.Instance Logger;
internal const string SettingsCategory = nameof(MuteSFX);
@ -15,21 +18,39 @@ public class MuteSFX : MelonMod
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
Category.CreateEntry("Enabled", true, description: "Toggle MuteSFX entirely.");
#endregion
#region Melon Initialization
public override void OnInitializeMelon()
{
Logger = LoggerInstance;
HarmonyInstance.Patch(
typeof(Audio).GetMethod(nameof(Audio.SetMicrophoneActive)),
postfix: new HarmonyLib.HarmonyMethod(typeof(MuteSFX).GetMethod(nameof(OnSetMicrophoneActive_Postfix), BindingFlags.NonPublic | BindingFlags.Static))
typeof(AudioManagement).GetMethod(nameof(AudioManagement.SetMicrophoneActive)),
postfix: new HarmonyMethod(typeof(MuteSFX).GetMethod(nameof(OnSetMicrophoneActive_Postfix), BindingFlags.NonPublic | BindingFlags.Static))
);
AudioModuleManager.SetupDefaultAudioClips();
}
private static void OnSetMicrophoneActive_Postfix(bool muted)
#endregion
#region Patched Methods
private static void OnSetMicrophoneActive_Postfix(bool active)
{
if (EntryEnabled.Value)
AudioModuleManager.PlayAudioModule(muted ? AudioModuleManager.sfx_mute : AudioModuleManager.sfx_unmute);
try
{
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
}

View file

@ -20,10 +20,13 @@ using System.Reflection;
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: MelonColor(255, 146, 228, 146)]
[assembly: MelonAuthorColor(255, 158, 21, 32)]
[assembly: HarmonyDontPatchAll]
namespace NAK.MuteSFX.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.0";
public const string Version = "1.0.1";
public const string Author = "NotAKidoS";
}

View file

@ -1,8 +1,8 @@
{
"_id": 172,
"name": "MuteSFX",
"modversion": "1.0.0",
"gameversion": "2022r170p1",
"modversion": "1.0.1",
"gameversion": "2023r171",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "Exterrata & NotAKidoS",
@ -16,8 +16,8 @@
"requirements": [
"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/",
"changelog": "- Initial CVRMG release",
"embedcolor": "92e492"
"changelog": "- Fixes for 2023r171.",
"embedcolor": "#92e492"
}