Skip to content

Commit 825d420

Browse files
Merge pull request #575 from OpenWebGAL/MakinoharaShoko/fix-say-script
Fix say script to replace spaces with \u00a0
2 parents d304fdb + 159d3c5 commit 825d420

File tree

1 file changed

+3
-0
lines changed
  • packages/webgal/src/Core/gameScripts

1 file changed

+3
-0
lines changed

packages/webgal/src/Core/gameScripts/say.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const say = (sentence: ISentence): IPerform => {
2323
const dispatch = webgalStore.dispatch;
2424
let dialogKey = Math.random().toString(); // 生成一个随机的key
2525
let dialogToShow = sentence.content; // 获取对话内容
26+
if (dialogToShow) {
27+
dialogToShow = String(dialogToShow).replace(/ /g, '\u00a0'); // 替换空格
28+
}
2629
const isConcat = getSentenceArgByKey(sentence, 'concat'); // 是否是继承语句
2730
const isNotend = getSentenceArgByKey(sentence, 'notend') as boolean; // 是否有 notend 参数
2831
const speaker = getSentenceArgByKey(sentence, 'speaker'); // 获取说话者

0 commit comments

Comments
 (0)