2020-12-24 19:35:42 +00:00
|
|
|
|
using QSB.Events;
|
|
|
|
|
using QSB.Patches;
|
|
|
|
|
|
2020-12-31 12:10:55 +00:00
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|