Fixed a bug where _ prefixed sounds in sub directories weren't hidden from learn sounds.
This commit is contained in:
9
menu.py
9
menu.py
@@ -354,7 +354,7 @@ def learn_sounds(sounds):
|
|||||||
Excluded sounds:
|
Excluded sounds:
|
||||||
- Files in folders named 'ambience' (at any level)
|
- Files in folders named 'ambience' (at any level)
|
||||||
- Files in any directory starting with '.'
|
- 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:
|
Args:
|
||||||
sounds (dict): Dictionary of available sound objects
|
sounds (dict): Dictionary of available sound objects
|
||||||
@@ -374,8 +374,11 @@ def learn_sounds(sounds):
|
|||||||
|
|
||||||
# Process each sound key in the dictionary
|
# Process each sound key in the dictionary
|
||||||
for soundKey in sounds.keys():
|
for soundKey in sounds.keys():
|
||||||
# Skip if key has any excluded prefix
|
# Extract the filename (part after the last '/')
|
||||||
if any(soundKey.lower().startswith(prefix.lower()) for prefix in excludedPrefixes):
|
filename = soundKey.split('/')[-1]
|
||||||
|
|
||||||
|
# Skip if filename has any excluded prefix
|
||||||
|
if any(filename.lower().startswith(prefix.lower()) for prefix in excludedPrefixes):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Split key into path parts
|
# Split key into path parts
|
||||||
|
Reference in New Issue
Block a user