mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-07-08 01:31:53 +08:00
Compare commits
2 Commits
900678f89a
...
65b22ccddf
| Author | SHA1 | Date | |
|---|---|---|---|
| 65b22ccddf | |||
| 7fc13b1619 |
@@ -443,7 +443,7 @@ impl Script for ScnScript {
|
|||||||
return Err(anyhow::anyhow!("name is not a string or null"));
|
return Err(anyhow::anyhow!("name is not a string or null"));
|
||||||
}
|
}
|
||||||
let has_name = text[0].is_string();
|
let has_name = text[0].is_string();
|
||||||
let mut has_display_name;
|
let has_display_name;
|
||||||
if text[1].is_list() {
|
if text[1].is_list() {
|
||||||
while text[1].len() <= self.language_index {
|
while text[1].len() <= self.language_index {
|
||||||
text[1][self.language_index] = text[1][0].clone();
|
text[1][self.language_index] = text[1][0].clone();
|
||||||
@@ -456,7 +456,6 @@ impl Script for ScnScript {
|
|||||||
"display name is not a string or null"
|
"display name is not a string or null"
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
has_display_name = text[1][self.language_index][0].is_string();
|
|
||||||
if text[1][self.language_index][1].is_string() {
|
if text[1][self.language_index][1].is_string() {
|
||||||
let m = match cur_mes.take() {
|
let m = match cur_mes.take() {
|
||||||
Some(m) => m,
|
Some(m) => m,
|
||||||
@@ -474,11 +473,7 @@ impl Script for ScnScript {
|
|||||||
name = name.replace(key, value);
|
name = name.replace(key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if has_display_name || self.language_index != 0 {
|
text[1][self.language_index][0].set_string(name);
|
||||||
text[1][self.language_index][0].set_string(name);
|
|
||||||
} else {
|
|
||||||
text[0].set_string(name);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return Err(anyhow::anyhow!(
|
return Err(anyhow::anyhow!(
|
||||||
"Name is missing for message. (text {j} at scene {i})"
|
"Name is missing for message. (text {j} at scene {i})"
|
||||||
@@ -561,7 +556,6 @@ impl Script for ScnScript {
|
|||||||
"display name is not a string or null"
|
"display name is not a string or null"
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
has_display_name = text[2][self.language_index][0].is_string();
|
|
||||||
if text[2][self.language_index][1].is_string() {
|
if text[2][self.language_index][1].is_string() {
|
||||||
let m = match cur_mes.take() {
|
let m = match cur_mes.take() {
|
||||||
Some(m) => m,
|
Some(m) => m,
|
||||||
@@ -579,16 +573,7 @@ impl Script for ScnScript {
|
|||||||
name = name.replace(key, value);
|
name = name.replace(key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if has_display_name || self.language_index != 0 {
|
text[2][self.language_index][0].set_string(name);
|
||||||
text[2][self.language_index][0]
|
|
||||||
.set_string(name);
|
|
||||||
} else {
|
|
||||||
if text[1].is_string() {
|
|
||||||
text[1].set_string(name);
|
|
||||||
} else {
|
|
||||||
text[0].set_string(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return Err(anyhow::anyhow!(
|
return Err(anyhow::anyhow!(
|
||||||
"Name is missing for message.(text {j} at scene {i})"
|
"Name is missing for message.(text {j} at scene {i})"
|
||||||
|
|||||||
Reference in New Issue
Block a user