Quickly jump to the top or bottom of the game menu with home or end keys.
This commit is contained in:
parent
678af54346
commit
b897abf0a3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user