This commit is contained in:
2025-07-29 19:37:39 +08:00
parent 6c620c5b59
commit c6973e9c0f
2 changed files with 11 additions and 2 deletions

View File

@@ -115,6 +115,9 @@ fn detect_script_type(buf: &[u8], buf_len: usize, _filename: &str) -> Option<&'s
if buf_len >= 8 && buf.starts_with(b"CatScene") {
return Some(&ScriptType::CatSystem);
}
if buf_len >= 4 && buf.starts_with(b"CSTL") {
return Some(&ScriptType::CatSystemCstl);
}
None
}

View File

@@ -176,7 +176,13 @@ impl Script for CstlScript {
if self.langs.is_empty() || self.data.is_empty() {
return Err(anyhow::anyhow!("CSTL script has no languages or data"));
}
Ok(self.data[self.lang_index.unwrap_or(0)].clone())
Ok(self.data[self.lang_index.unwrap_or(0)]
.iter()
.map(|m| Message {
name: m.name.clone(),
message: m.message.replace("\\n", "\n"),
})
.collect())
}
fn import_messages<'a>(
@@ -215,7 +221,7 @@ impl Script for CstlScript {
mes = mes.replace(k, v);
}
}
m.message = mes;
m.message = mes.replace("\n", "\\n");
}
file.write_all(b"CSTL")?;
file.write_u32(0)?; // unk