npyscreen-adventure-game #8
|
@ -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)
|
|
@ -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
|
||||
self.gamelib = parse(
|
||||
'gamedata/gamelib.yaml') # parse this data first (since it includes graphics for the main menu
|
||||
# Set the path all other files will follow
|
||||
self.mainPath = pathlib.Path(__file__).parent
|
||||
|
||||
# Parse world
|
||||
self.gamelib = parse(
|
||||
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']
|
Loading…
Reference in New Issue