mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-05 07:49:22 +00:00
[MuteSFX] Deprecate because functionality is doable native
This commit is contained in:
parent
8cffe8a5be
commit
915253972d
8 changed files with 4 additions and 4 deletions
44
.Deprecated/MuteSFX/Main.cs
Normal file
44
.Deprecated/MuteSFX/Main.cs
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue