Add artemis txt script support

This commit is contained in:
2025-08-17 17:19:13 +08:00
parent 1df6f0e414
commit 5898d8f94e
7 changed files with 1252 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ msg-tool create -t <script-type> <input> <output>
|---|---|---|---|---|---|---|---|---|
| `artemis` | `artemis` | Artemis Engine AST file (.ast) | ✔️ | ✔️ | ❌ | ❌ | ❌ | |
| `artemis-asb` | `artemis` | Artemis Engine ASB file (.asb) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
| `artemis-txt` | `artemis` | Artemis Engine TXT file (.txt) | ✔️ | ✔️ | ❌ | ❌ | ❌ | |
| Archive Type | Feature Name | Name | Unpack | Pack | Remarks |
|---|---|---|---|---|---|

View File

@@ -240,6 +240,21 @@ pub struct Arg {
/// Specify the language of Artemis AST script.
/// If not specified, the first language will be used.
pub artemis_ast_lang: Option<String>,
#[cfg(feature = "artemis")]
#[arg(
long,
global = true,
value_delimiter = ',',
default_value = "遅延イベントCG,遅延背景,bgv_in,イベントCG,遅延ポップアップ"
)]
/// Artemis Engine blacklist tag names for TXT script.
/// This is used to ignore these tags when finding names in Artemis TXT script.
pub artemis_txt_blacklist_names: Vec<String>,
#[cfg(feature = "artemis")]
#[arg(long, global = true)]
/// Specify the language of Artemis TXT script.
/// If not specified, the first language will be used.
pub artemis_txt_lang: Option<String>,
#[cfg(feature = "cat-system")]
#[arg(long, global = true)]
/// CatSystem2 CSTL script language, used to extract messages from CSTL script.

View File

@@ -1763,6 +1763,12 @@ fn main() {
entis_gls_srcxml_lang: arg.entis_gls_srcxml_lang.clone(),
#[cfg(feature = "will-plus")]
will_plus_ws2_no_disasm: arg.will_plus_ws2_no_disasm,
#[cfg(feature = "artemis")]
artemis_txt_blacklist_names: std::sync::Arc::new(std::collections::HashSet::from_iter(
arg.artemis_txt_blacklist_names.iter().cloned(),
)),
#[cfg(feature = "artemis")]
artemis_txt_lang: arg.artemis_txt_lang.clone(),
};
match &arg.command {
args::Command::Export { input, output } => {

View File

@@ -3,3 +3,4 @@
pub mod archive;
pub mod asb;
pub mod ast;
pub mod txt;

1216
src/scripts/artemis/txt.rs Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -112,6 +112,8 @@ lazy_static::lazy_static! {
Box::new(entis_gls::srcxml::SrcXmlScriptBuilder::new()),
#[cfg(feature = "softpal")]
Box::new(softpal::scr::SoftpalScriptBuilder::new()),
#[cfg(feature = "artemis")]
Box::new(artemis::txt::TxtBuilder::new()),
];
/// A list of all script extensions.
pub static ref ALL_EXTS: Vec<String> =

View File

@@ -344,6 +344,14 @@ pub struct ExtraConfig {
/// Use another parser to parse the script.
/// Should only be used when the default parser not works well.
pub will_plus_ws2_no_disasm: bool,
#[cfg(feature = "artemis")]
/// Artemis Engine blacklist tag names for TXT script.
/// This is used to ignore these tags when finding names in Artemis TXT script.
pub artemis_txt_blacklist_names: std::sync::Arc<std::collections::HashSet<String>>,
#[cfg(feature = "artemis")]
/// Specify the language of Artemis TXT script.
/// If not specified, the first language will be used.
pub artemis_txt_lang: Option<String>,
}
#[derive(Clone, Copy, Debug, ValueEnum, PartialEq, Eq, PartialOrd, Ord)]
@@ -355,6 +363,9 @@ pub enum ScriptType {
#[cfg(feature = "artemis")]
/// Artemis Engine ASB script
ArtemisAsb,
#[cfg(feature = "artemis")]
/// Artemis Engine TXT script
ArtemisTxt,
#[cfg(feature = "artemis-arc")]
#[value(alias("pfs"))]
/// Artemis archive (pfs)