adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[adonthell-wastesedge-commits] master e5e4325 15/21: FIXED game quitting


From: Kai Sterker
Subject: [adonthell-wastesedge-commits] master e5e4325 15/21: FIXED game quitting when pressing ESC while menu labels are sliding in
Date: Mon, 25 Jul 2016 18:16:39 +0000 (UTC)

branch: master
commit e5e432507debc0b4a9897795aa443a1b98bb28b0
Author: Kai Sterker <address@hidden>
Commit: Kai Sterker <address@hidden>

    FIXED game quitting when pressing ESC while menu labels are sliding in
---
 scripts/modules/main_menu.py |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/modules/main_menu.py b/scripts/modules/main_menu.py
index 41a26c8..4176da7 100755
--- a/scripts/modules/main_menu.py
+++ b/scripts/modules/main_menu.py
@@ -202,6 +202,13 @@ class main_menu (win_container):
                 
         # -- pressing ESC will close the menu if it's open
         if input_has_been_pushed (SDLK_ESCAPE):
+            # -- if the options are still sliding in, skip
+            if self.startup > 0:
+                # -- center labels again
+                for label in self.labels:
+                    label.move ((self.length()-label.length())//2, label.y ())
+                return
+            
             # -- If we're on the title screen, then exit the game
             if self.enable_save == 0: self.retval = 5
             else: self.retval = 0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]