Force write speechtext, textlen and uitext for scn script

This commit is contained in:
2025-12-01 18:04:52 +08:00
parent 64dadfb03d
commit cf677dc786

View File

@@ -617,17 +617,15 @@ impl Script for ScnScript {
} }
text[1][self.language_index][1] text[1][self.language_index][1]
.set_string(message.replace("\n", "\\n")); .set_string(message.replace("\n", "\\n"));
// Modify save message if exists // text length
if text[1][self.language_index][3].is_string() { text[1][self.language_index][2]
.set_i64(message.chars().count() as i64);
text[1][self.language_index][3] text[1][self.language_index][3]
.set_string(get_save_message(&message, true)); .set_string(get_save_message(&message, true));
}
if text[1][self.language_index][4].is_string() {
text[1][self.language_index][4] text[1][self.language_index][4]
.set_string(get_save_message(&message, false)); .set_string(get_save_message(&message, false));
} }
} }
}
} else { } else {
if text.len() <= 2 { if text.len() <= 2 {
continue; // Skip if there is no message continue; // Skip if there is no message
@@ -725,12 +723,10 @@ impl Script for ScnScript {
} }
text[2][self.language_index][1] text[2][self.language_index][1]
.set_string(message.replace("\n", "\\n")); .set_string(message.replace("\n", "\\n"));
// Modify save message if exists text[2][self.language_index][2]
if text[2][self.language_index][3].is_string() { .set_i64(message.chars().count() as i64);
text[2][self.language_index][3] text[2][self.language_index][3]
.set_string(get_save_message(&message, true)); .set_string(get_save_message(&message, true));
}
if text[2][self.language_index][4].is_string() {
text[2][self.language_index][4] text[2][self.language_index][4]
.set_string(get_save_message(&message, false)); .set_string(get_save_message(&message, false));
} }
@@ -740,7 +736,6 @@ impl Script for ScnScript {
} }
} }
} }
}
if scene["selects"].is_list() { if scene["selects"].is_list() {
for select in scene["selects"].members_mut() { for select in scene["selects"].members_mut() {
if select.is_object() { if select.is_object() {