From 2c34f31a82a16db3a1823b77bfbcf25bf3d644ab Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 15 Mar 2025 21:28:06 -0400 Subject: [PATCH] Fixed music not pausing when play is selected. --- menu.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/menu.py b/menu.py index 542845d..5b0822d 100644 --- a/menu.py +++ b/menu.py @@ -182,11 +182,18 @@ def game_menu(sounds, playCallback=None, *customOptions): try: pygame.mixer.music.fadeout(500) time.sleep(0.5) - except: + except Exception as e: + print(f"Could not fade music: {e}") pass playCallback() else: # Otherwise return "play" to the caller + try: + pygame.mixer.music.fadeout(500) + time.sleep(0.5) + except Exception as e: + print(f"Could not fade music: {e}") + pass return "play" # Handle standard options directly elif selectedOption in ["instructions", "credits", "learn_sounds", "high_scores", "donate"]: @@ -228,7 +235,8 @@ def game_menu(sounds, playCallback=None, *customOptions): try: pygame.mixer.music.fadeout(500) time.sleep(0.5) - except: + except Exception as e: + print(f"Could not fade music: {e}") pass return selectedOption except Exception as e: