From d050db0d6ef0b34613bd1e0d46a5a3f235486d94 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 21 Sep 2025 13:41:52 -0400 Subject: [PATCH] Dialogue instructions only show once per game now following the same pattern as display_text. --- speech.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/speech.py b/speech.py index 8c44d6e..7b905c6 100644 --- a/speech.py +++ b/speech.py @@ -13,6 +13,9 @@ import textwrap import time from sys import exit +# Keep track of whether dialog instructions have been shown +dialogUsageInstructions = False + class Speech: """Handles text-to-speech functionality.""" @@ -193,14 +196,16 @@ def _show_dialog_sequence(speech, dialog_config, sounds): entry_index += 1 continue - # Show dialog with appropriate controls (only on first entry) - if entry_index == 0: + # Show dialog with appropriate controls (only on first dialog of the game) + global dialogUsageInstructions + if not dialogUsageInstructions and entry_index == 0: if allow_skip: control_text = "\nPress any key to repeat, enter for next, or escape to skip all." else: control_text = "\nPress any key to repeat or enter for next." + dialogUsageInstructions = True else: - control_text = "" # No instructions after first entry + control_text = "" # No instructions after first dialog speech.speak(formatted_text + control_text) @@ -222,11 +227,8 @@ def _show_dialog_sequence(speech, dialog_config, sounds): entry_index += 1 break else: - # Repeat current entry (include instructions only on first entry) - repeat_text = formatted_text - if entry_index == 0: - repeat_text += control_text - speech.speak(repeat_text) + # Repeat current entry (no instructions when repeating) + speech.speak(formatted_text) def _format_dialog_entry(entry):