mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using NewHorizons.Utility;
|
|
using System.IO;
|
|
using System.Linq;
|
|
|
|
namespace NewHorizons.VoiceActing
|
|
{
|
|
public static class VoiceHandler
|
|
{
|
|
public static bool Enabled { get; private set; }
|
|
|
|
private static IVoiceMod API;
|
|
|
|
public static void Init()
|
|
{
|
|
API = Main.Instance.ModHelper.Interaction.TryGetModApi<IVoiceMod>("Krevace.VoiceMod");
|
|
|
|
if (API == null)
|
|
{
|
|
Logger.Log("VoiceMod isn't installed");
|
|
Enabled = false;
|
|
return;
|
|
}
|
|
|
|
Enabled = true;
|
|
|
|
foreach (var mod in Main.Instance.GetDependants().Append(Main.Instance))
|
|
{
|
|
var folder = $"{mod.ModHelper.Manifest.ModFolderPath}VoiceMod";
|
|
if (Directory.Exists(folder))
|
|
{
|
|
Logger.Log($"Registering VoiceMod audio for {mod.ModHelper.Manifest.Name} from {folder}");
|
|
API.RegisterAssets(folder);
|
|
}
|
|
else
|
|
{
|
|
Logger.Log($"Didn't find VoiceMod audio for {mod.ModHelper.Manifest.Name} at {folder}");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|