Merge branch 'slide-reel-streaming' into profiler

This commit is contained in:
JohnCorby 2025-02-13 19:59:10 -08:00
commit 89a58c2a93
2 changed files with 6 additions and 1 deletions

View File

@ -158,6 +158,7 @@ public class NHSlideCollection : SlideCollection
_pathsBeingLoaded.Remove(path); _pathsBeingLoaded.Remove(path);
if (_shipLogSlideProjector == null) if (_shipLogSlideProjector == null)
{ {
// Object.FindObjectOfType doesnt work with inactive
_shipLogSlideProjector = Resources.FindObjectsOfTypeAll<ShipLogSlideProjector>().FirstOrDefault(); _shipLogSlideProjector = Resources.FindObjectsOfTypeAll<ShipLogSlideProjector>().FirstOrDefault();
} }
if (_shipLogSlideProjector != null) if (_shipLogSlideProjector != null)

View File

@ -5,6 +5,8 @@ namespace NewHorizons.Patches.ToolPatches
[HarmonyPatch(typeof(ToolModeSwapper))] [HarmonyPatch(typeof(ToolModeSwapper))]
public static class ToolModeSwapperPatches public static class ToolModeSwapperPatches
{ {
private static ShipCockpitController _shipCockpitController;
// Patches ToolModeSwapper.EquipToolMode(ToolMode mode) to deny swaps if you're holding a vision torch. // Patches ToolModeSwapper.EquipToolMode(ToolMode mode) to deny swaps if you're holding a vision torch.
// This is critical for preventing swapping to the scout launcher (causes memory slides to fail) but it // This is critical for preventing swapping to the scout launcher (causes memory slides to fail) but it
// just doesn't look right when you switch to other stuff (eg the signalscope), so I'm disabling swapping tools entirely // just doesn't look right when you switch to other stuff (eg the signalscope), so I'm disabling swapping tools entirely
@ -21,7 +23,9 @@ namespace NewHorizons.Patches.ToolPatches
mode == ToolMode.Probe || mode == ToolMode.Probe ||
mode == ToolMode.SignalScope || mode == ToolMode.SignalScope ||
mode == ToolMode.Translator; mode == ToolMode.Translator;
var isInShip = UnityEngine.Object.FindObjectOfType<ShipCockpitController>()?._playerAtFlightConsole ?? false; if (_shipCockpitController == null)
_shipCockpitController = UnityEngine.Object.FindObjectOfType<ShipCockpitController>();
var isInShip = _shipCockpitController != null ? _shipCockpitController._playerAtFlightConsole : false;
if (!isInShip && isHoldingVisionTorch && swappingToRestrictedTool) return false; if (!isInShip && isHoldingVisionTorch && swappingToRestrictedTool) return false;