feat: change logic of die text parse.
This commit is contained in:
parent
215ead7e7b
commit
37c21700a3
|
@ -1599,14 +1599,16 @@ export class Game {
|
|||
}
|
||||
if (dieAudios && dieAudios.length > 0) {
|
||||
dieAudios.forEach(item => {
|
||||
let key, file;
|
||||
if (item.startsWith("ext:")) {
|
||||
key = item.slice(4).split("/")[1];
|
||||
file = item;
|
||||
} else {
|
||||
key = item;
|
||||
file = `die/${item}.mp3`;
|
||||
}
|
||||
let file = lib.init.parseResourceAddress(item, path => (lib.path.extname(path) ? `audio/die/${path}.mp3` : `audio/die/${path}`)).href;
|
||||
let key = file.startsWith("db:") ? file.slice(3) : file.startsWith("data:") ? file : lib.path.basename(file);
|
||||
|
||||
// if (item.startsWith("ext:")) {
|
||||
// key = item.slice(4).split("/")[1];
|
||||
// file = item;
|
||||
// } else {
|
||||
// key = item;
|
||||
// file = `die/${item}.mp3`;
|
||||
// }
|
||||
const data = { key, file };
|
||||
if (lib.translate[`#${key}:die`]) data.text = lib.translate[`#${key}:die`];
|
||||
datas.push(data);
|
||||
|
|
Loading…
Reference in New Issue