Handler can load the current room!

This commit is contained in:
Joe S 2021-02-24 00:02:33 -05:00
parent 6c162e42b4
commit 56f3fb2fee
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,7 @@
import npyscreen
from yaml_parser import parse_datafile as parse
class Handler(npyscreen.ButtonPress):
"""
@ -40,7 +42,8 @@ class Handler(npyscreen.ButtonPress):
# Localize the player
player = self.parent.parentApp.player
room = player.playerData['player']['location'] # This is ugly, and should point to the room's name and not the system name
roomlocation = player.playerData['player']['location'] + '.yaml'
room = parse(self.parent.parentApp.mainPath / 'gamedata/world' / roomlocation)
self.parent.update_log('You are in {0}.'.format(room))
# Log the command that we parsed