feat: 资源包管理 - #4475
Conversation
|
或许可以支持简介文本颜色显示? |
|
请先处理 checkTranslations 的报错。 |
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements resource pack management functionality for HMCL, allowing users to view, add, and delete resource packs in their game instances.
- Adds core resource pack file handling classes for both ZIP files and folder-based resource packs
- Integrates resource pack management into the version page UI with a new tab
- Provides localization strings for Chinese (Traditional/Simplified) and English
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ResourcepackZipFile.java | Implements ZIP-based resource pack file handling with metadata parsing |
| ResourcepackFolder.java | Implements folder-based resource pack file handling |
| ResourcepackFile.java | Defines common interface and factory method for resource pack files |
| DefaultGameRepository.java | Adds method to get resourcepacks directory path |
| I18N*.properties | Adds localized strings for resource pack management UI |
| VersionPage.java | Integrates resource pack tab into version page navigation |
| ResourcepackListPage.java | Main UI page for resource pack management with add/delete functionality |
| DownloadPage.java | Adds method to navigate to resource pack downloads |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // left.getChildren().addAll(item.checkBox, createIcon(item.getFile().getIcon())); | ||
| left.setPadding(new Insets(0, 8, 0, 0)); | ||
| // FXUtils.setLimitWidth(left, 64); |
There was a problem hiding this comment.
Remove commented-out code blocks. These appear to be related to unused checkbox functionality and should be cleaned up.
| root.setLeft(left); | ||
|
|
||
| TwoLineListItem center = new TwoLineListItem(); | ||
| // center.setPadding(new Insets(0, 0, 0, 8)); |
There was a problem hiding this comment.
Remove commented-out code. If this padding adjustment was intentional, either apply it or remove the comment entirely.
| // center.setPadding(new Insets(0, 0, 0, 8)); |
| try (Stream<Path> stream = Files.list(resourcepackDirectory)) { | ||
| stream.forEach(path -> { | ||
| try { | ||
| itemsProperty().add(new ResourcepackItem(ResourcepackFile.parse(path))); |
There was a problem hiding this comment.
ResourcepackFile.parse() can return null, but this code doesn't check for null before creating ResourcepackItem. Add a null check to prevent NullPointerException.
| itemsProperty().add(new ResourcepackItem(ResourcepackFile.parse(path))); | |
| ResourcepackFile resourcepackFile = ResourcepackFile.parse(path); | |
| if (resourcepackFile != null) { | |
| itemsProperty().add(new ResourcepackItem(resourcepackFile)); | |
| } |
Glavo
left a comment
There was a problem hiding this comment.
我改了一点,但发现问题还是很多,剩下的你自己再仔细看看改改吧。
TODO: