diff --git a/menu.py b/menu.py index abc5b2a..bb374b4 100644 --- a/menu.py +++ b/menu.py @@ -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