diff --git a/Adventure Game/adventure_game/main.py b/Adventure Game/adventure_game/main.py index e85176c..90e3fef 100644 --- a/Adventure Game/adventure_game/main.py +++ b/Adventure Game/adventure_game/main.py @@ -1,8 +1,12 @@ -import npyscreen +import npyscreen, sys from npyscreen import NotEnoughSpaceForWidget from yaml_parser import parse_datafile as parse +class ExitButton(npyscreen.ButtonPress): + def whenPressed(self): + sys.exit(0) + class GameNavigator(npyscreen.Form): def afterEditing(self): @@ -45,11 +49,13 @@ class GameNavigator(npyscreen.Form): self.dialogueBox = self.add(npyscreen.Textfield, name='Type Here', - max_width=inventory_width + art_width - 2, + max_width=inventory_width + art_width - 7, max_height=1, relx=2, rely=top_division_height + 3) + self.tryAction = self.add(ExitButton, name="Send", relx=inventory_width + art_width - 7, rely=top_division_height + 3) + class MainMenu(npyscreen.Form): def afterEditing(self):