-
Notifications
You must be signed in to change notification settings - Fork 777
feat: 资源包管理 #4475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: 资源包管理 #4475
Conversation
或许可以支持简介文本颜色显示? |
请先处理 checkTranslations 的报错。 |
Co-authored-by: 3gf8jv4dv <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
简单看了一下,现在的实现问题还很多,请自行清理一下。
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java
Outdated
Show resolved
Hide resolved
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java
Outdated
Show resolved
Hide resolved
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java
Outdated
Show resolved
Hide resolved
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java
Outdated
Show resolved
Hide resolved
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java
Outdated
Show resolved
Hide resolved
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java
Outdated
Show resolved
Hide resolved
HMCLCore/src/main/java/org/jackhuang/hmcl/resourcepack/ResourcepackFile.java
Outdated
Show resolved
Hide resolved
HMCLCore/src/main/java/org/jackhuang/hmcl/resourcepack/ResourcepackFile.java
Outdated
Show resolved
Hide resolved
HMCLCore/src/main/java/org/jackhuang/hmcl/resourcepack/ResourcepackZipFile.java
Outdated
Show resolved
Hide resolved
HMCLCore/src/main/java/org/jackhuang/hmcl/resourcepack/ResourcepackZipFile.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 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.
|
||
public class ResourcepackItem extends Control { | ||
private final ResourcepackFile file; | ||
// final JFXCheckBox checkBox = new JFXCheckBox(); |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code. If the checkbox functionality is planned for future implementation, consider adding a TODO comment explaining the intended purpose.
// final JFXCheckBox checkBox = new JFXCheckBox(); | |
// TODO: Add a JFXCheckBox here to allow selecting multiple resource packs for batch operations in the future. |
Copilot uses AI. Check for mistakes.
// left.getChildren().addAll(item.checkBox, createIcon(item.getFile().getIcon())); | ||
left.setPadding(new Insets(0, 8, 0, 0)); | ||
// FXUtils.setLimitWidth(left, 64); |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code blocks. These appear to be related to unused checkbox functionality and should be cleaned up.
Copilot uses AI. Check for mistakes.
root.setLeft(left); | ||
|
||
TwoLineListItem center = new TwoLineListItem(); | ||
// center.setPadding(new Insets(0, 0, 0, 8)); |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)); |
Copilot uses AI. Check for mistakes.
try (Stream<Path> stream = Files.list(resourcepackDirectory)) { | ||
stream.forEach(path -> { | ||
try { | ||
itemsProperty().add(new ResourcepackItem(ResourcepackFile.parse(path))); |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)); | |
} |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我改了一点,但发现问题还是很多,剩下的你自己再仔细看看改改吧。
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java
Outdated
Show resolved
Hide resolved
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java
Show resolved
Hide resolved
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java
Outdated
Show resolved
Hide resolved
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java
Show resolved
Hide resolved
HMCLCore/src/main/java/org/jackhuang/hmcl/resourcepack/ResourcepackMeta.java
Outdated
Show resolved
Hide resolved
HMCLCore/src/main/java/org/jackhuang/hmcl/resourcepack/ResourcepackZipFile.java
Outdated
Show resolved
Hide resolved
HMCLCore/src/main/java/org/jackhuang/hmcl/resourcepack/ResourcepackZipFile.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我正在考虑是否要在模组/世界/原理图/资源包管理中简化这些文本的描述。
This reverts commit e5ed6d0
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
# Conflicts: # HMCLCore/src/main/java/org/jackhuang/hmcl/resourcepack/ResourcepackZipFile.java
TODO: