Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit 56af7de235495c7ab6ae76e2887136b6650af9cf
parent 29a4bbdabe334c55872725bc8927e2ce5a897f2f
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Wed, 23 Dec 2020 17:56:17 -0600

small work toward dialog

Diffstat:
Adata/img/pictures/jisella_1/dialog_portrait.png | 0
Mdata/json/dialog.json | 2++
Msrc/dialog.py | 30+++++++++++++++++++++++++++++-
3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/data/img/pictures/jisella_1/dialog_portrait.png b/data/img/pictures/jisella_1/dialog_portrait.png Binary files differ. diff --git a/data/json/dialog.json b/data/json/dialog.json @@ -3,11 +3,13 @@ { "speaker" : "Jisella", "icon" : null, + "voice" : "Voice2", "text" : "This is a test of the dialog subsystem." }, { "speaker" : "Jisella", "icon" : null, + "voice" : "Voice2", "text" : "Further test." } ] diff --git a/src/dialog.py b/src/dialog.py @@ -26,12 +26,40 @@ class DialogManager(manager.Manager): # Other vals self.dialog_sequence = [] + self.sequence_index = 0 + self.text_speed = 1 + self.text_write_timer = 0 + self.current_text_char_index = 0 + self.continue_ready = False + self.max_line = 0 + self.total_lines = 0 + self.text_box = None + self.text_box_pos = (0, 508) + self.continue_prompt = None + self.continue_prompt_pos = (964, 748) + self.text_area_topleft = (48, 560) + self.text_area_height = 160 + + # Swap-in values + self.displayed_characters = [] # Must be an ordered list rather than a sprite group + self.current_text_string = "" + self.displayed_strings = [""] # list of text lines + self.rendered_text_surfaces = [None] + self.line_number = 0 + self.current_line_starting_index = 0 + self.current_font = None # An index of the 'fonts' value + self.current_name_font = None + self.current_font_height = 0 + self.current_voice = None + self.voice_delay = 0 + self.script_index = -1 def load_sequence(self, seq_id): """ Load a dialog sequence from the dialog definition. Only one sequence is loaded - at a time. + at a time. Also resets sequence values. """ self.dialog_sequence = DIALOGS[seq_id] + self.sequence_index = 0