quantum-space-buddies/QSB/LogSync/Patches/LogPatches.cs

24 lines
556 B
C#
Raw Normal View History

using HarmonyLib;
2021-12-25 05:28:41 +00:00
using QSB.LogSync.Messages;
using QSB.Messaging;
2020-12-19 10:56:25 +00:00
using QSB.Patches;
2022-03-03 03:46:33 +00:00
namespace QSB.LogSync.Patches;
[HarmonyPatch]
public class LogPatches : QSBPatch
2020-12-19 10:56:25 +00:00
{
2022-03-03 03:46:33 +00:00
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
2022-03-03 03:46:33 +00:00
[HarmonyPostfix]
[HarmonyPatch(typeof(ShipLogManager), nameof(ShipLogManager.RevealFact))]
public static void ShipLogManager_RevealFact(string id, bool saveGame, bool showNotification, bool __result)
{
if (!__result)
2020-12-19 10:56:25 +00:00
{
2022-03-03 03:46:33 +00:00
return;
}
2022-03-03 03:46:33 +00:00
new RevealFactMessage(id, saveGame, showNotification).Send();
2020-12-19 10:56:25 +00:00
}
}