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

29 lines
702 B
C#
Raw Normal View History

2020-11-03 21:42:14 +00:00
using QSB.EventsCore;
namespace QSB.Tools
{
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-12-02 21:23:01 +00:00
private static bool ProbeWarp(ref bool ____isRetrieving)
{
if (!____isRetrieving)
{
GlobalMessenger.FireEvent(EventNames.QSBOnProbeWarp);
}
return true;
}
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
}