mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix getting locked into the ship log warp drive dialogue when spawning
This commit is contained in:
parent
568f8a757e
commit
41fcb476db
@ -1,4 +1,6 @@
|
||||
using HarmonyLib;
|
||||
using System.Collections;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NewHorizons.Patches.DialoguePatches
|
||||
{
|
||||
@ -7,6 +9,29 @@ namespace NewHorizons.Patches.DialoguePatches
|
||||
{
|
||||
private static bool _wasLastDialogueInactive = false;
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(nameof(RemoteDialogueTrigger.Awake))]
|
||||
public static void RemoteDialogueTrigger_Awake(RemoteDialogueTrigger __instance)
|
||||
{
|
||||
// Wait for player to be up and moving before allowing them to trigger remote dialogue
|
||||
// Stops you getting locked into dialogue while waking up
|
||||
if (OWInput.GetInputMode() != InputMode.Character)
|
||||
{
|
||||
__instance._collider.enabled = false;
|
||||
__instance.StartCoroutine(AwakeCoroutine(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerator AwakeCoroutine(RemoteDialogueTrigger instance)
|
||||
{
|
||||
while (OWInput.GetInputMode() != InputMode.Character)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
instance._collider.enabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Should fix a bug where disabled a CharacterDialogueTree makes its related RemoteDialogueTriggers softlock your game
|
||||
/// </summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user