Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix say script to replace spaces with \u00a0 #575

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading