mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix #586 and also __0 thing
This commit is contained in:
parent
4901d23db9
commit
31923d50c6
@ -73,11 +73,11 @@ namespace NewHorizons.Patches.ShipLogPatches
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(ShipLogManager.IsFactRevealed))]
|
[HarmonyPatch(nameof(ShipLogManager.IsFactRevealed))]
|
||||||
public static bool ShipLogManager_IsFactRevealed(ShipLogManager __instance, ref bool __result, string __0)
|
public static bool ShipLogManager_IsFactRevealed(ShipLogManager __instance, ref bool __result, string id)
|
||||||
{
|
{
|
||||||
if (__instance._factDict != null && __instance._factDict.ContainsKey(__0))
|
if (__instance._factDict != null && __instance._factDict.ContainsKey(id))
|
||||||
{
|
{
|
||||||
__result = __instance._factDict[__0].IsRevealed();
|
__result = __instance._factDict[id].IsRevealed();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -129,10 +129,9 @@ namespace NewHorizons.Patches.ShipLogPatches
|
|||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(nameof(ShipLogManager.RevealFact))]
|
[HarmonyPatch(nameof(ShipLogManager.RevealFact))]
|
||||||
public static void ShipLogManager_RevealFact(string __0)
|
public static void ShipLogManager_RevealFact(string id)
|
||||||
{
|
{
|
||||||
StarChartHandler.OnRevealFact(__0);
|
StarChartHandler.OnRevealFact(id);
|
||||||
|
|
||||||
AchievementHandler.OnRevealFact();
|
AchievementHandler.OnRevealFact();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,30 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
namespace NewHorizons.Patches.ShipLogPatches
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(SlideCollectionContainer))]
|
||||||
|
public static class SlideCollectionContainerPatches
|
||||||
|
{
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(SlideCollectionContainer), nameof(SlideCollectionContainer.Initialize))]
|
||||||
|
public static bool SlideCollectionContainer_Initialize(SlideCollectionContainer __instance, string id)
|
||||||
|
{
|
||||||
|
if (__instance._initialized)
|
||||||
|
return false;
|
||||||
|
__instance.SetupReadFlags();
|
||||||
|
__instance.RegisterPerSlideCompletion();
|
||||||
|
if (__instance.streamingTexturesAvailable)
|
||||||
|
__instance.SetupStreaming();
|
||||||
|
__instance.BuildMusicRangesIndex();
|
||||||
|
__instance._changeSlidesAllowed = true;
|
||||||
|
__instance._initialized = true;
|
||||||
|
__instance._slideCollection.isVision = __instance._owningItem == null;
|
||||||
|
foreach (var factID in __instance._playWithShipLogFacts)
|
||||||
|
{
|
||||||
|
var fact = Locator.GetShipLogManager().GetFact(factID);
|
||||||
|
fact?.RegisterSlideCollection(__instance._slideCollection);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user