mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Check for NH characters
This commit is contained in:
parent
0ab737913b
commit
56e0aafb72
@ -6,6 +6,7 @@ using System.Xml;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
|
using NewHorizons.Components;
|
||||||
|
|
||||||
namespace NewHorizons.Builder.Props
|
namespace NewHorizons.Builder.Props
|
||||||
{
|
{
|
||||||
@ -114,7 +115,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
interact.enabled = false;
|
interact.enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dialogueTree = conversationZone.AddComponent<CharacterDialogueTree>();
|
var dialogueTree = conversationZone.AddComponent<NHCharacterDialogueTree>();
|
||||||
|
|
||||||
var xml = File.ReadAllText(Path.Combine(mod.Manifest.ModFolderPath, info.xmlFile));
|
var xml = File.ReadAllText(Path.Combine(mod.Manifest.ModFolderPath, info.xmlFile));
|
||||||
var text = new TextAsset(xml)
|
var text = new TextAsset(xml)
|
||||||
|
|||||||
6
NewHorizons/Components/NHCharacterDialogueTree.cs
Normal file
6
NewHorizons/Components/NHCharacterDialogueTree.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace NewHorizons.Components
|
||||||
|
{
|
||||||
|
public class NHCharacterDialogueTree : CharacterDialogueTree
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using NewHorizons.Components;
|
||||||
using NewHorizons.OtherMods.AchievementsPlus.NH;
|
using NewHorizons.OtherMods.AchievementsPlus.NH;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -31,6 +32,12 @@ namespace NewHorizons.Patches
|
|||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.StartConversation))]
|
[HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.StartConversation))]
|
||||||
public static void CharacterDialogueTree_StartConversation(CharacterDialogueTree __instance) => TalkToFiveCharactersAchievement.OnTalkedToCharacter(__instance._characterName);
|
public static void CharacterDialogueTree_StartConversation(CharacterDialogueTree __instance)
|
||||||
|
{
|
||||||
|
if (__instance is NHCharacterDialogueTree)
|
||||||
|
{
|
||||||
|
TalkToFiveCharactersAchievement.OnTalkedToCharacter(__instance._characterName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user