From 5fb78fece87d1656ed52c6ad89078856cec7f988 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Sun, 21 Feb 2021 17:15:26 -0500 Subject: [PATCH] Move around/clean up game renderer Also add space for log window --- .../adventure_game/GameNavigator.py | 23 +++++++++---------- Adventure Game/adventure_game/main.py | 8 +++---- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Adventure Game/adventure_game/GameNavigator.py b/Adventure Game/adventure_game/GameNavigator.py index 7e90d40..77803f8 100644 --- a/Adventure Game/adventure_game/GameNavigator.py +++ b/Adventure Game/adventure_game/GameNavigator.py @@ -6,18 +6,17 @@ class QuitButton(npyscreen.ButtonPress): def whenPressed(self): sys.exit(0) -class SendButton(npyscreen.ButtonPress): + +class Render(npyscreen.ButtonPress): def whenPressed(self): self.parent.artContent.value = 'Undraw!' - #self.parent.parentApp.switchForm('GAME') self.parent.artContent.display() + self.parent.parentApp.switchForm('GAME') + class GameNavigator(npyscreen.FormBaseNew): -# def afterEditing(self): -#it self.parentApp.setNextForm('GAME') - - def render(self): - self.artContent.value = 'Undraw!' + # def afterEditing(self): + # it self.parentApp.setNextForm('GAME') def create(self): top_division_height = 20 @@ -52,20 +51,20 @@ class GameNavigator(npyscreen.FormBaseNew): max_width=inventory_width + art_width, max_height=3, relx=1, - rely=top_division_height + 2, + rely=top_division_height + 2 + 9, editable=False) self.dialogueBox = self.add(npyscreen.Textfield, name='Type Here', - max_width=inventory_width + art_width - 7, + max_width=inventory_width + art_width - 14, max_height=1, relx=2, - rely=top_division_height + 3) + rely=top_division_height + 3 + 9) - self.sendButton = self.add(SendButton, + self.sendButton = self.add(Render, name="Send", relx=inventory_width + art_width - 7, - rely=top_division_height + 3) + rely=top_division_height + 3 + 9) self.quitButton = self.add(QuitButton, name="Quit", relx=1, diff --git a/Adventure Game/adventure_game/main.py b/Adventure Game/adventure_game/main.py index ff04146..741a2e1 100644 --- a/Adventure Game/adventure_game/main.py +++ b/Adventure Game/adventure_game/main.py @@ -28,9 +28,9 @@ class AdventureGame(npyscreen.NPSAppManaged): # Set screen size before drawing windows dimensions = self.gamelib['menu']['graphics']['dimensions'] - system('mode con: cols={0} lines={1}'.format( - dimensions['inventory_width']+dimensions['art_width'], - 30)) # TODO: Finish setting this up. + #system('mode con: cols={0} lines={1}'.format( + # dimensions['inventory_width']+dimensions['art_width'], + # 30)) # TODO: Finish setting this up. # Draw game windows self.addForm('GAME', GameNavigator, name='Unnamed Adventure Game') # This window should draw the actual game @@ -42,7 +42,7 @@ class AdventureGame(npyscreen.NPSAppManaged): if __name__ == '__main__': # Set the screen size bigger - system('mode con: cols={0} lines={1}'.format(124, 30)) + system('mode con: cols={0} lines={1}'.format(124, 36)) # Make a new adventure game if not imported adventure_game = AdventureGame()