Fixed a bug where _ prefixed sounds in sub directories weren't hidden from learn sounds.

This commit is contained in:
Storm Dragon
2025-09-23 14:16:11 -04:00
parent 66bc11099e
commit 5444ec4047

View File

@@ -354,7 +354,7 @@ def learn_sounds(sounds):
Excluded sounds:
- Files in folders named 'ambience' (at any level)
- Files in any directory starting with '.'
- Files starting with 'game-intro', 'music_menu', or '_'
- Files whose filename starts with 'game-intro', 'music_menu', or '_' (regardless of directory)
Args:
sounds (dict): Dictionary of available sound objects
@@ -374,8 +374,11 @@ def learn_sounds(sounds):
# Process each sound key in the dictionary
for soundKey in sounds.keys():
# Skip if key has any excluded prefix
if any(soundKey.lower().startswith(prefix.lower()) for prefix in excludedPrefixes):
# Extract the filename (part after the last '/')
filename = soundKey.split('/')[-1]
# Skip if filename has any excluded prefix
if any(filename.lower().startswith(prefix.lower()) for prefix in excludedPrefixes):
continue
# Split key into path parts