From 56f3fb2feeeb12c593a7f1134a58113a208d840b Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Wed, 24 Feb 2021 00:02:33 -0500 Subject: [PATCH] Handler can load the current room! --- Adventure Game/adventure_game/Handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Adventure Game/adventure_game/Handler.py b/Adventure Game/adventure_game/Handler.py index 1919dca..10cad2b 100644 --- a/Adventure Game/adventure_game/Handler.py +++ b/Adventure Game/adventure_game/Handler.py @@ -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