adventure-game #3

Open
Kenwood wants to merge 80 commits from adventure-game into master
2 changed files with 15 additions and 16 deletions
Showing only changes of commit 5fb78fece8 - Show all commits

View File

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

View File

@ -28,9 +28,9 @@ class AdventureGame(npyscreen.NPSAppManaged):
# 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 +42,7 @@ class AdventureGame(npyscreen.NPSAppManaged):
if __name__ == '__main__':
# Set the screen size bigger
system('mode con: cols={0} lines={1}'.format(124, 30))
system('mode con: cols={0} lines={1}'.format(124, 36))
# Make a new adventure game if not imported
adventure_game = AdventureGame()