Skip to content

Commit

Permalink
Merge pull request #575 from OpenWebGAL/MakinoharaShoko/fix-say-script
Browse files Browse the repository at this point in the history
Fix say script to replace spaces with \u00a0
  • Loading branch information
MakinoharaShoko authored Nov 2, 2024
2 parents d304fdb + 159d3c5 commit 825d420
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/webgal/src/Core/gameScripts/say.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export const say = (sentence: ISentence): IPerform => {
const dispatch = webgalStore.dispatch;
let dialogKey = Math.random().toString(); // 生成一个随机的key
let dialogToShow = sentence.content; // 获取对话内容
if (dialogToShow) {
dialogToShow = String(dialogToShow).replace(/ /g, '\u00a0'); // 替换空格
}
const isConcat = getSentenceArgByKey(sentence, 'concat'); // 是否是继承语句
const isNotend = getSentenceArgByKey(sentence, 'notend') as boolean; // 是否有 notend 参数
const speaker = getSentenceArgByKey(sentence, 'speaker'); // 获取说话者
Expand Down

0 comments on commit 825d420

Please sign in to comment.