mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-16 01:54:19 +08:00
Fix extract message name not works on yosuga
Fix typo
This commit is contained in:
@@ -614,9 +614,9 @@ pub struct Arg {
|
||||
/// Default value: 15.
|
||||
pub zopfli_maximum_block_splits: u16,
|
||||
#[cfg(feature = "entis-gls")]
|
||||
#[arg(long, global = true, action = ArgAction::SetTrue)]
|
||||
#[arg(long, global = true, action = ArgAction::SetTrue, alias = "entis-gls-csx-diasm")]
|
||||
/// Disassemble Entis GLS csx script when exporting in custom mode.
|
||||
pub entis_gls_csx_diasm: bool,
|
||||
pub entis_gls_csx_disasm: bool,
|
||||
#[command(subcommand)]
|
||||
/// Command
|
||||
pub command: Command,
|
||||
|
||||
@@ -3306,7 +3306,7 @@ fn main() {
|
||||
#[cfg(feature = "artemis-panmimisoft")]
|
||||
artemis_panmimisoft_txt_multi_lang: arg.artemis_panmimisoft_txt_multi_lang,
|
||||
#[cfg(feature = "entis-gls")]
|
||||
entis_gls_csx_diasm: arg.entis_gls_csx_diasm,
|
||||
entis_gls_csx_disasm: arg.entis_gls_csx_disasm,
|
||||
});
|
||||
match &arg.command {
|
||||
args::Command::Export { input, output } => {
|
||||
|
||||
@@ -209,10 +209,7 @@ impl ECSExecutionImage {
|
||||
let csvt = disasm.read_csvt()?;
|
||||
if csom == CsomImmediate && csvt == CsvtString {
|
||||
let text = disasm.get_string_literal()?;
|
||||
string_stack.insert(0, text);
|
||||
if string_stack.len() > 8 {
|
||||
string_stack.pop();
|
||||
}
|
||||
string_stack.push(text);
|
||||
}
|
||||
} else if cmd.code == CsicCall {
|
||||
disasm.stream.pos = cmd.addr as usize + 1;
|
||||
@@ -238,6 +235,7 @@ impl ECSExecutionImage {
|
||||
));
|
||||
}
|
||||
if string_stack[0].starts_with("@") {
|
||||
string_stack.clear();
|
||||
continue;
|
||||
}
|
||||
message.push_str(string_stack[0].as_str());
|
||||
@@ -250,6 +248,11 @@ impl ECSExecutionImage {
|
||||
cmd.addr
|
||||
));
|
||||
}
|
||||
if string_stack[0] == "心の声" {
|
||||
string_stack.clear();
|
||||
// 傻逼旁白
|
||||
continue;
|
||||
}
|
||||
name = Some(string_stack[0].clone());
|
||||
} else if func_name == "AddSelect" {
|
||||
if string_stack.is_empty() {
|
||||
@@ -265,6 +268,7 @@ impl ECSExecutionImage {
|
||||
messages.push(Message::new(message.clone(), name.take()));
|
||||
message.clear();
|
||||
}
|
||||
string_stack.clear();
|
||||
pre_is_mess = is_mess;
|
||||
}
|
||||
}
|
||||
@@ -295,10 +299,7 @@ impl ECSExecutionImage {
|
||||
let csvt = disasm.read_csvt()?;
|
||||
if csom == CsomImmediate && csvt == CsvtString {
|
||||
let text = disasm.get_string_literal()?;
|
||||
string_stack.insert(0, text);
|
||||
if string_stack.len() > 8 {
|
||||
string_stack.pop();
|
||||
}
|
||||
string_stack.push(text);
|
||||
}
|
||||
} else if cmd.code == CsicCall {
|
||||
disasm.stream.pos = cmd.addr as usize + 1;
|
||||
@@ -327,6 +328,11 @@ impl ECSExecutionImage {
|
||||
));
|
||||
}
|
||||
if string_stack[0].starts_with("@") {
|
||||
eprintln!(
|
||||
"Skipping control string at 0x{:08x}: {}",
|
||||
cmd.addr, string_stack[0]
|
||||
);
|
||||
string_stack.clear();
|
||||
continue;
|
||||
}
|
||||
message.push_str(string_stack[0].as_str());
|
||||
@@ -339,6 +345,11 @@ impl ECSExecutionImage {
|
||||
cmd.addr
|
||||
));
|
||||
}
|
||||
if string_stack[0] == "心の声" {
|
||||
// 傻逼旁白
|
||||
string_stack.clear();
|
||||
continue;
|
||||
}
|
||||
name = Some(string_stack[0].clone());
|
||||
} else if func_name == "AddSelect" {
|
||||
if string_stack.is_empty() {
|
||||
@@ -367,6 +378,7 @@ impl ECSExecutionImage {
|
||||
message.clear();
|
||||
}
|
||||
pre_is_mess = is_mess;
|
||||
string_stack.clear();
|
||||
} else if is_enter {
|
||||
disasm.stream.pos = cmd.addr as usize + 1;
|
||||
let name = WideString::unpack(&mut disasm.stream, false, Encoding::Utf16LE)?.0;
|
||||
|
||||
@@ -67,7 +67,7 @@ impl CSXScript {
|
||||
let img = ECSExecutionImage::new(reader)?;
|
||||
Ok(Self {
|
||||
img,
|
||||
disasm: config.entis_gls_csx_diasm,
|
||||
disasm: config.entis_gls_csx_disasm,
|
||||
custom_yaml: config.custom_yaml,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -566,7 +566,7 @@ pub struct ExtraConfig {
|
||||
pub zopfli_maximum_block_splits: u16,
|
||||
#[cfg(feature = "entis-gls")]
|
||||
/// Whether to disassemble Entis GLS csx script when exporting in custom mode.
|
||||
pub entis_gls_csx_diasm: bool,
|
||||
pub entis_gls_csx_disasm: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, ValueEnum, PartialEq, Eq, PartialOrd, Ord)]
|
||||
|
||||
Reference in New Issue
Block a user