mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
patch a different thing for OnRevealFact
This commit is contained in:
parent
f4cbe67678
commit
b61c25ff35
@ -1,5 +1,6 @@
|
||||
using HarmonyLib;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.OtherMods.AchievementsPlus;
|
||||
|
||||
namespace NewHorizons.Patches.ShipLogPatches
|
||||
{
|
||||
@ -20,5 +21,13 @@ namespace NewHorizons.Patches.ShipLogPatches
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(nameof(ShipLogFact.Reveal))]
|
||||
public static void ShipLogFact_Reveal(ShipLogFact __instance)
|
||||
{
|
||||
StarChartHandler.OnRevealFact(__instance.GetID());
|
||||
AchievementHandler.OnRevealFact();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ using HarmonyLib;
|
||||
using NewHorizons.Builder.ShipLog;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.OtherMods.AchievementsPlus;
|
||||
using NewHorizons.Utility.OWML;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@ -75,6 +74,7 @@ namespace NewHorizons.Patches.ShipLogPatches
|
||||
[HarmonyPatch(nameof(ShipLogManager.IsFactRevealed))]
|
||||
public static bool ShipLogManager_IsFactRevealed(ShipLogManager __instance, ref bool __result, string id)
|
||||
{
|
||||
// normally throws an error on not found
|
||||
if (__instance._factDict != null && __instance._factDict.ContainsKey(id))
|
||||
{
|
||||
__result = __instance._factDict[id].IsRevealed();
|
||||
@ -126,13 +126,5 @@ namespace NewHorizons.Patches.ShipLogPatches
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(nameof(ShipLogManager.RevealFact))]
|
||||
public static void ShipLogManager_RevealFact(string id)
|
||||
{
|
||||
StarChartHandler.OnRevealFact(id);
|
||||
AchievementHandler.OnRevealFact();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user