2020-11-03 21:42:14 +00:00
|
|
|
|
using QSB.EventsCore;
|
2020-08-07 20:39:07 +01:00
|
|
|
|
|
2020-08-20 21:07:40 +02:00
|
|
|
|
namespace QSB.Tools
|
2020-08-07 20:39:07 +01:00
|
|
|
|
{
|
2020-12-02 21:23:01 +00:00
|
|
|
|
public class ProbePatches : QSBPatch
|
|
|
|
|
{
|
|
|
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnModStart;
|
2020-11-03 21:11:10 +00:00
|
|
|
|
|
2020-12-02 21:23:01 +00:00
|
|
|
|
private static void ProbeAnchor()
|
|
|
|
|
{
|
|
|
|
|
GlobalMessenger.FireEvent(EventNames.QSBOnProbeAnchor);
|
|
|
|
|
}
|
2020-08-07 20:39:07 +01:00
|
|
|
|
|
2020-12-02 21:23:01 +00:00
|
|
|
|
private static bool ProbeWarp(ref bool ____isRetrieving)
|
|
|
|
|
{
|
|
|
|
|
if (!____isRetrieving)
|
|
|
|
|
{
|
|
|
|
|
GlobalMessenger.FireEvent(EventNames.QSBOnProbeWarp);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2020-08-07 20:39:07 +01:00
|
|
|
|
|
2020-12-02 21:23:01 +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));
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-03 08:28:05 +00:00
|
|
|
|
}
|