mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
do another pass on patches
This commit is contained in:
parent
6ecdc3d7a1
commit
577472c21b
@ -16,9 +16,9 @@ namespace NewHorizons.Patches.CameraPatches
|
|||||||
|
|
||||||
// These layers were left on because it doesnt come up in base game (Dreamworld is inactive, player is far away)
|
// These layers were left on because it doesnt come up in base game (Dreamworld is inactive, player is far away)
|
||||||
__instance._camera.mainCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("DreamSimulation"));
|
__instance._camera.mainCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("DreamSimulation"));
|
||||||
__instance._camera.mainCamera.cullingMask &= ~(1 <<LayerMask.NameToLayer("UI"));
|
__instance._camera.mainCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("UI"));
|
||||||
__instance._camera.mainCamera.cullingMask &= ~(1 <<LayerMask.NameToLayer("HeadsUpDisplay"));
|
__instance._camera.mainCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("HeadsUpDisplay"));
|
||||||
__instance._camera.mainCamera.cullingMask &= ~(1 <<LayerMask.NameToLayer("HelmetUVPass"));
|
__instance._camera.mainCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("HelmetUVPass"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ namespace NewHorizons.Patches.CameraPatches
|
|||||||
{
|
{
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(nameof(OWCamera.Awake))]
|
[HarmonyPatch(nameof(OWCamera.Awake))]
|
||||||
public static void OnOWCameraAwake(OWCamera __instance)
|
public static void OWCamera_Awake(OWCamera __instance)
|
||||||
{
|
{
|
||||||
if (Main.SystemDict.TryGetValue(Main.Instance.CurrentStarSystem, out var system) && system?.Config?.farClipPlaneOverride != 0f)
|
if (Main.SystemDict.TryGetValue(Main.Instance.CurrentStarSystem, out var system) && system?.Config?.farClipPlaneOverride != 0f)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,18 +1,14 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NewHorizons.Utility;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace NewHorizons.Patches.CreditsScene
|
namespace NewHorizons.Patches.CreditsScenePatches
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(CreditsEntry))]
|
[HarmonyPatch(typeof(CreditsEntry))]
|
||||||
public static class CreditsEntryPatches
|
public static class CreditsEntryPatches
|
||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(CreditsEntry.SetContents))]
|
[HarmonyPatch(nameof(CreditsEntry.SetContents))]
|
||||||
public static bool CreditsEntry_SetContents(CreditsEntry __instance, string[] __0)
|
public static bool CreditsEntry_SetContents(CreditsEntry __instance, string[] columnTexts)
|
||||||
{
|
{
|
||||||
var columnTexts = __0;
|
|
||||||
|
|
||||||
for (int i = 0; i < __instance._columns.Length; i++)
|
for (int i = 0; i < __instance._columns.Length; i++)
|
||||||
{
|
{
|
||||||
// Base method throws out of bounds exception sometimes (_columns length doesn't match columnTexts length)
|
// Base method throws out of bounds exception sometimes (_columns length doesn't match columnTexts length)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
|
|
||||||
namespace NewHorizons.Patches.CreditsScene
|
namespace NewHorizons.Patches.CreditsScenePatches
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(Credits))]
|
[HarmonyPatch(typeof(Credits))]
|
||||||
public static class CreditsPatches
|
public static class CreditsPatches
|
||||||
|
|||||||
@ -3,7 +3,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace NewHorizons.Patches.DetectorPatches
|
namespace NewHorizons.Patches.DetectorPatches
|
||||||
{
|
{
|
||||||
[HarmonyPatch]
|
[HarmonyPatch(typeof(AlignToSurfaceFluidDetector))]
|
||||||
public static class AlignToSurfaceFluidDetectorPatches
|
public static class AlignToSurfaceFluidDetectorPatches
|
||||||
{
|
{
|
||||||
[HarmonyReversePatch]
|
[HarmonyReversePatch]
|
||||||
@ -14,7 +14,7 @@ namespace NewHorizons.Patches.DetectorPatches
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(AlignToSurfaceFluidDetector), nameof(AlignToSurfaceFluidDetector.ManagedFixedUpdate))]
|
[HarmonyPatch(nameof(AlignToSurfaceFluidDetector.ManagedFixedUpdate))]
|
||||||
public static bool AlignToSurfaceFluidDetector_ManagedFixedUpdate(AlignToSurfaceFluidDetector __instance)
|
public static bool AlignToSurfaceFluidDetector_ManagedFixedUpdate(AlignToSurfaceFluidDetector __instance)
|
||||||
{
|
{
|
||||||
if (__instance._alignmentFluid is not RadialFluidVolume) return true;
|
if (__instance._alignmentFluid is not RadialFluidVolume) return true;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace NewHorizons.Patches.EchoesOfTheEyePatches
|
namespace NewHorizons.Patches.EchoesOfTheEyePatches
|
||||||
{
|
{
|
||||||
[HarmonyPatch]
|
[HarmonyPatch(typeof(VisionTorchItem))]
|
||||||
public static class VisionTorchItemPatches
|
public static class VisionTorchItemPatches
|
||||||
{
|
{
|
||||||
// This is some dark magic
|
// This is some dark magic
|
||||||
@ -15,7 +15,7 @@ namespace NewHorizons.Patches.EchoesOfTheEyePatches
|
|||||||
|
|
||||||
// Make the vision torch droppable. In the base game you can only drop it if you're in the dream world.
|
// Make the vision torch droppable. In the base game you can only drop it if you're in the dream world.
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(VisionTorchItem), nameof(VisionTorchItem.DropItem))]
|
[HarmonyPatch(nameof(VisionTorchItem.DropItem))]
|
||||||
public static bool VisionTorchItem_DropItem(VisionTorchItem __instance, Vector3 position, Vector3 normal, Transform parent, Sector sector, IItemDropTarget customDropTarget)
|
public static bool VisionTorchItem_DropItem(VisionTorchItem __instance, Vector3 position, Vector3 normal, Transform parent, Sector sector, IItemDropTarget customDropTarget)
|
||||||
{
|
{
|
||||||
if (!Locator.GetDreamWorldController().IsInDream())
|
if (!Locator.GetDreamWorldController().IsInDream())
|
||||||
|
|||||||
@ -20,7 +20,7 @@ namespace NewHorizons.Patches.MapPatches
|
|||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(nameof(MapController.OnTargetReferenceFrame))]
|
[HarmonyPatch(nameof(MapController.OnTargetReferenceFrame))]
|
||||||
public static void MapController_OnTargetReferenceFrame(MapController __instance, ReferenceFrame __0)
|
public static void MapController_OnTargetReferenceFrame(MapController __instance, ReferenceFrame referenceFrame)
|
||||||
{
|
{
|
||||||
// Locked onto map satellite just means it will move vertically up from the plane of the solar system
|
// Locked onto map satellite just means it will move vertically up from the plane of the solar system
|
||||||
__instance._isLockedOntoMapSatellite = true;
|
__instance._isLockedOntoMapSatellite = true;
|
||||||
|
|||||||
@ -10,6 +10,7 @@ namespace NewHorizons.Patches
|
|||||||
public static void MeteorController_Suspend(MeteorController __instance)
|
public static void MeteorController_Suspend(MeteorController __instance)
|
||||||
{
|
{
|
||||||
// Meteors launch inactive because of prefab. So let's fix that.
|
// Meteors launch inactive because of prefab. So let's fix that.
|
||||||
|
// how tf does this work
|
||||||
__instance.gameObject.SetActive(true);
|
__instance.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,11 +15,10 @@ namespace NewHorizons.Patches.PlayerPatches
|
|||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(PlayerData.KnowsFrequency))]
|
[HarmonyPatch(nameof(PlayerData.KnowsFrequency))]
|
||||||
public static bool OnPlayerDataKnowsFrequency(SignalFrequency __0, ref bool __result)
|
public static bool PlayerData_KnowsFrequency(SignalFrequency frequency, ref bool __result)
|
||||||
{
|
{
|
||||||
var freqString = SignalBuilder.GetCustomFrequencyName(__0);
|
var freqString = SignalBuilder.GetCustomFrequencyName(frequency);
|
||||||
|
if (!string.IsNullOrEmpty(freqString))
|
||||||
if (freqString != null && freqString != "")
|
|
||||||
{
|
{
|
||||||
__result = NewHorizonsData.KnowsFrequency(freqString);
|
__result = NewHorizonsData.KnowsFrequency(freqString);
|
||||||
return false;
|
return false;
|
||||||
@ -29,10 +28,10 @@ namespace NewHorizons.Patches.PlayerPatches
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(PlayerData.LearnFrequency))]
|
[HarmonyPatch(nameof(PlayerData.LearnFrequency))]
|
||||||
public static bool OnPlayerDataLearnFrequency(SignalFrequency __0)
|
public static bool PlayerData_LearnFrequency(SignalFrequency frequency)
|
||||||
{
|
{
|
||||||
var freqString = SignalBuilder.GetCustomFrequencyName(__0);
|
var freqString = SignalBuilder.GetCustomFrequencyName(frequency);
|
||||||
if (freqString != null && freqString != "")
|
if (!string.IsNullOrEmpty(freqString))
|
||||||
{
|
{
|
||||||
NewHorizonsData.LearnFrequency(freqString);
|
NewHorizonsData.LearnFrequency(freqString);
|
||||||
NewFrequencyAchievement.Earn();
|
NewFrequencyAchievement.Earn();
|
||||||
@ -43,10 +42,10 @@ namespace NewHorizons.Patches.PlayerPatches
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(PlayerData.KnowsSignal))]
|
[HarmonyPatch(nameof(PlayerData.KnowsSignal))]
|
||||||
public static bool OnPlayerDataKnowsSignal(SignalName __0, ref bool __result)
|
public static bool PlayerData_KnowsSignal(SignalName signalName, ref bool __result)
|
||||||
{
|
{
|
||||||
var customSignalName = SignalBuilder.GetCustomSignalName(__0);
|
var customSignalName = SignalBuilder.GetCustomSignalName(signalName);
|
||||||
if (customSignalName != null)
|
if (!string.IsNullOrEmpty(customSignalName))
|
||||||
{
|
{
|
||||||
__result = NewHorizonsData.KnowsSignal(customSignalName);
|
__result = NewHorizonsData.KnowsSignal(customSignalName);
|
||||||
return false;
|
return false;
|
||||||
@ -56,10 +55,10 @@ namespace NewHorizons.Patches.PlayerPatches
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(PlayerData.LearnSignal))]
|
[HarmonyPatch(nameof(PlayerData.LearnSignal))]
|
||||||
public static bool OnPlayerDataLearnSignal(SignalName __0)
|
public static bool PlayerData_LearnSignal(SignalName signalName)
|
||||||
{
|
{
|
||||||
var customSignalName = SignalBuilder.GetCustomSignalName(__0);
|
var customSignalName = SignalBuilder.GetCustomSignalName(signalName);
|
||||||
if (customSignalName != null)
|
if (!string.IsNullOrEmpty(customSignalName))
|
||||||
{
|
{
|
||||||
if (!NewHorizonsData.KnowsSignal(customSignalName))
|
if (!NewHorizonsData.KnowsSignal(customSignalName))
|
||||||
{
|
{
|
||||||
@ -75,7 +74,7 @@ namespace NewHorizons.Patches.PlayerPatches
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(PlayerData.KnowsMultipleFrequencies))]
|
[HarmonyPatch(nameof(PlayerData.KnowsMultipleFrequencies))]
|
||||||
public static bool OnPlayerDataKnowsMultipleFrequencies(ref bool __result)
|
public static bool PlayerData_KnowsMultipleFrequencies(ref bool __result)
|
||||||
{
|
{
|
||||||
if (NewHorizonsData.KnowsMultipleFrequencies())
|
if (NewHorizonsData.KnowsMultipleFrequencies())
|
||||||
{
|
{
|
||||||
@ -87,22 +86,19 @@ namespace NewHorizons.Patches.PlayerPatches
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(PlayerData.AddNewlyRevealedFactID))]
|
[HarmonyPatch(nameof(PlayerData.AddNewlyRevealedFactID))]
|
||||||
public static bool OnPlayerDataAddNewlyRevealedFactID(string __0)
|
public static bool PlayerData_AddNewlyRevealedFactID(string id)
|
||||||
{
|
{
|
||||||
if (ShipLogHandler.IsModdedFact(__0))
|
if (ShipLogHandler.IsModdedFact(id))
|
||||||
{
|
{
|
||||||
NewHorizonsData.AddNewlyRevealedFactID(__0);
|
NewHorizonsData.AddNewlyRevealedFactID(id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
return true;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(PlayerData.GetNewlyRevealedFactIDs))]
|
[HarmonyPatch(nameof(PlayerData.GetNewlyRevealedFactIDs))]
|
||||||
public static bool OnPlayerDataGetNewlyRevealedFactIDs(ref List<string> __result)
|
public static bool PlayerData_GetNewlyRevealedFactIDs_Prefix(ref List<string> __result)
|
||||||
{
|
{
|
||||||
var newHorizonsNewlyRevealedFactIDs = NewHorizonsData.GetNewlyRevealedFactIDs();
|
var newHorizonsNewlyRevealedFactIDs = NewHorizonsData.GetNewlyRevealedFactIDs();
|
||||||
if (newHorizonsNewlyRevealedFactIDs != null)
|
if (newHorizonsNewlyRevealedFactIDs != null)
|
||||||
@ -110,35 +106,30 @@ namespace NewHorizons.Patches.PlayerPatches
|
|||||||
__result = PlayerData._currentGameSave.newlyRevealedFactIDs.Concat(newHorizonsNewlyRevealedFactIDs).ToList();
|
__result = PlayerData._currentGameSave.newlyRevealedFactIDs.Concat(newHorizonsNewlyRevealedFactIDs).ToList();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
Logger.LogError("Newly Revealed Fact IDs is null!");
|
||||||
{
|
return true;
|
||||||
Logger.LogError("Newly Revealed Fact IDs is null!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[HarmonyPrefix]
|
|
||||||
[HarmonyPatch(nameof(PlayerData.ClearNewlyRevealedFactIDs))]
|
|
||||||
public static bool OnPlayerDataClearNewlyRevealedFactIDs()
|
|
||||||
{
|
|
||||||
PlayerData._currentGameSave.newlyRevealedFactIDs.Clear();
|
|
||||||
NewHorizonsData.ClearNewlyRevealedFactIDs();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HarmonyPostfix]
|
|
||||||
[HarmonyPatch(nameof(PlayerData.ResetGame))]
|
|
||||||
public static void OnPlayerDataResetGame()
|
|
||||||
{
|
|
||||||
NewHorizonsData.Reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(nameof(PlayerData.GetNewlyRevealedFactIDs))]
|
[HarmonyPatch(nameof(PlayerData.GetNewlyRevealedFactIDs))]
|
||||||
public static void PlayerData_GetNewlyRevealedFactIDs(ref List<string> __result)
|
public static void PlayerData_GetNewlyRevealedFactIDs_Postfix(ref List<string> __result)
|
||||||
{
|
{
|
||||||
ShipLogManager manager = Locator.GetShipLogManager();
|
var manager = Locator.GetShipLogManager();
|
||||||
__result = __result.Where(e => manager.GetFact(e) != null).ToList();
|
__result = __result.Where(id => manager.GetFact(id) != null).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(nameof(PlayerData.ClearNewlyRevealedFactIDs))]
|
||||||
|
public static void PlayerData_ClearNewlyRevealedFactIDs()
|
||||||
|
{
|
||||||
|
NewHorizonsData.ClearNewlyRevealedFactIDs();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(nameof(PlayerData.ResetGame))]
|
||||||
|
public static void PlayerData_ResetGame()
|
||||||
|
{
|
||||||
|
NewHorizonsData.Reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,15 +9,15 @@ namespace NewHorizons.Patches.ShipLogPatches
|
|||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(UIStyleManager.GetCuriosityColor))]
|
[HarmonyPatch(nameof(UIStyleManager.GetCuriosityColor))]
|
||||||
public static bool UIStyleManager_GetCuriosityColor(UIStyleManager __instance, CuriosityName __0, bool __1, ref Color __result)
|
public static bool UIStyleManager_GetCuriosityColor(UIStyleManager __instance, CuriosityName curiosityName, bool highlight, ref Color __result)
|
||||||
{
|
{
|
||||||
if ((int)__0 < 7)
|
if ((int)curiosityName < 7)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
__result = RumorModeBuilder.GetCuriosityColor(__0, __1, __instance._neutralColor, __instance._neutralHighlight);
|
__result = RumorModeBuilder.GetCuriosityColor(curiosityName, highlight, __instance._neutralColor, __instance._neutralHighlight);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,9 +12,9 @@ namespace NewHorizons.Patches.SignalPatches
|
|||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(AudioSignal.SignalNameToString))]
|
[HarmonyPatch(nameof(AudioSignal.SignalNameToString))]
|
||||||
public static bool AudioSignal_SignalNameToString(SignalName __0, ref string __result)
|
public static bool AudioSignal_SignalNameToString(SignalName name, ref string __result)
|
||||||
{
|
{
|
||||||
var customSignalName = SignalBuilder.GetCustomSignalName(__0);
|
var customSignalName = SignalBuilder.GetCustomSignalName(name);
|
||||||
if (!string.IsNullOrEmpty(customSignalName))
|
if (!string.IsNullOrEmpty(customSignalName))
|
||||||
{
|
{
|
||||||
__result = TranslationHandler.GetTranslation(customSignalName, TranslationHandler.TextType.UI, false).ToUpper();
|
__result = TranslationHandler.GetTranslation(customSignalName, TranslationHandler.TextType.UI, false).ToUpper();
|
||||||
@ -25,9 +25,9 @@ namespace NewHorizons.Patches.SignalPatches
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(AudioSignal.FrequencyToIndex))]
|
[HarmonyPatch(nameof(AudioSignal.FrequencyToIndex))]
|
||||||
public static bool AudioSignal_FrequencyToIndex(SignalFrequency __0, ref int __result)
|
public static bool AudioSignal_FrequencyToIndex(SignalFrequency frequency, out int __result)
|
||||||
{
|
{
|
||||||
__result = __0 switch
|
__result = frequency switch
|
||||||
{
|
{
|
||||||
SignalFrequency.Default => 0,
|
SignalFrequency.Default => 0,
|
||||||
SignalFrequency.Traveler => 1,
|
SignalFrequency.Traveler => 1,
|
||||||
@ -37,16 +37,16 @@ namespace NewHorizons.Patches.SignalPatches
|
|||||||
SignalFrequency.HideAndSeek => 5,
|
SignalFrequency.HideAndSeek => 5,
|
||||||
SignalFrequency.Radio => 6,
|
SignalFrequency.Radio => 6,
|
||||||
SignalFrequency.Statue => 7,
|
SignalFrequency.Statue => 7,
|
||||||
_ => (int)(Mathf.Log((float)__0) / Mathf.Log(2f)),// Frequencies are in powers of 2
|
_ => (int)(Mathf.Log((float)frequency) / Mathf.Log(2f)),// Frequencies are in powers of 2
|
||||||
};
|
};
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(AudioSignal.IndexToFrequency))]
|
[HarmonyPatch(nameof(AudioSignal.IndexToFrequency))]
|
||||||
public static bool AudioSignal_IndexToFrequency(int __0, ref SignalFrequency __result)
|
public static bool AudioSignal_IndexToFrequency(int index, out SignalFrequency __result)
|
||||||
{
|
{
|
||||||
__result = __0 switch
|
__result = index switch
|
||||||
{
|
{
|
||||||
0 => SignalFrequency.Default,
|
0 => SignalFrequency.Default,
|
||||||
1 => SignalFrequency.Traveler,
|
1 => SignalFrequency.Traveler,
|
||||||
@ -56,16 +56,16 @@ namespace NewHorizons.Patches.SignalPatches
|
|||||||
5 => SignalFrequency.HideAndSeek,
|
5 => SignalFrequency.HideAndSeek,
|
||||||
6 => SignalFrequency.Radio,
|
6 => SignalFrequency.Radio,
|
||||||
7 => SignalFrequency.Statue,
|
7 => SignalFrequency.Statue,
|
||||||
_ => (SignalFrequency)Math.Pow(2, __0),
|
_ => (SignalFrequency)Math.Pow(2, index),
|
||||||
};
|
};
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(AudioSignal.FrequencyToString))]
|
[HarmonyPatch(nameof(AudioSignal.FrequencyToString))]
|
||||||
public static bool AudioSignal_FrequencyToString(SignalFrequency __0, ref string __result)
|
public static bool AudioSignal_FrequencyToString(SignalFrequency frequency, ref string __result)
|
||||||
{
|
{
|
||||||
var customName = SignalBuilder.GetCustomFrequencyName(__0);
|
var customName = SignalBuilder.GetCustomFrequencyName(frequency);
|
||||||
if (!string.IsNullOrEmpty(customName))
|
if (!string.IsNullOrEmpty(customName))
|
||||||
{
|
{
|
||||||
if (NewHorizonsData.KnowsFrequency(customName)) __result = TranslationHandler.GetTranslation(customName, TranslationHandler.TextType.UI, false).ToUpper();
|
if (NewHorizonsData.KnowsFrequency(customName)) __result = TranslationHandler.GetTranslation(customName, TranslationHandler.TextType.UI, false).ToUpper();
|
||||||
|
|||||||
@ -15,9 +15,8 @@ namespace NewHorizons.Patches.SignalPatches
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(Signalscope.SwitchFrequencyFilter))]
|
[HarmonyPatch(nameof(Signalscope.SwitchFrequencyFilter))]
|
||||||
public static bool Signalscope_SwitchFrequencyFilter(Signalscope __instance, int __0)
|
public static bool Signalscope_SwitchFrequencyFilter(Signalscope __instance, int increment)
|
||||||
{
|
{
|
||||||
var increment = __0;
|
|
||||||
var count = SignalBuilder.NumberOfFrequencies;
|
var count = SignalBuilder.NumberOfFrequencies;
|
||||||
__instance._frequencyFilterIndex += increment;
|
__instance._frequencyFilterIndex += increment;
|
||||||
__instance._frequencyFilterIndex = __instance._frequencyFilterIndex >= count ? 0 : __instance._frequencyFilterIndex;
|
__instance._frequencyFilterIndex = __instance._frequencyFilterIndex >= count ? 0 : __instance._frequencyFilterIndex;
|
||||||
|
|||||||
@ -9,7 +9,7 @@ namespace NewHorizons.Patches.ToolPatches
|
|||||||
// This is to stop the game throwing too many errors if the probe is destroyed by a blackhole
|
// This is to stop the game throwing too many errors if the probe is destroyed by a blackhole
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(SurveyorProbe.IsLaunched))]
|
[HarmonyPatch(nameof(SurveyorProbe.IsLaunched))]
|
||||||
public static bool SurveyorProbe_IsLaunched(SurveyorProbe __instance, ref bool __result)
|
public static bool SurveyorProbe_IsLaunched(SurveyorProbe __instance, out bool __result)
|
||||||
{
|
{
|
||||||
__result = __instance?.gameObject?.activeSelf ?? false;
|
__result = __instance?.gameObject?.activeSelf ?? false;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -8,14 +8,14 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace NewHorizons.Patches.VolumePatches
|
namespace NewHorizons.Patches.VolumePatches
|
||||||
{
|
{
|
||||||
[HarmonyPatch]
|
[HarmonyPatch(typeof(DestructionVolume))]
|
||||||
public static class DestructionVolumePatches
|
public static class DestructionVolumePatches
|
||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(DestructionVolume), nameof(DestructionVolume.Vanish))]
|
[HarmonyPatch(nameof(DestructionVolume.Vanish))]
|
||||||
public static bool DestructionVolume_Vanish(OWRigidbody __0)
|
public static bool DestructionVolume_Vanish(OWRigidbody bodyToVanish)
|
||||||
{
|
{
|
||||||
var quantumPlanet = __0.gameObject.GetComponent<QuantumPlanet>();
|
var quantumPlanet = bodyToVanish.gameObject.GetComponent<QuantumPlanet>();
|
||||||
|
|
||||||
if (quantumPlanet == null) return true;
|
if (quantumPlanet == null) return true;
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ namespace NewHorizons.Patches.VolumePatches
|
|||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(SphericalFogWarpVolume), nameof(SphericalFogWarpVolume.IsProbeOnly))]
|
[HarmonyPatch(typeof(SphericalFogWarpVolume), nameof(SphericalFogWarpVolume.IsProbeOnly))]
|
||||||
public static bool SphericalFogWarpVolume_IsProbeOnly(SphericalFogWarpVolume __instance, ref bool __result)
|
public static bool SphericalFogWarpVolume_IsProbeOnly(SphericalFogWarpVolume __instance, out bool __result)
|
||||||
{
|
{
|
||||||
__result = Mathf.Approximately(__instance._exitRadius / __instance._warpRadius, 2f); // Check the ratio between these to determine if seed, instead of just < 10
|
__result = Mathf.Approximately(__instance._exitRadius / __instance._warpRadius, 2f); // Check the ratio between these to determine if seed, instead of just < 10
|
||||||
return false;
|
return false;
|
||||||
@ -16,7 +16,7 @@ namespace NewHorizons.Patches.VolumePatches
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(FogWarpVolume), nameof(FogWarpVolume.GetFogThickness))]
|
[HarmonyPatch(typeof(FogWarpVolume), nameof(FogWarpVolume.GetFogThickness))]
|
||||||
public static bool FogWarpVolume_GetFogThickness(FogWarpVolume __instance, ref float __result)
|
public static bool FogWarpVolume_GetFogThickness(FogWarpVolume __instance, out float __result)
|
||||||
{
|
{
|
||||||
if (__instance is InnerFogWarpVolume sph) __result = sph._exitRadius;
|
if (__instance is InnerFogWarpVolume sph) __result = sph._exitRadius;
|
||||||
else __result = 50; // 50f is hardcoded as the return value in the base game
|
else __result = 50; // 50f is hardcoded as the return value in the base game
|
||||||
|
|||||||
@ -4,11 +4,11 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace NewHorizons.Patches.WarpPatches
|
namespace NewHorizons.Patches.WarpPatches
|
||||||
{
|
{
|
||||||
[HarmonyPatch]
|
[HarmonyPatch(typeof(EyeCoordinatePromptTrigger))]
|
||||||
public static class EyeCoordinatePromptTriggerPatches
|
public static class EyeCoordinatePromptTriggerPatches
|
||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(EyeCoordinatePromptTrigger), nameof(EyeCoordinatePromptTrigger.Update))]
|
[HarmonyPatch(nameof(EyeCoordinatePromptTrigger.Update))]
|
||||||
public static bool EyeCoordinatePromptTrigger_Update(EyeCoordinatePromptTrigger __instance)
|
public static bool EyeCoordinatePromptTrigger_Update(EyeCoordinatePromptTrigger __instance)
|
||||||
{
|
{
|
||||||
var showPrompts = __instance._warpController.HasPower();
|
var showPrompts = __instance._warpController.HasPower();
|
||||||
@ -22,10 +22,10 @@ namespace NewHorizons.Patches.WarpPatches
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(EyeCoordinatePromptTrigger), nameof(EyeCoordinatePromptTrigger.OnExit))]
|
[HarmonyPatch(nameof(EyeCoordinatePromptTrigger.OnExit))]
|
||||||
public static void EyeCoordinatePromptTrigger_OnExit(GameObject __0)
|
public static void EyeCoordinatePromptTrigger_OnExit(GameObject hitObj)
|
||||||
{
|
{
|
||||||
if (__0.CompareTag("PlayerDetector"))
|
if (hitObj.CompareTag("PlayerDetector"))
|
||||||
{
|
{
|
||||||
VesselCoordinatePromptHandler.SetPromptVisibility(false);
|
VesselCoordinatePromptHandler.SetPromptVisibility(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,11 @@ namespace NewHorizons.Patches.WarpPatches
|
|||||||
public static bool NomaiCoordinateInterface_SetPillarRaised(NomaiCoordinateInterface __instance, bool raised)
|
public static bool NomaiCoordinateInterface_SetPillarRaised(NomaiCoordinateInterface __instance, bool raised)
|
||||||
{
|
{
|
||||||
if (raised)
|
if (raised)
|
||||||
return !(!__instance._powered || __instance.CheckEyeCoordinates() && Main.Instance.CurrentStarSystem != "EyeOfTheUniverse" || __instance.CheckAllCoordinates(out string targetSystem) && Main.Instance.CurrentStarSystem != targetSystem);
|
return !(
|
||||||
|
!__instance._powered ||
|
||||||
|
__instance.CheckEyeCoordinates() && Main.Instance.CurrentStarSystem != "EyeOfTheUniverse" ||
|
||||||
|
__instance.CheckAllCoordinates(out var targetSystem) && Main.Instance.CurrentStarSystem != targetSystem
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user