Latest fixes for multilingual support.

This commit is contained in:
Storm Dragon
2026-02-27 23:47:21 -05:00
parent c658bb6cd7
commit e999b2ff5c
3 changed files with 17 additions and 16 deletions

View File

@@ -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;
}

View File

@@ -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 = "";

View File

@@ -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;
}