diff --git a/base/scene.py b/base/scene.py index 27fe1e8..4fd4503 100644 --- a/base/scene.py +++ b/base/scene.py @@ -16,11 +16,14 @@ def __init__(self, console_manager, scene_manager, game_context): @abc.abstractmethod def render(self): + """This will be called by the scene_manager.""" pass @abc.abstractmethod def handle_input(self): + """Handle any player expected input here.""" pass def transition_to(self, scene_name): + """Tells the scene_manager to move to the provided scene.""" self.scene_manager.transition_to(scene_name) diff --git a/managers/console_manager.py b/managers/console_manager.py index 98723ee..a88c611 100644 --- a/managers/console_manager.py +++ b/managers/console_manager.py @@ -1,6 +1,7 @@ """ Console Manager: handles the creation and rendering of all consoles. """ +import textwrap import tdl import os @@ -39,11 +40,7 @@ class Menu(Console): """ Create console for displaying choices to the player """ - MENU_TEMPLATE = """ - {menu_name} - {menu_text} - {options} - """ + MENU_TEMPLATE = "{menu_name}\n\n{menu_text}\n\n{options}" OPTION_TEMPLATE = "({option_char:}) {option_description}" @@ -72,7 +69,7 @@ def _build_options(self): ) option_msg.append(option) self.letter_index += 1 - return "\n".join(option_msg) + return textwrap.indent("\n\n".join(option_msg), " ") # TODO: this could be nicer... def print_str(self, text, pos_x, pos_y): self.move(pos_x, pos_y) diff --git a/scenes/character_creation.py b/scenes/character_creation.py index 08fd137..a3c5dda 100644 --- a/scenes/character_creation.py +++ b/scenes/character_creation.py @@ -56,6 +56,7 @@ def __init__(self, console_manager, scene_manager, game_context): self.options, self.main_console.width, self.main_console.height) + # self.menu.create_menu(20, 20) self.active_control = self.control_name # TODO THIS should be in the menu itself. @@ -74,7 +75,7 @@ def render_menu(self): def render(self, **kwargs): self.menu.clear() - self.menu.move(0, 0) + self.menu.move(20, 20) for control in self.controls: if self.active_control is None \ or self.controls.index(self.active_control) >= self.controls.index(control): diff --git a/ui/flavor_text.py b/ui/flavor_text.py index b81976f..1eaad1f 100644 --- a/ui/flavor_text.py +++ b/ui/flavor_text.py @@ -5,10 +5,10 @@ MAIN_MENU = { "name": "Main Menu", "text": """ - Welcome to Python Roguelike Framework! - - This '@' is you. Your goal is to explore the dungeon. Use caution though as there are - monsters lurking around every corner waiting to jump out and attack you! + Welcome to Python Roguelike Framework! + + This '@' is you. Your goal is to explore the dungeon. Use caution though as there are + monsters lurking around every corner waiting to jump out and attack you! """, "options": ["Play", "Quit"] }