quantum-space-buddies/QSB/FrequencySync/Patches/FrequencyPatches.cs
2021-02-10 19:34:41 +00:00

29 lines
976 B
C#

using QSB.Events;
using QSB.Patches;
namespace QSB.FrequencySync.Patches
{
public class FrequencyPatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
public override void DoPatches()
{
QSBCore.Helper.HarmonyHelper.AddPostfix<AudioSignal>("IdentifyFrequency", typeof(FrequencyPatches), nameof(IdentifyFrequency));
QSBCore.Helper.HarmonyHelper.AddPostfix<AudioSignal>("IdentifySignal", typeof(FrequencyPatches), nameof(IdentifySignal));
}
public override void DoUnpatches()
{
QSBCore.Helper.HarmonyHelper.Unpatch<AudioSignal>("IdentifyFrequency");
QSBCore.Helper.HarmonyHelper.Unpatch<AudioSignal>("IdentifySignal");
}
public static void IdentifyFrequency(SignalFrequency ____frequency)
=> QSBEventManager.FireEvent(EventNames.QSBIdentifyFrequency, ____frequency);
public static void IdentifySignal(SignalName ____name)
=> QSBEventManager.FireEvent(EventNames.QSBIdentifySignal, ____name);
}
}