quantum-space-buddies/QSB/Tools/ProbePatches.cs

30 lines
843 B
C#
Raw Normal View History

2020-08-20 14:10:37 +01:00
using QSB.Events;
namespace QSB.Tools
{
2020-11-03 21:11:10 +00:00
public class ProbePatches : QSBPatch
{
2020-11-03 21:11:10 +00:00
public override QSBPatchTypes Type => QSBPatchTypes.OnModStart;
private static void ProbeAnchor()
{
2020-08-10 19:24:28 +02:00
GlobalMessenger.FireEvent(EventNames.QSBOnProbeAnchor);
}
private static bool ProbeWarp(ref bool ____isRetrieving)
{
if (!____isRetrieving)
{
2020-08-10 19:24:28 +02:00
GlobalMessenger.FireEvent(EventNames.QSBOnProbeWarp);
2020-08-20 19:31:10 +01:00
}
return true;
}
2020-11-03 21:11:10 +00:00
public override void DoPatches()
{
QSB.Helper.HarmonyHelper.AddPostfix<SurveyorProbe>("OnAnchor", typeof(ProbePatches), nameof(ProbeAnchor));
QSB.Helper.HarmonyHelper.AddPrefix<SurveyorProbe>("Retrieve", typeof(ProbePatches), nameof(ProbeWarp));
}
}
}