Skip to content

优化原理图管理功能#3978

Merged
Glavo merged 3 commits intoHMCL-dev:mainfrom
Glavo:memory
Jun 8, 2025
Merged

优化原理图管理功能#3978
Glavo merged 3 commits intoHMCL-dev:mainfrom
Glavo:memory

Conversation

@Glavo
Copy link
Copy Markdown
Member

@Glavo Glavo commented Jun 7, 2025

No description provided.

@Glavo Glavo requested a review from Copilot June 7, 2025 16:06
Copy link
Copy Markdown
Contributor

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 enhances schematic (Litematic) file management by extracting detailed metadata, adding localization for schematics folders, and updating the UI to expose schematics in the version page.

  • Extract multiple metadata fields (preview image, name, author, timestamps, block/volume counts, enclosure size) and region count in LitematicFile
  • Add “folder.schematics” entries to English and Chinese resource bundles
  • Include a “Schematics” item in the VersionPage browse menu

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/LitematicFile.java Refactored constructor to pull out metadata fields and region count; replaced on-the-fly tag lookups in getters
HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties Added Simplified Chinese key for schematics folder
HMCL/src/main/resources/assets/lang/I18N_zh.properties Added Traditional Chinese key for schematics folder
HMCL/src/main/resources/assets/lang/I18N.properties Added English key for schematics folder
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java Added “Schematics” menu item to version page browse menu
Comments suppressed due to low confidence (3)

HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/LitematicFile.java:110

  • The local variable previewImageData shadows the class field of the same name. Consider renaming the local tag variable to previewImageTag for clarity.
Tag previewImageData = metadata.get("PreviewImageData");

HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/LitematicFile.java:124

  • The local variable enclosingSize shadows the class field. Rename it to something like localEnclosingSize to avoid confusion.
Point3D enclosingSize = null;

HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/LitematicFile.java:143

  • There are several new getters (e.g., getVersion, getRegionCount, getEnclosingSize) and parsing paths; consider adding unit tests to verify metadata extraction and default behaviors.
public int getVersion() {

@Glavo Glavo merged commit ee652f6 into HMCL-dev:main Jun 8, 2025
3 checks passed
@Glavo Glavo deleted the memory branch June 8, 2025 01:45
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.

2 participants