mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
27 lines
938 B
C#
27 lines
938 B
C#
using HarmonyLib;
|
|
|
|
namespace NewHorizons.Patches;
|
|
|
|
[HarmonyPatch]
|
|
internal static class CharacterDialogueTreePatches
|
|
{
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.Awake))]
|
|
private static void CharacterDialogueTree_Awake(CharacterDialogueTree __instance)
|
|
{
|
|
GlobalMessenger<OWRigidbody>.AddListener("AttachPlayerToPoint", __instance.OnAttachPlayerToPoint);
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.OnDestroy))]
|
|
private static void CharacterDialogueTree_OnDestroy(CharacterDialogueTree __instance)
|
|
{
|
|
GlobalMessenger<OWRigidbody>.RemoveListener("AttachPlayerToPoint", __instance.OnAttachPlayerToPoint);
|
|
}
|
|
|
|
private static void OnAttachPlayerToPoint(this CharacterDialogueTree characterDialogueTree, OWRigidbody rigidbody)
|
|
{
|
|
characterDialogueTree.EndConversation();
|
|
}
|
|
}
|