From 3769ade346c7e78012590c15712c420e1cc5250b Mon Sep 17 00:00:00 2001 From: RobertXu <372720441@qq.com> Date: Sun, 26 Nov 2023 16:41:50 +0800 Subject: [PATCH 01/26] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E4=B8=AD=E6=96=AD=E8=AF=AD=E9=9F=B3=E7=9A=84=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webgal/public/game/scene/demo_zh_cn.txt | 3 +++ .../Components/UI/Menu/Options/Sound/Sound.tsx | 18 ++++++++++++++++++ packages/webgal/src/Core/gameScripts/say.ts | 8 +++++--- packages/webgal/src/store/userDataInterface.ts | 6 ++++++ packages/webgal/src/store/userDataReducer.ts | 2 ++ packages/webgal/src/translations/zh-cn.ts | 3 +++ 6 files changed, 37 insertions(+), 3 deletions(-) diff --git a/packages/webgal/public/game/scene/demo_zh_cn.txt b/packages/webgal/public/game/scene/demo_zh_cn.txt index a19396eb6..50932c473 100644 --- a/packages/webgal/public/game/scene/demo_zh_cn.txt +++ b/packages/webgal/public/game/scene/demo_zh_cn.txt @@ -10,6 +10,9 @@ miniAvatar:miniavatar.png; changeFigure:stand2.png -right -next; {egine} 是使用 Web 技术开发的引擎,因此在网页端有良好的表现。 -v2.wav; 由于这个特性,如果你将 {egine} 部署到服务器或网页托管平台上,玩家只需要一串链接就可以开始游玩! -v3.wav; +hhhhhh; +test; +lalalla; setAnimation:move-front-and-back -target=fig-left -next; 听起来是不是非常吸引人? -v4.wav; changeFigure:none -right -next; diff --git a/packages/webgal/src/Components/UI/Menu/Options/Sound/Sound.tsx b/packages/webgal/src/Components/UI/Menu/Options/Sound/Sound.tsx index 6823010e6..b13565f65 100644 --- a/packages/webgal/src/Components/UI/Menu/Options/Sound/Sound.tsx +++ b/packages/webgal/src/Components/UI/Menu/Options/Sound/Sound.tsx @@ -1,11 +1,13 @@ import styles from '@/Components/UI/Menu/Options/options.module.scss'; import { NormalOption } from '@/Components/UI/Menu/Options/NormalOption'; +import { NormalButton } from '@/Components/UI/Menu/Options/NormalButton'; import { OptionSlider } from '@/Components/UI/Menu/Options/OptionSlider'; import { setOptionData } from '@/store/userDataReducer'; import { setStorage } from '@/Core/controller/storage/storageController'; import { useDispatch, useSelector } from 'react-redux'; import { RootState } from '@/store/store'; import useTrans from '@/hooks/useTrans'; +import { voiceOption } from '@/store/userDataInterface'; export function Sound() { const userDataState = useSelector((state: RootState) => state.userData); @@ -69,6 +71,22 @@ export function Sound() { }} /> + + { + dispatch(setOptionData({ key: 'voiceInterruption', value: voiceOption.yes })); + setStorage(); + }, + () => { + dispatch(setOptionData({ key: 'voiceInterruption', value: voiceOption.no })); + setStorage(); + } + ]} + currentChecked={userDataState.optionData.voiceInterruption} + /> + ); } diff --git a/packages/webgal/src/Core/gameScripts/say.ts b/packages/webgal/src/Core/gameScripts/say.ts index eb2171ac3..4a61789c2 100644 --- a/packages/webgal/src/Core/gameScripts/say.ts +++ b/packages/webgal/src/Core/gameScripts/say.ts @@ -6,7 +6,7 @@ import { setStage } from '@/store/stageReducer'; import { useTextDelay } from '@/hooks/useTextOptions'; import { getRandomPerformName, PerformController } from '@/Core/Modules/perform/performController'; import { getSentenceArgByKey } from '@/Core/util/getSentenceArg'; -import { textSize } from '@/store/userDataInterface'; +import { textSize, voiceOption } from '@/store/userDataInterface'; import { WebGAL } from '@/Core/WebGAL'; /** @@ -38,8 +38,10 @@ export const say = (sentence: ISentence): IPerform => { // 设置文本显示 dispatch(setStage({ key: 'showText', value: dialogToShow })); // 清除语音 - dispatch(setStage({ key: 'vocal', value: '' })); - WebGAL.gameplay.performController.unmountPerform('vocal-play', true); + if(!(userDataState.optionData.voiceInterruption===voiceOption.no&&vocal===null)){//只有开关设置为不中断,并且没有语音的时候,才需要不中断 + dispatch(setStage({ key: 'vocal', value: '' })); + WebGAL.gameplay.performController.unmountPerform('vocal-play', true); + } // 设置key dispatch(setStage({ key: 'currentDialogKey', value: dialogKey })); // 计算延迟 diff --git a/packages/webgal/src/store/userDataInterface.ts b/packages/webgal/src/store/userDataInterface.ts index 02085d3f2..e7412a19b 100644 --- a/packages/webgal/src/store/userDataInterface.ts +++ b/packages/webgal/src/store/userDataInterface.ts @@ -24,6 +24,11 @@ export enum textFont { lxgw, } +export enum voiceOption{ + yes, + no, +} + /** * @interface IOptionData 用户设置数据接口 */ @@ -39,6 +44,7 @@ export interface IOptionData { slPage: number; // 存读档界面所在页面 textboxFont: textFont; language: language; + voiceInterruption:voiceOption; } /** diff --git a/packages/webgal/src/store/userDataReducer.ts b/packages/webgal/src/store/userDataReducer.ts index 524956cfd..5fb2e11b9 100644 --- a/packages/webgal/src/store/userDataReducer.ts +++ b/packages/webgal/src/store/userDataReducer.ts @@ -13,6 +13,7 @@ import { playSpeed, textFont, textSize, + voiceOption, } from '@/store/userDataInterface'; import { createSlice, PayloadAction } from '@reduxjs/toolkit'; import cloneDeep from 'lodash/cloneDeep'; @@ -29,6 +30,7 @@ const initialOptionSet = { uiSeVolume: 50, // UI音效音量 textboxFont: textFont.song, language: language.zhCn, + voiceInterruption:voiceOption.yes, }; // 初始化用户数据 diff --git a/packages/webgal/src/translations/zh-cn.ts b/packages/webgal/src/translations/zh-cn.ts index bc4176fd7..ec8902993 100644 --- a/packages/webgal/src/translations/zh-cn.ts +++ b/packages/webgal/src/translations/zh-cn.ts @@ -101,6 +101,9 @@ const zhCn = { bgmVolume: { title: '背景音乐音量' }, seVolume: { title: '音效音量' }, uiSeVolume: { title: '用户界面音效音量' }, + voiceOption:{title:'是否中断语音'}, + voiceStop:{title:'停止语音'}, + voiceContinue:{title:'继续语音'}, }, }, // language: { From 555a882929ab27143bc38f2fee3c381947287d69 Mon Sep 17 00:00:00 2001 From: RobertXu <372720441@qq.com> Date: Sun, 26 Nov 2023 16:53:06 +0800 Subject: [PATCH 02/26] =?UTF-8?q?=E8=BF=98=E5=8E=9Fdemo=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/webgal/public/game/scene/demo_zh_cn.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/webgal/public/game/scene/demo_zh_cn.txt b/packages/webgal/public/game/scene/demo_zh_cn.txt index 50932c473..a19396eb6 100644 --- a/packages/webgal/public/game/scene/demo_zh_cn.txt +++ b/packages/webgal/public/game/scene/demo_zh_cn.txt @@ -10,9 +10,6 @@ miniAvatar:miniavatar.png; changeFigure:stand2.png -right -next; {egine} 是使用 Web 技术开发的引擎,因此在网页端有良好的表现。 -v2.wav; 由于这个特性,如果你将 {egine} 部署到服务器或网页托管平台上,玩家只需要一串链接就可以开始游玩! -v3.wav; -hhhhhh; -test; -lalalla; setAnimation:move-front-and-back -target=fig-left -next; 听起来是不是非常吸引人? -v4.wav; changeFigure:none -right -next; From 3af4726123282ca45e51036adf1d623a8d5526e8 Mon Sep 17 00:00:00 2001 From: caleb891004 <152059091+caleb891004@users.noreply.github.com> Date: Sun, 26 Nov 2023 16:53:23 +0800 Subject: [PATCH 03/26] Update zh-tw.ts --- packages/webgal/src/translations/zh-tw.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/webgal/src/translations/zh-tw.ts b/packages/webgal/src/translations/zh-tw.ts index 049249ab2..afc5c55c8 100644 --- a/packages/webgal/src/translations/zh-tw.ts +++ b/packages/webgal/src/translations/zh-tw.ts @@ -166,6 +166,7 @@ const zhTw = { load: '讀檔', options: '選項', title: '標題', + titleTips: '確認返回到標題界面嗎', }, }, From 07d5784aa5629221c6898b21263c324c5d09a9fd Mon Sep 17 00:00:00 2001 From: RobertXu <372720441@qq.com> Date: Sun, 26 Nov 2023 17:08:18 +0800 Subject: [PATCH 04/26] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/webgal/src/UI/Menu/Options/Sound/Sound.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/webgal/src/UI/Menu/Options/Sound/Sound.tsx b/packages/webgal/src/UI/Menu/Options/Sound/Sound.tsx index 1a29f70e7..e9f766bb0 100644 --- a/packages/webgal/src/UI/Menu/Options/Sound/Sound.tsx +++ b/packages/webgal/src/UI/Menu/Options/Sound/Sound.tsx @@ -1,13 +1,8 @@ -<<<<<<< HEAD:packages/webgal/src/Components/UI/Menu/Options/Sound/Sound.tsx -import styles from '@/Components/UI/Menu/Options/options.module.scss'; -import { NormalOption } from '@/Components/UI/Menu/Options/NormalOption'; -import { NormalButton } from '@/Components/UI/Menu/Options/NormalButton'; -import { OptionSlider } from '@/Components/UI/Menu/Options/OptionSlider'; -======= + import styles from '@/UI/Menu/Options/options.module.scss'; import { NormalOption } from '@/UI/Menu/Options/NormalOption'; import { OptionSlider } from '@/UI/Menu/Options/OptionSlider'; ->>>>>>> 98fcca68925349189ee1344a6855b8c4c3c2d3d8:packages/webgal/src/UI/Menu/Options/Sound/Sound.tsx +import { NormalButton } from '@/UI/Menu/Options//NormalButton'; import { setOptionData } from '@/store/userDataReducer'; import { setStorage } from '@/Core/controller/storage/storageController'; import { useDispatch, useSelector } from 'react-redux'; From 633015277c44703bc9b95a801155240fa32ebea6 Mon Sep 17 00:00:00 2001 From: RobertXu <372720441@qq.com> Date: Sun, 26 Nov 2023 19:51:40 +0800 Subject: [PATCH 05/26] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=AA=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=AD=98=E5=82=A8=E7=9C=9F=E6=AD=A3=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=A3=B0=E9=9F=B3=EF=BC=8C=E5=AE=9E=E7=8E=B0=E2=80=9C=E4=B8=8D?= =?UTF-8?q?=E4=B8=AD=E6=96=AD=E2=80=9D=E8=AF=AD=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/webgal/src/Core/gameScripts/say.ts | 6 +++++- packages/webgal/src/Stage/AudioContainer/AudioContainer.tsx | 2 +- packages/webgal/src/store/stageInterface.ts | 1 + packages/webgal/src/store/stageReducer.ts | 1 + packages/webgal/src/store/userDataInterface.ts | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/webgal/src/Core/gameScripts/say.ts b/packages/webgal/src/Core/gameScripts/say.ts index f0126a206..03c7945ad 100644 --- a/packages/webgal/src/Core/gameScripts/say.ts +++ b/packages/webgal/src/Core/gameScripts/say.ts @@ -8,6 +8,7 @@ import { getRandomPerformName, PerformController } from '@/Core/Modules/perform/ import { getSentenceArgByKey } from '@/Core/util/getSentenceArg'; import { textSize, voiceOption } from '@/store/userDataInterface'; import { WebGAL } from '@/Core/WebGAL'; +import { logger } from 'pixi-live2d-display'; /** * 进行普通对话的显示 @@ -37,9 +38,11 @@ export const say = (sentence: ISentence): IPerform => { // 设置文本显示 dispatch(setStage({ key: 'showText', value: dialogToShow })); + dispatch(setStage({ key: 'vocal', value: '' })); + // 清除语音 if(!(userDataState.optionData.voiceInterruption===voiceOption.no&&vocal===null)){//只有开关设置为不中断,并且没有语音的时候,才需要不中断 - dispatch(setStage({ key: 'vocal', value: '' })); + dispatch(setStage({ key: 'playVocal', value: '' })); WebGAL.gameplay.performController.unmountPerform('vocal-play', true); } // 设置key @@ -78,6 +81,7 @@ export const say = (sentence: ISentence): IPerform => { } dispatch(setStage({ key: 'showName', value: showName })); + console.log('debug'+vocal) // 播放一段语音 if (vocal) { playVocal(sentence); diff --git a/packages/webgal/src/Stage/AudioContainer/AudioContainer.tsx b/packages/webgal/src/Stage/AudioContainer/AudioContainer.tsx index fc187d697..81b20dafd 100644 --- a/packages/webgal/src/Stage/AudioContainer/AudioContainer.tsx +++ b/packages/webgal/src/Stage/AudioContainer/AudioContainer.tsx @@ -124,7 +124,7 @@ export const AudioContainer = () => { loop={true} autoPlay={isEnterGame} /> -