[MuteSFX] Deprecate because functionality is doable native

This commit is contained in:
NotAKidoS 2025-04-03 03:31:01 -05:00
parent 8cffe8a5be
commit 915253972d
8 changed files with 4 additions and 4 deletions

View file

@ -0,0 +1,55 @@
using ABI_RC.Core.AudioEffects;
using System.Reflection;
using UnityEngine;
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/";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
MuteSFX.Logger.Msg("Created MuteSFX/audio directory!");
}
string[] clipNames = { "sfx_mute.wav", "sfx_unmute.wav" };
foreach (string clipName in clipNames)
{
string clipPath = Path.Combine(path, clipName);
if (File.Exists(clipPath))
continue;
byte[] clipData;
string resourceName = "MuteSFX.SFX." + clipName;
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
{
if (stream == null) continue;
clipData = new byte[stream.Length];
stream.Read(clipData, 0, clipData.Length);
}
using (FileStream fileStream = new FileStream(clipPath, FileMode.CreateNew))
fileStream.Write(clipData, 0, clipData.Length);
MuteSFX.Logger.Msg("Placed missing sfx in audio folder: " + clipName);
}
}
public static void PlayAudioModule(string module) => InterfaceAudio.PlayModule(module);
#endregion
}

View file

@ -0,0 +1,44 @@
using MelonLoader;
using ABI_RC.Systems.GameEventSystem;
namespace NAK.MuteSFX;
public class MuteSFX : MelonMod
{
#region Mod Settings
internal static MelonLogger.Instance Logger;
private const string SettingsCategory = nameof(MuteSFX);
private static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(SettingsCategory);
private static readonly MelonPreferences_Entry<bool> EntryEnabled =
Category.CreateEntry("Enabled", true, description: "Toggle MuteSFX entirely.");
#endregion
#region Melon Initialization
public override void OnInitializeMelon()
{
Logger = LoggerInstance;
CVRGameEventSystem.Microphone.OnMute.AddListener(() => { OnMicrophoneStatusChanged(false); });
CVRGameEventSystem.Microphone.OnUnmute.AddListener(() => { OnMicrophoneStatusChanged(true); });
AudioModuleManager.SetupDefaultAudioClips();
}
#endregion
#region Patched Methods
private static void OnMicrophoneStatusChanged(bool active)
{
if (EntryEnabled.Value)
AudioModuleManager.PlayAudioModule(active ? AudioModuleManager.sfx_unmute : AudioModuleManager.sfx_mute);
}
#endregion
}

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<None Remove="SFX\sfx_mute.wav" />
<None Remove="SFX\sfx_unmute.wav" />
</ItemGroup>
<ItemGroup>
<Content Include="SFX\sfx_mute.wav" />
<Content Include="SFX\sfx_unmute.wav" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,32 @@
using MelonLoader;
using NAK.MuteSFX.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.MuteSFX))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.MuteSFX))]
[assembly: MelonInfo(
typeof(NAK.MuteSFX.MuteSFX),
nameof(NAK.MuteSFX),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/MuteSFX"
)]
[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.3";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,18 @@
# MuteSFX
A simple mod that makes the CVR_DesktopCameraController defaultFov adjustable.
The custom FOV setting is ignored if a world author specified a FOV other than 60f.
It is limited between 60f and 120f to match the limitations world creators have with setting custom FOV.
---
Here is the block of text where I tell you this mod is not affiliated or endorsed by ABI.
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
> This mod is an independent creation and is not affiliated with, supported by or approved by Alpha Blend Interactive.
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,23 @@
{
"_id": 172,
"name": "MuteSFX",
"modversion": "1.0.3",
"gameversion": "2023r171",
"loaderversion": "0.6.1",
"modtype": "Mod",
"author": "Exterrata & NotAKidoS",
"description": "A simple mod to add an audio cue for muting and unmuting.\n\nYou can replace the sfx in 'ChilloutVR\\ChilloutVR_Data\\StreamingAssets\\Cohtml\\UIResources\\GameUI\\mods\\MuteSFX\\audio'.",
"searchtags": [
"mute",
"unmute",
"audio",
"sound"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r20/MuteSFX.dll",
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/MuteSFX/",
"changelog": "- Fixed Push to Talk spamming SFX.",
"embedcolor": "#92e492"
}