From 48fdbe0defba99d8f20b8d0fc4292f9b85df7a00 Mon Sep 17 00:00:00 2001 From: leogandmars Date: Thu, 7 Oct 2021 23:41:10 -0700 Subject: [PATCH 1/3] Fixed folder creation failing --- NASB Voice Mod/Managers/VoicepackManager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NASB Voice Mod/Managers/VoicepackManager.cs b/NASB Voice Mod/Managers/VoicepackManager.cs index e9ef51e..60d22ce 100644 --- a/NASB Voice Mod/Managers/VoicepackManager.cs +++ b/NASB Voice Mod/Managers/VoicepackManager.cs @@ -22,6 +22,8 @@ public static VoicepackManager Instance private set; } + public static string folder = Path.Combine(Paths.BepInExRootPath, "Voicepacks"); + public List voicepacks = new List(); public VoicepackManager() @@ -31,6 +33,8 @@ public VoicepackManager() audioPlayer = new GameObject("VoiceMod Audio Player").AddComponent(); GameObject.DontDestroyOnLoad(audioPlayer.gameObject); + if (!Directory.Exists(folder)) Directory.CreateDirectory(folder); + Task.Run(() => LoadAllVoicepacks()); } @@ -39,8 +43,6 @@ private void LoadAllVoicepacks() var stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); - var folder = Path.Combine(Paths.BepInExRootPath, "Voicepacks"); - Directory.CreateDirectory(folder); var files = Directory.GetFiles(folder, "*.zip"); foreach (var file in files) From 52213a529421058248224d26a9fd5a23a6ec633f Mon Sep 17 00:00:00 2001 From: leogandmars Date: Thu, 7 Oct 2021 23:46:08 -0700 Subject: [PATCH 2/3] support new .voicepack filetype --- NASB Voice Mod/Managers/VoicepackManager.cs | 3 ++- NASB Voice Mod/PluginInfo.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NASB Voice Mod/Managers/VoicepackManager.cs b/NASB Voice Mod/Managers/VoicepackManager.cs index 60d22ce..1f11e6c 100644 --- a/NASB Voice Mod/Managers/VoicepackManager.cs +++ b/NASB Voice Mod/Managers/VoicepackManager.cs @@ -43,7 +43,8 @@ private void LoadAllVoicepacks() var stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); - var files = Directory.GetFiles(folder, "*.zip"); + string[] supportedFileTypes = { ".zip", ".voicepack" }; + var files = Directory.GetFiles(folder).Where(x => supportedFileTypes.Contains(Path.GetExtension(x).ToLower())); foreach (var file in files) { diff --git a/NASB Voice Mod/PluginInfo.cs b/NASB Voice Mod/PluginInfo.cs index d264e24..fd70522 100644 --- a/NASB Voice Mod/PluginInfo.cs +++ b/NASB Voice Mod/PluginInfo.cs @@ -4,6 +4,6 @@ class PluginInfo { public const string PLUGIN_GUID = "com.steven.nasb.voicemod"; public const string PLUGIN_NAME = "Voice Mod"; - public const string PLUGIN_VERSION = "1.0.0"; + public const string PLUGIN_VERSION = "1.1.0"; } } From 67c59e0008c724ebbddfc69507ba876833ce67db Mon Sep 17 00:00:00 2001 From: leogandmars Date: Thu, 7 Oct 2021 23:55:26 -0700 Subject: [PATCH 3/3] Update readme for new format --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bfc088e..1071fcf 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Then, go to the [latest release of this mod](https://github.com/DeadlyKitten/Nic Place voicepacks in `BepInEx/Voicepacks` (run the game with the mod installed if you don't see this folder). -**Voicepacks must be in ZIP format!** Use the [Voicepack Packer](https://github.com/DeadlyKitten/NickVoicepackPacker) to create your own custom voicepacks. +**Voicepacks must be in .VOICEPACK (preferred) or .ZIP (legacy) format!** Use the [Voicepack Packer](https://github.com/DeadlyKitten/NickVoicepackPacker) to create your own custom voicepacks. Only use one per character, additional voicepacks will be ignored!