This commit is contained in:
kuangshen04 2024-05-21 14:15:23 +08:00
parent d895fb4cc0
commit 1e779a13d6
1 changed files with 5 additions and 5 deletions

View File

@ -18,8 +18,8 @@ export class Audio {
#Cache = {}; #Cache = {};
/** /**
* 根据skill中的audio,audioname,audioname2和player来获取技能台词列表及其对应的源文件名 * 根据skill中的audio,audioname,audioname2和player来获取技能台词列表及其对应的源文件名
* @typedef {{audio: audioInfo, audioname?: string[], audioname2?: {[playerName: string]: audioInfo}}} skillInfo * @typedef {{audio: audioInfo, audioname?: string[], audioname2?: {[playerName: string]: audioInfo}}} skillInfo
* @param { object } options * @param { object } options
* @param { string } options.skill 技能名 * @param { string } options.skill 技能名
* @param { Player | string } [options.player] 角色/角色名 * @param { Player | string } [options.player] 角色/角色名
@ -30,7 +30,7 @@ export class Audio {
if (skill === void 0) { if (skill === void 0) {
console.error(new ReferenceError(`skill is not defined`)); console.error(new ReferenceError(`skill is not defined`));
return []; return [];
} }
//@ts-ignore //@ts-ignore
if (typeof player === "string") player = get.convertedCharacter({ name: player }); if (typeof player === "string") player = get.convertedCharacter({ name: player });
//@ts-ignore //@ts-ignore
@ -74,7 +74,7 @@ export class Audio {
} }
/** /**
* 获取角色死亡时能播放的所有阵亡台词列表及其对应的源文件名 * 获取角色死亡时能播放的所有阵亡台词列表及其对应的源文件名
* @param { object } options * @param { object } options
* @param { Player | string } options.player 角色/角色名 * @param { Player | string } options.player 角色/角色名
* @param { audioInfo } [options.info] 使用指定的audioInfo * @param { audioInfo } [options.info] 使用指定的audioInfo
@ -216,7 +216,7 @@ export class Audio {
const getResult = () => { const getResult = () => {
const result = getAudioList(name, data, info); const result = getAudioList(name, data, info);
if (!result.every(i => i.isDefault)) return result; if (!result.every(i => i.isDefault && !i.text)) return result;
if (name.includes("_")) { if (name.includes("_")) {
name = name.slice(name.indexOf("_") + 1); name = name.slice(name.indexOf("_") + 1);
info = void 0; info = void 0;