quantum-space-buddies/QSB/Tools/ProbePatches.cs
2020-11-03 21:11:10 +00:00

30 lines
843 B
C#

using QSB.Events;
namespace QSB.Tools
{
public class ProbePatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnModStart;
private static void ProbeAnchor()
{
GlobalMessenger.FireEvent(EventNames.QSBOnProbeAnchor);
}
private static bool ProbeWarp(ref bool ____isRetrieving)
{
if (!____isRetrieving)
{
GlobalMessenger.FireEvent(EventNames.QSBOnProbeWarp);
}
return true;
}
public override void DoPatches()
{
QSB.Helper.HarmonyHelper.AddPostfix<SurveyorProbe>("OnAnchor", typeof(ProbePatches), nameof(ProbeAnchor));
QSB.Helper.HarmonyHelper.AddPrefix<SurveyorProbe>("Retrieve", typeof(ProbePatches), nameof(ProbeWarp));
}
}
}