Compare commits

..

No commits in common. "fa3e73498def8bb11bb8c6a05876aac21b5e2672" and "7eb8dfde07460ee9b6618bd2fb85a645754b123e" have entirely different histories.

3 changed files with 15 additions and 38 deletions

View File

@ -6,17 +6,13 @@ class QuitButton(npyscreen.ButtonPress):
def whenPressed(self):
sys.exit(0)
class Render(npyscreen.ButtonPress):
class SendButton(npyscreen.ButtonPress):
def whenPressed(self):
self.parent.artContent.value = 'Undraw!'
self.parent.artContent.display()
self.parent.parentApp.switchForm('GAME')
class GameNavigator(npyscreen.FormBaseNew):
# def afterEditing(self):
# it self.parentApp.setNextForm('GAME')
# def afterEditing(self):
#it self.parentApp.setNextForm('GAME')
def create(self):
top_division_height = 20
@ -47,39 +43,24 @@ class GameNavigator(npyscreen.FormBaseNew):
rely=2,
editable=False)
self.logBoxOutline = self.add(npyscreen.BoxBasic,
max_width=inventory_width + art_width,
max_height=9,
relx=1,
rely=top_division_height + 2,
editable=False)
self.logBox = self.add(npyscreen.Textfield,
name='Type Here',
max_width=inventory_width + art_width - 7,
max_height=7,
relx=2,
rely=top_division_height + 3,
editable=False)
self.dialogueBoxOutline = self.add(npyscreen.BoxBasic,
max_width=inventory_width + art_width,
max_height=3,
relx=1,
rely=top_division_height + 2 + 9,
rely=top_division_height + 2,
editable=False)
self.dialogueBox = self.add(npyscreen.Textfield,
name='Type Here',
max_width=inventory_width + art_width - 14,
max_width=inventory_width + art_width - 7,
max_height=1,
relx=2,
rely=top_division_height + 3 + 9)
rely=top_division_height + 3)
self.sendButton = self.add(Render,
self.sendButton = self.add(SendButton,
name="Send",
relx=inventory_width + art_width - 7,
rely=top_division_height + 3 + 9)
rely=top_division_height + 3)
self.quitButton = self.add(QuitButton,
name="Quit",
relx=1,

View File

@ -1,9 +1,5 @@
import npyscreen
from Player import Player
class MainMenu(npyscreen.Form):
def afterEditing(self):
# TODO: the game needs to happen after this inital main menu
@ -12,6 +8,4 @@ class MainMenu(npyscreen.Form):
def create(self):
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.add(npyscreen.MultiLineEdit, value=self.parentApp.gamelib['menu']['graphics']['logo'], editable=False)

View File

@ -5,6 +5,7 @@ from os import system
from yaml_parser import parse_datafile as parse
from GameNavigator import GameNavigator
from MainMenu import MainMenu
from Player import Player
class AlphaWarning(npyscreen.Popup):
@ -23,14 +24,15 @@ class AdventureGame(npyscreen.NPSAppManaged):
# 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
self.playerSaveLocation = 'playerdata/defaults/default_player.yaml' #TODO: Actually load the player data
self.player = None # Intalize the player as none, the player will be created in the main menu.
self.player = Player(self.playerSaveLocation)
# Set screen size before drawing windows
dimensions = self.gamelib['menu']['graphics']['dimensions']
#system('mode con: cols={0} lines={1}'.format(
# dimensions['inventory_width']+dimensions['art_width'],
# 30)) # TODO: Finish setting this up.
system('mode con: cols={0} lines={1}'.format(
dimensions['inventory_width']+dimensions['art_width'],
30)) # TODO: Finish setting this up.
# Draw game windows
self.addForm('GAME', GameNavigator, name='Unnamed Adventure Game') # This window should draw the actual game
@ -42,7 +44,7 @@ class AdventureGame(npyscreen.NPSAppManaged):
if __name__ == '__main__':
# Set the screen size bigger
system('mode con: cols={0} lines={1}'.format(124, 36))
system('mode con: cols={0} lines={1}'.format(124, 30))
# Make a new adventure game if not imported
adventure_game = AdventureGame()