Add "back" button in settings menu
This commit is contained in:
parent
ddf0b21e37
commit
ffa1ea01b1
|
@ -70,6 +70,8 @@ class SettingsMenu(Menu):
|
||||||
self.values.append("")
|
self.values.append("")
|
||||||
self.values.append("Changer le pack de textures n'aura effet")
|
self.values.append("Changer le pack de textures n'aura effet")
|
||||||
self.values.append("qu'après avoir relancé le jeu.")
|
self.values.append("qu'après avoir relancé le jeu.")
|
||||||
|
self.values.append("")
|
||||||
|
self.values.append("Retour (espace)")
|
||||||
|
|
||||||
def handle_key_pressed(self, key: Optional[KeyValues], raw_key: str,
|
def handle_key_pressed(self, key: Optional[KeyValues], raw_key: str,
|
||||||
game: Any) -> None:
|
game: Any) -> None:
|
||||||
|
@ -77,7 +79,9 @@ class SettingsMenu(Menu):
|
||||||
For now, in the settings mode, we can only go backwards.
|
For now, in the settings mode, we can only go backwards.
|
||||||
"""
|
"""
|
||||||
if not self.waiting_for_key:
|
if not self.waiting_for_key:
|
||||||
if key == KeyValues.SPACE:
|
if key == KeyValues.SPACE or \
|
||||||
|
key == KeyValues.ENTER and \
|
||||||
|
self.position == len(self.values) - 1:
|
||||||
game.state = GameMode.MAINMENU
|
game.state = GameMode.MAINMENU
|
||||||
if key == KeyValues.DOWN:
|
if key == KeyValues.DOWN:
|
||||||
self.go_down()
|
self.go_down()
|
||||||
|
|
Loading…
Reference in New Issue