Quickly jump to the top or bottom of the game menu with home or end keys.

This commit is contained in:
Storm Dragon 2020-09-09 21:38:59 -04:00
parent 678af54346
commit b897abf0a3

View File

@ -348,6 +348,20 @@ def game_menu(sounds, *options):
except:
pass
if options[i] != "donate": pygame.mixer.music.unpause()
if event.key == pygame.K_HOME and i != 0:
i = 0
try:
sounds['menu-move'].play()
except:
pass
if options[i] != "donate": pygame.mixer.music.unpause()
if event.key == pygame.K_END and i != len(options) - 1:
i = len(options) -1
try:
sounds['menu-move'].play()
except:
pass
if options[i] != "donate": pygame.mixer.music.unpause()
if event.key == pygame.K_RETURN:
try:
j = -1