mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-07-08 01:31:53 +08:00
Add artemis txt script support
This commit is contained in:
@@ -67,6 +67,7 @@ msg-tool create -t <script-type> <input> <output>
|
|||||||
|---|---|---|---|---|---|---|---|---|
|
|---|---|---|---|---|---|---|---|---|
|
||||||
| `artemis` | `artemis` | Artemis Engine AST file (.ast) | ✔️ | ✔️ | ❌ | ❌ | ❌ | |
|
| `artemis` | `artemis` | Artemis Engine AST file (.ast) | ✔️ | ✔️ | ❌ | ❌ | ❌ | |
|
||||||
| `artemis-asb` | `artemis` | Artemis Engine ASB file (.asb) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
|
| `artemis-asb` | `artemis` | Artemis Engine ASB file (.asb) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
|
||||||
|
| `artemis-txt` | `artemis` | Artemis Engine TXT file (.txt) | ✔️ | ✔️ | ❌ | ❌ | ❌ | |
|
||||||
|
|
||||||
| Archive Type | Feature Name | Name | Unpack | Pack | Remarks |
|
| Archive Type | Feature Name | Name | Unpack | Pack | Remarks |
|
||||||
|---|---|---|---|---|---|
|
|---|---|---|---|---|---|
|
||||||
|
|||||||
15
src/args.rs
15
src/args.rs
@@ -240,6 +240,21 @@ pub struct Arg {
|
|||||||
/// Specify the language of Artemis AST script.
|
/// Specify the language of Artemis AST script.
|
||||||
/// If not specified, the first language will be used.
|
/// If not specified, the first language will be used.
|
||||||
pub artemis_ast_lang: Option<String>,
|
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")]
|
#[cfg(feature = "cat-system")]
|
||||||
#[arg(long, global = true)]
|
#[arg(long, global = true)]
|
||||||
/// CatSystem2 CSTL script language, used to extract messages from CSTL script.
|
/// CatSystem2 CSTL script language, used to extract messages from CSTL script.
|
||||||
|
|||||||
@@ -1763,6 +1763,12 @@ fn main() {
|
|||||||
entis_gls_srcxml_lang: arg.entis_gls_srcxml_lang.clone(),
|
entis_gls_srcxml_lang: arg.entis_gls_srcxml_lang.clone(),
|
||||||
#[cfg(feature = "will-plus")]
|
#[cfg(feature = "will-plus")]
|
||||||
will_plus_ws2_no_disasm: arg.will_plus_ws2_no_disasm,
|
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 {
|
match &arg.command {
|
||||||
args::Command::Export { input, output } => {
|
args::Command::Export { input, output } => {
|
||||||
|
|||||||
@@ -3,3 +3,4 @@
|
|||||||
pub mod archive;
|
pub mod archive;
|
||||||
pub mod asb;
|
pub mod asb;
|
||||||
pub mod ast;
|
pub mod ast;
|
||||||
|
pub mod txt;
|
||||||
|
|||||||
1216
src/scripts/artemis/txt.rs
Normal file
1216
src/scripts/artemis/txt.rs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -112,6 +112,8 @@ lazy_static::lazy_static! {
|
|||||||
Box::new(entis_gls::srcxml::SrcXmlScriptBuilder::new()),
|
Box::new(entis_gls::srcxml::SrcXmlScriptBuilder::new()),
|
||||||
#[cfg(feature = "softpal")]
|
#[cfg(feature = "softpal")]
|
||||||
Box::new(softpal::scr::SoftpalScriptBuilder::new()),
|
Box::new(softpal::scr::SoftpalScriptBuilder::new()),
|
||||||
|
#[cfg(feature = "artemis")]
|
||||||
|
Box::new(artemis::txt::TxtBuilder::new()),
|
||||||
];
|
];
|
||||||
/// A list of all script extensions.
|
/// A list of all script extensions.
|
||||||
pub static ref ALL_EXTS: Vec<String> =
|
pub static ref ALL_EXTS: Vec<String> =
|
||||||
|
|||||||
11
src/types.rs
11
src/types.rs
@@ -344,6 +344,14 @@ pub struct ExtraConfig {
|
|||||||
/// Use another parser to parse the script.
|
/// Use another parser to parse the script.
|
||||||
/// Should only be used when the default parser not works well.
|
/// Should only be used when the default parser not works well.
|
||||||
pub will_plus_ws2_no_disasm: bool,
|
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)]
|
#[derive(Clone, Copy, Debug, ValueEnum, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
@@ -355,6 +363,9 @@ pub enum ScriptType {
|
|||||||
#[cfg(feature = "artemis")]
|
#[cfg(feature = "artemis")]
|
||||||
/// Artemis Engine ASB script
|
/// Artemis Engine ASB script
|
||||||
ArtemisAsb,
|
ArtemisAsb,
|
||||||
|
#[cfg(feature = "artemis")]
|
||||||
|
/// Artemis Engine TXT script
|
||||||
|
ArtemisTxt,
|
||||||
#[cfg(feature = "artemis-arc")]
|
#[cfg(feature = "artemis-arc")]
|
||||||
#[value(alias("pfs"))]
|
#[value(alias("pfs"))]
|
||||||
/// Artemis archive (pfs)
|
/// Artemis archive (pfs)
|
||||||
|
|||||||
Reference in New Issue
Block a user