From 6743be8a6c4cdecae42ec84f5face1eedbe2a43d Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Wed, 17 Feb 2021 22:07:19 -0500 Subject: [PATCH] Update art rendering and prepare for input handling --- .../adventure_game/gamedata/gamelib.yaml | 21 +++++++-- .../adventure_game/gamedata/world/office.yaml | 12 ++++++ Adventure Game/adventure_game/main.py | 43 ++++++++++++++++--- 3 files changed, 66 insertions(+), 10 deletions(-) create mode 100644 Adventure Game/adventure_game/gamedata/world/office.yaml diff --git a/Adventure Game/adventure_game/gamedata/gamelib.yaml b/Adventure Game/adventure_game/gamedata/gamelib.yaml index 5ecc905..dc5deff 100644 --- a/Adventure Game/adventure_game/gamedata/gamelib.yaml +++ b/Adventure Game/adventure_game/gamedata/gamelib.yaml @@ -13,6 +13,21 @@ menu: \____/_/ |_/_/ /_/_____/ not_found: | - . / \ - / ! \ - / \ + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- + -----------------------------------------------/ \----------------------------------------------- + ----------------------------------------------/ !! \---------------------------------------------- + ---------------------------------------------/ \--------------------------------------------- + --------------------------------------No Art for this location------------------------------------ + ----------------------------------Consider making a pull request?--------------------------------- + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------------- diff --git a/Adventure Game/adventure_game/gamedata/world/office.yaml b/Adventure Game/adventure_game/gamedata/world/office.yaml new file mode 100644 index 0000000..3d88078 --- /dev/null +++ b/Adventure Game/adventure_game/gamedata/world/office.yaml @@ -0,0 +1,12 @@ +office: + grid: [0, 0] + upon_enter: "You are standing behind your desk, you see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|" + look_around: "You look around the room, you see a |DESK|, a |BOOKSHELF| and the |DOOR|" + pick_up_logviewer: "You pick the *LOG VIEWER* up." + desk: + look_at: "You move to stand behind your desk. You see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|" + inspect: "Desk, ornate, stuff" + log_viewer: + look_at: "logviewer looks like garbo" + inspect: "beep boop" + pick_up: "You pick up the *LOG VIEWER*." \ No newline at end of file diff --git a/Adventure Game/adventure_game/main.py b/Adventure Game/adventure_game/main.py index 57e3c0e..e85176c 100644 --- a/Adventure Game/adventure_game/main.py +++ b/Adventure Game/adventure_game/main.py @@ -9,17 +9,46 @@ class GameNavigator(npyscreen.Form): self.parentApp.setNextForm(None) # Nothing to do after this but exit the game. def create(self): - self.artBox = self.add(npyscreen.BoxBasic, name='ArtBox', max_width=100, max_height=20, relx=21) + top_division_height = 20 + inventory_width = 20 + art_width = 100 + + self.artBox = self.add(npyscreen.BoxBasic, + name='ArtBox', + max_width=art_width, + max_height=top_division_height, + rely=2, + relx=inventory_width + 1, + editable=False) + self.artContent = self.add(npyscreen.MultiLineEdit, + rely=3, + relx=inventory_width + 2, + max_width=art_width - 2, + max_height=top_division_height - 2, + value=self.parentApp.gamelib['menu']['graphics']['not_found'], + editable=False) self.artBox.footer = 'Unknown Location' - self.artBox = self.add(npyscreen.BoxBasic, name='Inventory', max_width=20, max_height=20, relx=1, rely=2) + self.artBox = self.add(npyscreen.BoxBasic, + name='Inventory', + max_width=inventory_width, + max_height=top_division_height, + relx=1, + rely=2, + editable=False) - self.DialogueBox = self.add(npyscreen.BoxBasic, name='Type Here', max_width=20, max_height=20, relx=1, rely=2) + self.dialogueBoxOutline = self.add(npyscreen.BoxBasic, + max_width=inventory_width + art_width, + max_height=3, + relx=1, + rely=top_division_height + 2) - #self.myName = self.add(npyscreen.TitleText, name='Name') - #self.myDepartment = self.add(npyscreen.TitleSelectOne, scroll_exit=True, max_height=3, name='Department', - # values=['Department 1', 'Department 2', 'Department 3']) - #self.myDate = self.add(npyscreen.TitleDateCombo, name='Date Employed') + self.dialogueBox = self.add(npyscreen.Textfield, + name='Type Here', + max_width=inventory_width + art_width - 2, + max_height=1, + relx=2, + rely=top_division_height + 3) class MainMenu(npyscreen.Form):