quantum-space-buddies/QSB/FrequencySync/Patches/FrequencyPatches.cs

29 lines
1005 B
C#
Raw Normal View History

2020-12-24 19:35:42 +00:00
using QSB.Events;
using QSB.Patches;
namespace QSB.FrequencySync.Patches
2020-12-24 19:35:42 +00:00
{
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));
}
2021-02-09 17:18:01 +00:00
public override void DoUnpatches()
{
QSBCore.Helper.HarmonyHelper.Unpatch<AudioSignal>("IdentifyFrequency");
QSBCore.Helper.HarmonyHelper.Unpatch<AudioSignal>("IdentifySignal");
}
2020-12-24 19:35:42 +00:00
public static void IdentifyFrequency(SignalFrequency ____frequency)
=> GlobalMessenger<SignalFrequency>.FireEvent(EventNames.QSBIdentifyFrequency, ____frequency);
public static void IdentifySignal(SignalName ____name)
=> GlobalMessenger<SignalName>.FireEvent(EventNames.QSBIdentifySignal, ____name);
}
}