Conversation
Add restore info screen for singleplayer
There was a problem hiding this comment.
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
RestoreInfoScreento show backup ID and comment upon completion. - Call
RestoreInfoScreen.openinCommands.ktwhen restore finishes without a force stop. - Add corresponding translation keys in
zh_cn.jsonanden_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
RestoreInfoScreento 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) { |
There was a problem hiding this comment.
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.
| } else if (!forceStop) { | |
| } else if (!forceStop) { | |
| it.finishRestore() |
Add progress bar and reopen button for restore GUI
Add 1.20.1 gui compatibility
fix: #8