Skip to content

Add: 為單人回檔新增-gui-詳細信息#37

Merged
zly2006 merged 9 commits intozly2006:stonecutterfrom
whats2000:stonecutter
Jun 15, 2025
Merged

Add: 為單人回檔新增-gui-詳細信息#37
zly2006 merged 9 commits intozly2006:stonecutterfrom
whats2000:stonecutter

Conversation

@whats2000
Copy link
Contributor

@whats2000 whats2000 commented Jun 15, 2025

fix: #8

@zly2006 zly2006 requested a review from Copilot June 15, 2025 15:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new GUI screen to display detailed information after a single-player restore operation, integrates the screen into the restore command flow, and provides localization entries for both Chinese and English.

  • Introduce RestoreInfoScreen to show backup ID and comment upon completion.
  • Call RestoreInfoScreen.open in Commands.kt when restore finishes without a force stop.
  • Add corresponding translation keys in zh_cn.json and en_us.json.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/main/kotlin/com/github/zly2006/xbackup/gui/RestoreInfoScreen.kt New screen class showing restore details (ID, comment).
src/main/kotlin/com/github/zly2006/xbackup/Commands.kt Invoke the new GUI screen in the restore command flow.
common/src/main/resources/assets/x-backup/lang/zh_cn.json Add Chinese translations for the restore GUI.
common/src/main/resources/assets/x-backup/lang/en_us.json Add English translations for the restore GUI.
Comments suppressed due to low confidence (2)

src/main/kotlin/com/github/zly2006/xbackup/gui/RestoreInfoScreen.kt:29

  • [nitpick] This new UI rendering logic isn’t covered by existing tests. Consider adding a UI integration or snapshot test for RestoreInfoScreen to verify that translations are applied and elements are rendered correctly.
context.drawCenteredTextWithShadow(textRenderer, comment, width / 2, y, 0xFFFFFF)

common/src/main/resources/assets/x-backup/lang/en_us.json:55

  • [nitpick] The label "Back to Title" may be unclear—consider using "Back to Title Screen" or "Return to Title Screen" to more explicitly describe where the button navigates.
"xb.gui.restore.close": "Back to Title"

XBackup.isBusy = false
XBackup.restoring = false
it.finishRestore()
} else if (!forceStop) {
Copy link

Copilot AI Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the non-force-stop branch, it.finishRestore() is never called, so cleanup and notifications may not run. Consider moving or duplicating the it.finishRestore() call before opening the GUI to ensure the restore finalization always happens.

Suggested change
} else if (!forceStop) {
} else if (!forceStop) {
it.finishRestore()

Copilot uses AI. Check for mistakes.
@zly2006 zly2006 merged commit 45cec72 into zly2006:stonecutter Jun 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

打指令回档后会退出到服务器菜单

3 participants