Skip to content

[Enhancement] 永久保存自定义实例图标#6097

Open
ToobLac wants to merge 15 commits into
HMCL-dev:mainfrom
ToobLac:icon-save
Open

[Enhancement] 永久保存自定义实例图标#6097
ToobLac wants to merge 15 commits into
HMCL-dev:mainfrom
ToobLac:icon-save

Conversation

@ToobLac

@ToobLac ToobLac commented May 16, 2026

Copy link
Copy Markdown
Contributor

Closes #5485

目前暂定保存在当前启动器实例的 .hmcl 文件夹中

@2012hzy

2012hzy commented Jun 13, 2026

Copy link
Copy Markdown

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a feature to save custom game icons, adding a configuration setting, a settings UI, and logic to copy selected custom icons to a dedicated directory. The review feedback highlights a potential NoSuchFileException if the target directory does not exist when copying files, and points out a translation inconsistency in the Traditional Chinese localization file.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +119 to +121
} else {
dest = GAME_ICONS_DIR.resolve(selectedFile.getFileName());
int i = 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

如果 game_icons 目录不存在,FileUtils.copyFile 可能会因为父目录不存在而抛出 NoSuchFileException。在复制文件之前,应该确保该目录已被创建。建议在解析目标路径前调用 Files.createDirectories(GAME_ICONS_DIR)

Suggested change
} else {
dest = GAME_ICONS_DIR.resolve(selectedFile.getFileName());
int i = 1;
} else {
Files.createDirectories(GAME_ICONS_DIR);
dest = GAME_ICONS_DIR.resolve(selectedFile.getFileName());
int i = 1;

settings.launcher.proxy.port=連線埠
settings.launcher.proxy.socks=SOCKS
settings.launcher.proxy.username=帳戶
settings.launcher.save_custom_game_icons=保存自定義遊戲圖標

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

在繁体中文(I18N_zh.properties)中,settings.icon 使用了“圖示”,而新增的 settings.launcher.save_custom_game_icons 使用了“圖標”。为了保持用词一致性,建议将“圖標”改为“圖示”。

settings.launcher.save_custom_game_icons=保存自定義遊戲圖示

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] 永久保存设置的实例图标至预设

3 participants