Skip to content

Conversation

CiiLu
Copy link
Contributor

@CiiLu CiiLu commented Sep 13, 2025

TODO:

  • 支持启用禁用资源包
PixPin_2025-09-13_22-06-01

@zkitefly
Copy link
Member

zkitefly commented Sep 13, 2025

或许可以支持简介文本颜色显示?

@Glavo
Copy link
Member

Glavo commented Sep 18, 2025

请先处理 checkTranslations 的报错。

@CiiLu CiiLu marked this pull request as draft September 18, 2025 13:37
@CiiLu CiiLu marked this pull request as ready for review September 24, 2025 14:22
Copy link
Member

@Glavo Glavo left a comment

Choose a reason for hiding this comment

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

简单看了一下,现在的实现问题还很多,请自行清理一下。

@Glavo Glavo requested a review from Copilot September 25, 2025 13:49
Copy link
Contributor

@Copilot 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 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();
Copy link

Copilot AI Sep 25, 2025

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.

Suggested change
// 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.

Comment on lines +202 to +204
// left.getChildren().addAll(item.checkBox, createIcon(item.getFile().getIcon()));
left.setPadding(new Insets(0, 8, 0, 0));
// FXUtils.setLimitWidth(left, 64);
Copy link

Copilot AI Sep 25, 2025

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));
Copy link

Copilot AI Sep 25, 2025

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.

Suggested change
// 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)));
Copy link

Copilot AI Sep 25, 2025

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.

Suggested change
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.

Copy link
Member

@Glavo Glavo left a comment

Choose a reason for hiding this comment

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

我改了一点,但发现问题还是很多,剩下的你自己再仔细看看改改吧。

Copy link
Contributor

@3gf8jv4dv 3gf8jv4dv left a comment

Choose a reason for hiding this comment

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

我正在考虑是否要在模组/世界/原理图/资源包管理中简化这些文本的描述。

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.

[Feature] 资源包管理

4 participants