mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Me when (#375)
This commit is contained in:
commit
1cb5079764
@ -3,19 +3,24 @@ using HarmonyLib;
|
|||||||
namespace NewHorizons.Patches;
|
namespace NewHorizons.Patches;
|
||||||
|
|
||||||
[HarmonyPatch]
|
[HarmonyPatch]
|
||||||
internal class CharacterDialogueTreePatches
|
internal static class CharacterDialogueTreePatches
|
||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.Awake))]
|
[HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.Awake))]
|
||||||
private static void CharacterDialogueTree_Awake(CharacterDialogueTree __instance)
|
private static void CharacterDialogueTree_Awake(CharacterDialogueTree __instance)
|
||||||
{
|
{
|
||||||
GlobalMessenger<OWRigidbody>.AddListener("AttachPlayerToPoint", _ => __instance.EndConversation());
|
GlobalMessenger<OWRigidbody>.AddListener("AttachPlayerToPoint", __instance.OnAttachPlayerToPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.OnDestroy))]
|
[HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.OnDestroy))]
|
||||||
private static void CharacterDialogueTree_OnDestroy(CharacterDialogueTree __instance)
|
private static void CharacterDialogueTree_OnDestroy(CharacterDialogueTree __instance)
|
||||||
{
|
{
|
||||||
GlobalMessenger<OWRigidbody>.RemoveListener("AttachPlayerToPoint", _ => __instance.EndConversation());
|
GlobalMessenger<OWRigidbody>.RemoveListener("AttachPlayerToPoint", __instance.OnAttachPlayerToPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void OnAttachPlayerToPoint(this CharacterDialogueTree characterDialogueTree, OWRigidbody rigidbody)
|
||||||
|
{
|
||||||
|
characterDialogueTree.EndConversation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user