diff --git a/common/serialization/subtitles/subtitles_v2.cpp b/common/serialization/subtitles/subtitles_v2.cpp index 84dbde76d6..5bb2be0adc 100644 --- a/common/serialization/subtitles/subtitles_v2.cpp +++ b/common/serialization/subtitles/subtitles_v2.cpp @@ -186,6 +186,24 @@ GameSubtitlePackage read_json_files_v2(const GameSubtitleDefinitionFile& file_in "subtitle_line_path"); lang_lines = package.combined_lines; } + // Update any line metadata to `merge = false` if they've been defined + // otherwise, the lines get skipped + for (const auto [scene_name, scene_lines] : lang_lines.cutscenes) { + if (package.combined_meta.cutscenes.find(scene_name) != + package.combined_meta.cutscenes.end()) { + for (int i = 0; i < package.combined_meta.cutscenes[scene_name].lines.size(); i++) { + package.combined_meta.cutscenes[scene_name].lines[i].merge = false; + } + } + } + for (const auto [scene_name, scene_lines] : lang_lines.other) { + if (package.combined_meta.other.find(scene_name) != package.combined_meta.other.end()) { + for (int i = 0; i < package.combined_meta.other[scene_name].lines.size(); i++) { + package.combined_meta.other[scene_name].lines[i].merge = false; + } + } + } + for (const auto& [scene_name, scene_info] : lang_lines.cutscenes) { package.scenes_defined_in_lang.insert(scene_name); } diff --git a/common/serialization/subtitles/subtitles_v2.h b/common/serialization/subtitles/subtitles_v2.h index f5c22e4bb5..35ec9a37eb 100644 --- a/common/serialization/subtitles/subtitles_v2.h +++ b/common/serialization/subtitles/subtitles_v2.h @@ -10,6 +10,9 @@ struct SubtitleLineMetadata { int frame_end; bool offscreen; std::string speaker; + // NOTE: merge is a bad name, as we don't actually merge anything (the game doesn't load the + // english subtitles as well) and all this does if set is it's ignored when being written out to + // the file bool merge; bool operator==(const SubtitleLineMetadata& other) const {