Skip to content

Commit

Permalink
Merge pull request #1 from legoandmars/master
Browse files Browse the repository at this point in the history
New format support
  • Loading branch information
DeadlyKitten authored Oct 8, 2021
2 parents 346253e + 67c59e0 commit 01cc909
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions NASB Voice Mod/Managers/VoicepackManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public static VoicepackManager Instance
private set;
}

public static string folder = Path.Combine(Paths.BepInExRootPath, "Voicepacks");

public List<Voicepack> voicepacks = new List<Voicepack>();

public VoicepackManager()
Expand All @@ -31,6 +33,8 @@ public VoicepackManager()
audioPlayer = new GameObject("VoiceMod Audio Player").AddComponent<AudioSource>();
GameObject.DontDestroyOnLoad(audioPlayer.gameObject);

if (!Directory.Exists(folder)) Directory.CreateDirectory(folder);

Task.Run(() => LoadAllVoicepacks());
}

Expand All @@ -39,9 +43,8 @@ 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");
string[] supportedFileTypes = { ".zip", ".voicepack" };
var files = Directory.GetFiles(folder).Where(x => supportedFileTypes.Contains(Path.GetExtension(x).ToLower()));

foreach (var file in files)
{
Expand Down
2 changes: 1 addition & 1 deletion NASB Voice Mod/PluginInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down

0 comments on commit 01cc909

Please # to comment.