mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
MutualMute: Stole name idea, now it's MutualMute
This commit is contained in:
parent
40bc88586e
commit
ac9af46bd6
5 changed files with 23 additions and 20 deletions
24
MutualMute/Main.cs
Normal file
24
MutualMute/Main.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System.Reflection;
|
||||
using ABI_RC.Systems.Communications.Audio.Components;
|
||||
using HarmonyLib;
|
||||
using MelonLoader;
|
||||
|
||||
namespace NAK.MutualMute;
|
||||
|
||||
public class MutualMuteMod : MelonMod
|
||||
{
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
HarmonyInstance.Patch(
|
||||
typeof(Comms_ParticipantPipeline).GetMethod(nameof(Comms_ParticipantPipeline.SetFlowControlState),
|
||||
BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
prefix: new HarmonyMethod(typeof(MutualMuteMod).GetMethod(nameof(OnSetFlowControlState),
|
||||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
}
|
||||
|
||||
private static void OnSetFlowControlState(
|
||||
ref bool state,
|
||||
Comms_ParticipantPipeline __instance)
|
||||
=> state &= !__instance._selfModerationMute;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue