mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
24 lines
No EOL
803 B
C#
24 lines
No EOL
803 B
C#
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;
|
|
} |