Fixed bug with contentpack sfx names (ToLower)

This commit is contained in:
JappaWakka 2022-08-10 19:48:38 +02:00
parent d21f97c7b5
commit 82c18f473a
1 changed files with 3 additions and 3 deletions

View File

@ -115,7 +115,7 @@
Public Shared Sub LoadSounds(ByVal forceReplace As Boolean)
For Each soundfile As String In System.IO.Directory.GetFiles(GameController.GamePath & "\Content\Sounds\")
If soundfile.EndsWith(".wav") = True Then
If soundfile.EndsWith(".wav") = True Or soundfile.EndsWith(".xnb") = True Then
soundfile = System.IO.Path.GetFileNameWithoutExtension(soundfile)
AddSound(soundfile, forceReplace)
End If
@ -126,7 +126,7 @@
If System.IO.Directory.Exists(path) = True Then
For Each soundfile As String In System.IO.Directory.GetFiles(path, "*.*", IO.SearchOption.AllDirectories)
If soundfile.EndsWith(".wav") = True Then
If soundfile.EndsWith(".wav") = True Or soundfile.EndsWith(".xnb") = True Then
soundfile = System.IO.Path.GetFileNameWithoutExtension(soundfile)
AddSound(soundfile, forceReplace)
End If
@ -141,7 +141,7 @@
If _sounds.ContainsKey(Name.ToLower()) = True Then
Return _sounds(Name.ToLower())
Else
If TryAddGameModeSound(Name) = True Then
If TryAddGameModeSound(Name.ToLower()) = True Then
Return _sounds(Name.ToLower())
Else
Logger.Log(Logger.LogTypes.Warning, "SoundManager.vb: Cannot find sound file """ & Name & """. Return nothing.")