Skip to content

Commit

Permalink
chore(player): 找不到人物时抛出明确错误
Browse files Browse the repository at this point in the history
  • Loading branch information
mark9804 committed Apr 12, 2024
1 parent da528bb commit f9f345e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/ba-story-player/lib/layers/translationLayer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const StoryRawUnitParserUnit: IStoryRawUnitParserUnit = {
return unit;
},
},
fontsize: {
fontsize: {
reg: /#fontsize;(\d+);?/i,
fn(match: RegExpExecArray, unit: StoryUnit) {
unit.textAbout.showText.text.forEach(it => {
Expand Down Expand Up @@ -243,7 +243,9 @@ const StoryRawUnitParserUnit: IStoryRawUnitParserUnit = {
} else {
console.log(rawUnit);
console.log(currentIndex);
throw new Error(`${CharacterName}在CharacterNameExcelTable中不存在`);
throw new Error(
`${CharacterName}(${match[2]})在CharacterNameExcelTable中不存在,index: ${currentIndex}`
);
}
return unit;
},
Expand Down Expand Up @@ -328,7 +330,7 @@ const StoryRawUnitParserUnit: IStoryRawUnitParserUnit = {
getText(rawUnit, usePlayerStore().language)
)
.split("\n")
.filter((it) => it)
.filter(it => it)
.map(it => {
const parseResult = /\[n?s(\d{0,2})?](.+)/.exec(it);
if (!parseResult) {
Expand Down

0 comments on commit f9f345e

Please sign in to comment.