Feat/continue game#961
Open
ChangeSuger wants to merge 3 commits into
Open
Conversation
- 增加配置项,用于控制“继续游戏”按钮是否显示 - 调整继续游戏的逻辑,现在会加载最新的存档 - 当“继续游戏”按钮显示,且没有最新的存档,按钮置灰
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements a 'Continue' feature and 'Fast Save' recovery logic, including timestamp-based save sorting and a prompt to restore temporary progress upon returning to the title screen. Feedback focuses on missing state updates to hide the title UI after loading a save, as well as off-by-one errors when fetching save data using the new MAX_SAVE_SIZE constant.
Comment on lines
+108
to
+112
| onClick={() => { | ||
| if (!latestSave) return; | ||
| playSeClick(); | ||
| loadGameFromStageData(latestSave); | ||
| }} |
Contributor
There was a problem hiding this comment.
“继续游戏”按钮逻辑中缺少了隐藏标题界面的 dispatch 调用。这会导致在加载存档数据后,标题界面仍然显示在最上层,用户无法看到游戏画面。建议添加 dispatch(setVisibility({ component: 'showTitle', visibility: false }));。
Suggested change
| onClick={() => { | |
| if (!latestSave) return; | |
| playSeClick(); | |
| loadGameFromStageData(latestSave); | |
| }} | |
| onClick={() => { | |
| if (!latestSave) return; | |
| playSeClick(); | |
| dispatch(setVisibility({ component: 'showTitle', visibility: false })); | |
| loadGameFromStageData(latestSave); | |
| }} |
Comment on lines
+57
to
+60
| leftFunc: () => { | ||
| loadFastSaveGame(); | ||
| setFastSaveLoaded(true); | ||
| }, |
Contributor
| await getStorageAsync(); | ||
| getFastSaveFromStorage(); | ||
| getSavesFromStorage(0, 0); | ||
| getSavesFromStorage(0, MAX_SAVE_SIZE); |
Contributor
| getStorage(); | ||
| getFastSaveFromStorage(); | ||
| getSavesFromStorage(0, 0); | ||
| getSavesFromStorage(0, MAX_SAVE_SIZE); |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本提交旨在优化目前“继续游戏”功能与紧急回避存档的存储与读取逻辑,包含一下变更:
saveTimestamp字段,用于更稳定地对存档进行排序(兼容旧存档的saveTime字段)。