npyscreen-adventure-game #8

Manually merged
Kenwood merged 29 commits from npyscreen-adventure-game into adventure-game 2021-02-23 13:43:20 -05:00
2 changed files with 11 additions and 3 deletions
Showing only changes of commit 832e26232b - Show all commits

View File

@ -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.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.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) self.add(npyscreen.MultiLineEdit, value=self.parentApp.gamelib['menu']['graphics']['logo'], editable=False)

View File

@ -1,3 +1,4 @@
import pathlib
import npyscreen import npyscreen
from npyscreen import NotEnoughSpaceForWidget from npyscreen import NotEnoughSpaceForWidget
from os import system from os import system
@ -21,10 +22,17 @@ class AdventureGame(npyscreen.NPSAppManaged):
# Do on creation # Do on creation
def onStart(self): def onStart(self):
# Setup some important 'global' values we'll need later # Setup some important 'global' values we'll need later
self.gamelib = parse( # Set the path all other files will follow
'gamedata/gamelib.yaml') # parse this data first (since it includes graphics for the main menu 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 # Set screen size before drawing windows
dimensions = self.gamelib['menu']['graphics']['dimensions'] dimensions = self.gamelib['menu']['graphics']['dimensions']