mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
[MuteSFX] Fix #29.
Fixed Push to Talk spamming SFX. [https://github.com/NotAKidOnSteam/NAK_CVR_Mods/issues/29](#29)
This commit is contained in:
parent
3d6b1f75a4
commit
22fcd8fe8f
4 changed files with 29 additions and 40 deletions
|
@ -28,23 +28,24 @@ public static class AudioModuleManager
|
|||
foreach (string clipName in clipNames)
|
||||
{
|
||||
string clipPath = Path.Combine(path, clipName);
|
||||
if (!File.Exists(clipPath))
|
||||
|
||||
if (File.Exists(clipPath))
|
||||
continue;
|
||||
|
||||
byte[] clipData;
|
||||
string resourceName = "MuteSFX.SFX." + clipName;
|
||||
|
||||
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
|
||||
{
|
||||
byte[] clipData = null;
|
||||
string resourceName = "MuteSFX.SFX." + clipName;
|
||||
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
|
||||
{
|
||||
clipData = new byte[stream.Length];
|
||||
stream.Read(clipData, 0, clipData.Length);
|
||||
}
|
||||
|
||||
using (FileStream fileStream = new FileStream(clipPath, FileMode.CreateNew))
|
||||
{
|
||||
fileStream.Write(clipData, 0, clipData.Length);
|
||||
}
|
||||
|
||||
MuteSFX.Logger.Msg("Placed missing sfx in audio folder: " + clipName);
|
||||
if (stream == null) continue;
|
||||
clipData = new byte[stream.Length];
|
||||
stream.Read(clipData, 0, clipData.Length);
|
||||
}
|
||||
|
||||
using (FileStream fileStream = new FileStream(clipPath, FileMode.CreateNew))
|
||||
fileStream.Write(clipData, 0, clipData.Length);
|
||||
|
||||
MuteSFX.Logger.Msg("Placed missing sfx in audio folder: " + clipName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue