From e999b2ff5c964ea044c3eb3e44e30e863d42c5bc Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 27 Feb 2026 23:47:21 -0500 Subject: [PATCH] Latest fixes for multilingual support. --- character_dialog.nvgt | 22 +++++++++++----------- name_sanitize.nvgt | 3 ++- speech_history.nvgt | 8 ++++---- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/character_dialog.nvgt b/character_dialog.nvgt index c8976ad..3b95244 100644 --- a/character_dialog.nvgt +++ b/character_dialog.nvgt @@ -125,16 +125,21 @@ bool character_dialog_play_word_sound_sequence(const string& in message) { } bool character_dialog_repeat_requested() { - if (key_down(KEY_RETURN) || key_down(KEY_NUMPAD_ENTER) || key_down(KEY_ESCAPE) || key_down(KEY_AC_BACK)) { + key_code[] @pressedKeys = keys_pressed(); + if (@pressedKeys is null || pressedKeys.length() == 0) return false; + + for (uint keyIndex = 0; keyIndex < pressedKeys.length(); keyIndex++) { + int keyCode = pressedKeys[keyIndex]; + if (keyCode == KEY_RETURN || keyCode == KEY_NUMPAD_ENTER || keyCode == KEY_ESCAPE || keyCode == KEY_AC_BACK) + continue; + return true; } - return total_keys_down() > 0; + return false; } int character_dialog_wait_for_action(const string& in currentLine, bool interrupt) { - bool keyHeld = false; - while (true) { wait(5); @@ -148,12 +153,7 @@ int character_dialog_wait_for_action(const string& in currentLine, bool interrup bool repeatRequested = character_dialog_repeat_requested(); if (repeatRequested) { - if (!keyHeld) { - character_dialog_speak(currentLine, interrupt); - keyHeld = true; - } - } else { - keyHeld = false; + character_dialog_speak(currentLine, interrupt); } } @@ -178,7 +178,7 @@ bool character_dialog_show_lines(const string[] @dialogLines, bool interrupt = t string displayLine = currentLine; if (characterDialogShowUsageInstructions && !characterDialogUsageInstructionsShown) { - displayLine += "\nPress enter to continue, escape to skip, or any other key to repeat."; + displayLine += " Press enter to continue, escape to skip, or any other key to repeat."; characterDialogUsageInstructionsShown = true; } diff --git a/name_sanitize.nvgt b/name_sanitize.nvgt index 0561f24..0a8df39 100644 --- a/name_sanitize.nvgt +++ b/name_sanitize.nvgt @@ -45,7 +45,8 @@ bool is_windows_reserved_filename(const string& in upperName) { return false; } -string sanitize_filename_base_with_reserved_prefix(string name, const int maxLength = 40, const string fallback = "item", +string sanitize_filename_base_with_reserved_prefix(string name, const int maxLength = 40, + const string fallback = "item", const string reservedPrefix = "file_") { string normalized = normalize_name_whitespace(name); string result = ""; diff --git a/speech_history.nvgt b/speech_history.nvgt index 0ce04f7..0223993 100644 --- a/speech_history.nvgt +++ b/speech_history.nvgt @@ -83,8 +83,8 @@ void check_speech_history_keys() { speechHistoryCurrentIndex--; if (speechHistoryCurrentIndex < 0) { speechHistoryCurrentIndex = 0; - screen_reader_speak(speech_history_transform_message("Oldest message. " + speechHistory[speechHistoryCurrentIndex]), - true); + screen_reader_speak( + speech_history_transform_message("Oldest message. " + speechHistory[speechHistoryCurrentIndex]), true); return; } @@ -105,8 +105,8 @@ void check_speech_history_keys() { speechHistoryCurrentIndex++; if (speechHistoryCurrentIndex >= int(speechHistory.length())) { speechHistoryCurrentIndex = speechHistory.length() - 1; - screen_reader_speak(speech_history_transform_message("Newest message. " + speechHistory[speechHistoryCurrentIndex]), - true); + screen_reader_speak( + speech_history_transform_message("Newest message. " + speechHistory[speechHistoryCurrentIndex]), true); return; }