Skip to content

Commit

Permalink
Mark duplicate as comment
Browse files Browse the repository at this point in the history
  • Loading branch information
storycraft committed Jan 11, 2021
1 parent 12c421b commit 18ee942
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scn-script-extractor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ fn main() {
}
writeln!(output_writer).unwrap();

let mut used_texts: Vec::<u64> = Vec::new();

writeln!(output_writer, "[script]").unwrap();
writeln!(output_writer, "# lines: {}\n", scripts.len()).unwrap();
for (character, character_sub, text) in scripts.iter() {
Expand All @@ -191,6 +193,13 @@ fn main() {
let text_str = ref_table.get_string(*text as usize).expect(&format!("Cannot find string reference # {}", text));

writeln!(output_writer, "# {}", text_str).unwrap();
if used_texts.contains(text) {
write!(output_writer, "# ").unwrap();

} else {
used_texts.push(*text);
}

writeln!(output_writer, "{} = {}\n", *text, Value::String(text_str.clone())).unwrap();
}

Expand Down

0 comments on commit 18ee942

Please sign in to comment.