From e8a231f2e263f8a58f36034c55f82031eb8d44eb Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 20 Jan 2024 15:26:36 -0800 Subject: [PATCH] Fix translating text box ignoring line limit Originally I did a straight deep copy of the original lines, but this ignores the limit of either 12 or 26 lines in a text box. So we defer to addline() which will enforce the limit accordingly, just like it would do with the original text box. --- desktop_version/src/Textbox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Textbox.cpp b/desktop_version/src/Textbox.cpp index 592090ea..700a6019 100644 --- a/desktop_version/src/Textbox.cpp +++ b/desktop_version/src/Textbox.cpp @@ -239,8 +239,12 @@ void textboxclass::translate(void) { if (!loc::is_cutscene_translated(original.script_name)) { - // Copy the original back - lines = std::vector(original.lines); + // Copy the original back, but keep the limit of lines in mind + lines.clear(); + for (size_t i = 0; i < original.lines.size(); i++) + { + addline(original.lines[i]); + } return; }