adventure-game #3
|
@ -36,6 +36,14 @@ class GameNavigator(npyscreen.FormBaseNew):
|
|||
"""
|
||||
self.artBox.footer = location
|
||||
|
||||
def update_inventory(self, items):
|
||||
res = ''
|
||||
for element in items:
|
||||
res = res + str(element) + '\n'
|
||||
res = res.upper() # Inventory is always uppercase
|
||||
|
||||
self.inventoryContent.value = res # Set the logbox to that value
|
||||
|
||||
def create(self):
|
||||
top_division_height = 20
|
||||
inventory_width = 20
|
||||
|
@ -66,6 +74,14 @@ class GameNavigator(npyscreen.FormBaseNew):
|
|||
rely=2,
|
||||
editable=False)
|
||||
|
||||
self.inventoryContent = self.add(npyscreen.MultiLineEdit,
|
||||
max_width=inventory_width,
|
||||
max_height=top_division_height,
|
||||
relx=2,
|
||||
rely=3,
|
||||
value='------------------',
|
||||
editable=False)
|
||||
|
||||
self.logBoxOutline = self.add(npyscreen.BoxBasic,
|
||||
max_width=inventory_width + art_width,
|
||||
max_height=9,
|
||||
|
|
|
@ -141,6 +141,8 @@ class Handler(npyscreen.ButtonPress):
|
|||
except KeyError:
|
||||
self.parent.update_location('Unknown Location')
|
||||
|
||||
self.parent.update_inventory(player.playerData['player']['inventory'])
|
||||
|
||||
# Make sure to re-draw the art box when we're all done (in case we updated it in logic above)
|
||||
self.parent.artContent.display()
|
||||
|
||||
|
|
Loading…
Reference in New Issue