Skip to content

Commit

Permalink
Merge pull request OpenWebGAL#171 from MakinoharaShoko/4.X-dev
Browse files Browse the repository at this point in the history
尝试解决设置页面动画导致界面模糊的问题;解决继续游戏如果游戏未开始时黑屏的问题
  • Loading branch information
MakinoharaShoko authored Apr 21, 2022
2 parents 84c9e77 + 0a8fc81 commit 07588be
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.textPreviewMain{
position: relative;
z-index: 1;
padding: 1em 1.5em 1em 1.5em;
background: rgba(0,0,0,0.35);
color: rgb(255,255,255);
Expand Down
13 changes: 11 additions & 2 deletions src/Components/UI/Title/Title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {useStore} from 'reto';
import {GuiStateStore, MenuPanelTag} from '../../../Core/store/GUI';
import {playBgm} from '../../../Core/util/playBgm';
import {startGame} from '../../../Core/controller/gamePlay/startGame';
import {runtime_currentSceneData} from "@/Core/runtime/sceneData";
import {eventSender} from "@/Core/controller/eventBus/eventSender";

/**
* 标题页
Expand All @@ -15,7 +17,7 @@ const Title: FC = () => {
const showBackground = background === '' ? 'rgba(0,0,0,1)' : `url("${background}")`;
return (
<>
{GuiStore.GuiState.showTitle &&<div className={styles.Title_backup_background}/>}
{GuiStore.GuiState.showTitle && <div className={styles.Title_backup_background}/>}
<div
id="play_title_bgm_target"
onClick={() => {
Expand All @@ -35,7 +37,14 @@ const Title: FC = () => {
<div className={styles.Title_button_text + ' ' + styles.Title_button_text_up}>开始游戏</div>
<div className={styles.Title_button_text}>START</div>
</div>
<div className={styles.Title_button} onClick={() => GuiStore.setVisibility('showTitle', false)}>
<div className={styles.Title_button} onClick={() => {
GuiStore.setVisibility('showTitle', false);
if (runtime_currentSceneData.currentSentenceId === 0 &&
runtime_currentSceneData.currentScene.sceneName === 'start.txt') {
// 如果游戏没有开始,开始游戏
eventSender('nextSentence_target', 0, 0);
}
}}>
<div className={styles.Title_button_text + ' ' + styles.Title_button_text_up}>继续游戏</div>
<div className={styles.Title_button_text}>CONTINUE</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/Core/controller/eventBus/eventSender.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/**
* 事件创建器,用于将事件发送到指定的元素
* targetID = nextSentence_target 继续下一句
* targetID = restorePerform_target 还原演出
* targetID = setVolume_target 强制同步音量与本地存储
* @param targetID 元素ID
* @param message 发送的信息(目前只能为数字)
* @param timeout 等待时间
Expand All @@ -18,4 +21,4 @@ export const eventSender = (targetID: string, message: number, timeout: number):
target.dispatchEvent(event);
}
}, timeout);
};
};

0 comments on commit 07588be

Please sign in to comment.