diff --git a/Adventure Game/adventure_game/MainMenu.py b/Adventure Game/adventure_game/MainMenu.py index 02ec615..b01614b 100644 --- a/Adventure Game/adventure_game/MainMenu.py +++ b/Adventure Game/adventure_game/MainMenu.py @@ -17,5 +17,5 @@ class MainMenu(npyscreen.Form): self.add(npyscreen.FixedText, value='You cannot select a file yet! Just hit OK', editable=False) self.playerSaveLocation = self.add(npyscreen.TitleFilenameCombo, name="Your save file:") - self.parentApp.player = Player('playerdata/defaults/default_player.yaml') + self.parentApp.player = Player(self.parentApp.mainPath / 'playerdata/defaults/default_player.yaml') self.add(npyscreen.MultiLineEdit, value=self.parentApp.gamelib['menu']['graphics']['logo'], editable=False) \ No newline at end of file diff --git a/Adventure Game/adventure_game/main.py b/Adventure Game/adventure_game/__main__.py similarity index 84% rename from Adventure Game/adventure_game/main.py rename to Adventure Game/adventure_game/__main__.py index 286b32d..f035b1a 100644 --- a/Adventure Game/adventure_game/main.py +++ b/Adventure Game/adventure_game/__main__.py @@ -1,3 +1,4 @@ +import pathlib import npyscreen from npyscreen import NotEnoughSpaceForWidget from os import system @@ -21,10 +22,17 @@ class AdventureGame(npyscreen.NPSAppManaged): # Do on creation def onStart(self): # Setup some important 'global' values we'll need later + # Set the path all other files will follow + self.mainPath = pathlib.Path(__file__).parent + + # Parse world self.gamelib = parse( - 'gamedata/gamelib.yaml') # parse this data first (since it includes graphics for the main menu + self.mainPath / 'gamedata/gamelib.yaml') # parse this data first (since it includes graphics for the main menu + + # Intalize the player as none, the player will be created in the main menu. + self.player = None + - self.player = None # Intalize the player as none, the player will be created in the main menu. # Set screen size before drawing windows dimensions = self.gamelib['menu']['graphics']['dimensions']