More event handling to help with pyinstaller compilation.

This commit is contained in:
Storm Dragon
2025-09-10 12:57:09 -04:00
parent 0190fa3a06
commit f2079261d1
4 changed files with 22 additions and 2 deletions

View File

@@ -184,6 +184,7 @@ def game_menu(sounds, playCallback=None, *customOptions):
pygame.mixer.stop()
currentIndex = 0
lastSpoken = -1 # Track last spoken index
pygame.event.clear()
while loop:
if currentIndex != lastSpoken:
@@ -337,7 +338,8 @@ def game_menu(sounds, playCallback=None, *customOptions):
pass
return allOptions[currentIndex]
event = pygame.event.clear()
pygame.event.pump()
pygame.event.clear()
time.sleep(0.001)
def learn_sounds(sounds):
@@ -422,6 +424,7 @@ def learn_sounds(sounds):
# Flag to track when to exit the loop
returnToMenu = False
pygame.event.clear()
while not returnToMenu:
# Announce current sound