From b897abf0a336c53bb098fed0ae34e11b946dba35 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 9 Sep 2020 21:38:59 -0400 Subject: [PATCH] Quickly jump to the top or bottom of the game menu with home or end keys. --- libstormgames.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libstormgames.py b/libstormgames.py index 817a258..82d82ad 100755 --- a/libstormgames.py +++ b/libstormgames.py @@ -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