2020-08-20 14:10:37 +01:00
|
|
|
|
using QSB.Events;
|
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-11-03 21:11:10 +00:00
|
|
|
|
public class ProbePatches : QSBPatch
|
2020-08-07 20:39:07 +01:00
|
|
|
|
{
|
2020-11-03 21:11:10 +00:00
|
|
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnModStart;
|
|
|
|
|
|
2020-08-07 20:39:07 +01:00
|
|
|
|
private static void ProbeAnchor()
|
|
|
|
|
{
|
2020-08-10 19:24:28 +02:00
|
|
|
|
GlobalMessenger.FireEvent(EventNames.QSBOnProbeAnchor);
|
2020-08-07 20:39:07 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
2020-08-07 20:39:07 +01:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-03 21:11:10 +00:00
|
|
|
|
public override void DoPatches()
|
2020-08-07 20:39:07 +01:00
|
|
|
|
{
|
2020-08-20 21:07:40 +02:00
|
|
|
|
QSB.Helper.HarmonyHelper.AddPostfix<SurveyorProbe>("OnAnchor", typeof(ProbePatches), nameof(ProbeAnchor));
|
|
|
|
|
QSB.Helper.HarmonyHelper.AddPrefix<SurveyorProbe>("Retrieve", typeof(ProbePatches), nameof(ProbeWarp));
|
2020-08-07 20:39:07 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|