Compare commits
No commits in common. "e58af07b5e28da46c26c872383a8eda711eb3c2a" and "832e26232b9863542e51bff5dc08ca0cbb6d8d1f" have entirely different histories.
e58af07b5e
...
832e26232b
|
@ -9,20 +9,7 @@ class Handler(npyscreen.ButtonPress):
|
||||||
3: re-render the screen
|
3: re-render the screen
|
||||||
"""
|
"""
|
||||||
def whenPressed(self):
|
def whenPressed(self):
|
||||||
# This is the raw command from the user
|
self.parent.update_log(self.parent.dialogueBox.value)
|
||||||
raw_command = self.parent.dialogueBox.value
|
|
||||||
|
|
||||||
# This is the raw command from the user
|
|
||||||
parsed_command = raw_command.split()
|
|
||||||
|
|
||||||
try:
|
|
||||||
command = parsed_command.pop(0)
|
|
||||||
except IndexError:
|
|
||||||
pass
|
|
||||||
arguments = parsed_command
|
|
||||||
|
|
||||||
self.parent.update_log('command: ' + command)
|
|
||||||
self.parent.update_log('args: {0}'.format(arguments))
|
|
||||||
self.parent.dialogueBox.value = ''
|
self.parent.dialogueBox.value = ''
|
||||||
self.parent.artContent.display()
|
self.parent.artContent.display()
|
||||||
self.parent.parentApp.switchForm('GAME')
|
self.parent.parentApp.switchForm('GAME')
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import pathlib
|
import pathlib
|
||||||
import npyscreen
|
import npyscreen
|
||||||
import logging
|
|
||||||
from npyscreen import NotEnoughSpaceForWidget
|
from npyscreen import NotEnoughSpaceForWidget
|
||||||
from os import system
|
from os import system
|
||||||
|
|
||||||
|
@ -20,19 +19,12 @@ class AlphaWarning(npyscreen.Popup):
|
||||||
|
|
||||||
|
|
||||||
class AdventureGame(npyscreen.NPSAppManaged):
|
class AdventureGame(npyscreen.NPSAppManaged):
|
||||||
"""
|
|
||||||
This is the 'root' of the entire game!
|
|
||||||
"""
|
|
||||||
# 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
|
||||||
# Set the path all other files will follow
|
# Set the path all other files will follow
|
||||||
self.mainPath = pathlib.Path(__file__).parent
|
self.mainPath = pathlib.Path(__file__).parent
|
||||||
|
|
||||||
# Setup logging
|
|
||||||
self.log = logging
|
|
||||||
self.log.basicConfig(filename=self.mainPath / 'logs/AdventureGame.log', filemode='w', level=logging.DEBUG)
|
|
||||||
|
|
||||||
# Parse world
|
# Parse world
|
||||||
self.gamelib = parse(
|
self.gamelib = parse(
|
||||||
self.mainPath / '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
|
||||||
|
|
Loading…
Reference in New Issue