Skip to content

Commit

Permalink
fix: global dialog effect problem
Browse files Browse the repository at this point in the history
  • Loading branch information
MakinoharaShoko committed Oct 10, 2023
1 parent a55c830 commit e86163e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
import { useSelector } from 'react-redux';
import { RootState, webgalStore } from '@/store/store';
import { setVisibility } from '@/store/GUIReducer';
import useSoundEffect from '@/hooks/useSoundEffect';
import { useSEByWebgalStore } from '@/hooks/useSoundEffect';

export default function GlobalDialog() {
const isGlobalDialogShow = useSelector((state: RootState) => state.GUI.showGlobalDialog);
Expand All @@ -19,7 +19,7 @@ interface IShowGlobalDialogProps {
}

export function showGlogalDialog(props: IShowGlobalDialogProps) {
const { playSeClickDialogButton, playSeEnterDialogButton } = useSoundEffect();
const { playSeClickDialogButton, playSeEnterDialogButton } = useSEByWebgalStore();
webgalStore.dispatch(setVisibility({ component: 'showGlobalDialog', visibility: true }));
const handleLeft = () => {
playSeClickDialogButton();
Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/src/config/info.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const __INFO = {
version: 'WebGAL 4.4.5',
version: 'WebGAL 4.4.5.3',
contributors: [
{ username: 'Mahiru', link: 'https://github.com/MakinoharaShoko' },
{ username: 'Hoshinokinya', link: 'https://github.com/hshqwq' },
Expand Down
16 changes: 8 additions & 8 deletions packages/webgal/src/hooks/useSoundEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ const useSoundEffect = () => {
const playSeEnterCloseButton = () => {
dispatch(setStage({ key: 'uiSe', value: aigei_se_03 }));
};
const playSeEnterDialogButton = () => {
dispatch(setStage({ key: 'uiSe', value: Motion_Pop03_4 }));
};
const playSeEnterOptionSlider = () => {
dispatch(setStage({ key: 'uiSe', value: water_drop_sound }));
};
Expand Down Expand Up @@ -97,9 +94,6 @@ const useSoundEffect = () => {
const playSeClickLoadElement = () => {
dispatch(setStage({ key: 'uiSe', value: maou_se_system48 }));
};
const playSeClickDialogButton = () => {
dispatch(setStage({ key: 'uiSe', value: maou_se_system35 }));
};
const playSeClickToNextBgmButton = () => {
dispatch(setStage({ key: 'uiSe', value: switch_1 }));
};
Expand Down Expand Up @@ -133,7 +127,6 @@ const useSoundEffect = () => {
playSeEnterExtraElement, // 鼠标进入鉴赏元素
playSeEnterExtraBGMButton, // 鼠标进入鉴赏页BGM按钮
playSeEnterCloseButton, // 鼠标进入关闭按钮
playSeEnterDialogButton, // 鼠标进入提示框按钮
playSeEnterOptionSlider, // 鼠标进入滑块选项
playSeClick, // 鼠标点击
playSeClickTitleButton, // 鼠标点击标题按钮
Expand All @@ -145,7 +138,6 @@ const useSoundEffect = () => {
playSeClickSavePanelSelect, // 鼠标点击存档页切换按钮
playSeClickSaveElement, // 鼠标点击存档元素
playSeClickLoadElement, // 鼠标点击读档元素
playSeClickDialogButton, // 鼠标点击提示框按钮
playSeClickToNextBgmButton, // 鼠标点击下一首BGM按钮
playSeClickToLastBgmButton, // 鼠标点击上一首BGM按钮
playSeClickBeginBgmButton, // 鼠标点击开始播放BGM按钮
Expand All @@ -166,9 +158,17 @@ export const useSEByWebgalStore = () => {
const playSeClickChoose = () => {
webgalStore.dispatch(setStage({ key: 'uiSe', value: maou_se_system41 }));
};
const playSeEnterDialogButton = () => {
webgalStore.dispatch(setStage({ key: 'uiSe', value: Motion_Pop03_4 }));
};
const playSeClickDialogButton = () => {
webgalStore.dispatch(setStage({ key: 'uiSe', value: maou_se_system35 }));
};
return {
playSeEnterChoose, // 鼠标进入分支选择
playSeClickChoose, // 鼠标点击分支选择
playSeClickDialogButton, // 鼠标点击提示框按钮
playSeEnterDialogButton, // 鼠标进入提示框按钮
};
};

Expand Down

0 comments on commit e86163e

Please sign in to comment.