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) {
|
if (dieAudios && dieAudios.length > 0) {
|
||||||
dieAudios.forEach(item => {
|
dieAudios.forEach(item => {
|
||||||
let key, file;
|
let file = lib.init.parseResourceAddress(item, path => (lib.path.extname(path) ? `audio/die/${path}.mp3` : `audio/die/${path}`)).href;
|
||||||
if (item.startsWith("ext:")) {
|
let key = file.startsWith("db:") ? file.slice(3) : file.startsWith("data:") ? file : lib.path.basename(file);
|
||||||
key = item.slice(4).split("/")[1];
|
|
||||||
file = item;
|
// if (item.startsWith("ext:")) {
|
||||||
} else {
|
// key = item.slice(4).split("/")[1];
|
||||||
key = item;
|
// file = item;
|
||||||
file = `die/${item}.mp3`;
|
// } else {
|
||||||
}
|
// key = item;
|
||||||
|
// file = `die/${item}.mp3`;
|
||||||
|
// }
|
||||||
const data = { key, file };
|
const data = { key, file };
|
||||||
if (lib.translate[`#${key}:die`]) data.text = lib.translate[`#${key}:die`];
|
if (lib.translate[`#${key}:die`]) data.text = lib.translate[`#${key}:die`];
|
||||||
datas.push(data);
|
datas.push(data);
|
||||||
|
|
Loading…
Reference in New Issue