mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Make eye coord prompt work in other systems
This commit is contained in:
parent
afdaeb6e30
commit
8439a58644
@ -3,6 +3,7 @@ using NewHorizons.Utility;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Xml.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using static NewHorizons.External.Configs.StarSystemConfig;
|
using static NewHorizons.External.Configs.StarSystemConfig;
|
||||||
|
|
||||||
@ -89,5 +90,12 @@ namespace NewHorizons.Handlers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool KnowsEyeCoordinates()
|
||||||
|
{
|
||||||
|
// Works normally in the main system, else check save data directly
|
||||||
|
if (Main.Instance.CurrentStarSystem == "SolarSystem") return Locator.GetShipLogManager().IsFactRevealed("OPC_EYE_COORDINATES_X1");
|
||||||
|
else return PlayerData._currentGameSave.shipLogFactSaves.ContainsKey("OPC_EYE_COORDINATES_X1");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,11 +9,16 @@ namespace NewHorizons.Patches
|
|||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(EyeCoordinatePromptTrigger), nameof(EyeCoordinatePromptTrigger.Update))]
|
[HarmonyPatch(typeof(EyeCoordinatePromptTrigger), nameof(EyeCoordinatePromptTrigger.Update))]
|
||||||
public static void EyeCoordinatePromptTrigger_Update(EyeCoordinatePromptTrigger __instance)
|
public static bool EyeCoordinatePromptTrigger_Update(EyeCoordinatePromptTrigger __instance)
|
||||||
{
|
{
|
||||||
var showPrompts = __instance._warpController.HasPower();
|
var showPrompts = __instance._warpController.HasPower();
|
||||||
|
|
||||||
|
// In other systems checking if the proper fact is revealed doesn't work, so we just overwrite this function
|
||||||
|
__instance._promptController.SetEyeCoordinatesVisibility(showPrompts && VesselCoordinatePromptHandler.KnowsEyeCoordinates());
|
||||||
|
|
||||||
VesselCoordinatePromptHandler.SetPromptVisibility(showPrompts);
|
VesselCoordinatePromptHandler.SetPromptVisibility(showPrompts);
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user