2022-03-02 19:46:33 -08:00

22 lines
747 B
C#

using HarmonyLib;
using QSB.Messaging;
using QSB.Patches;
using QSB.Tools.SignalscopeTool.FrequencySync.Messages;
namespace QSB.Tools.SignalscopeTool.FrequencySync.Patches;
[HarmonyPatch]
public class FrequencyPatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
[HarmonyPostfix]
[HarmonyPatch(typeof(AudioSignal), nameof(AudioSignal.IdentifyFrequency))]
public static void IdentifyFrequencyEvent(AudioSignal __instance)
=> new IdentifyFrequencyMessage(__instance._frequency).Send();
[HarmonyPostfix]
[HarmonyPatch(typeof(AudioSignal), nameof(AudioSignal.IdentifySignal))]
public static void IdentifySignalEvent(AudioSignal __instance)
=> new IdentifySignalMessage(__instance._name).Send();
}