Merged
Conversation
Glavo
approved these changes
Mar 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
为启动器背景“自定义路径”增加对文件夹路径的支持:当配置的背景路径指向文件夹时,从该文件夹内随机选择图片作为背景展示,从而提升背景自定义的灵活性。
Changes:
- 自定义背景路径为目录时,随机选取目录内图片加载
- 自定义背景路径为文件时,保持按文件路径加载
- 移除未使用的
Paths导入,改用Path.of(...)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+196
to
+199
| Path path = Path.of(backgroundImage); | ||
| image = Files.isDirectory(path) | ||
| ? randomImageIn(path) | ||
| : tryLoadImage(path); |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends HMCL’s background image loading so that when the user’s custom background path points to a directory, the UI will randomly pick an image from that directory to display.
Changes:
- In
CUSTOMbackground mode, treat the configured path as either a file (load directly) or a directory (pick a random image). - Adjust default-background directory scanning to collect into a mutable list and improve the log message with the actual directory path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+196
to
+199
| Path path = Path.of(backgroundImage); | ||
| image = Files.isDirectory(path) | ||
| ? randomImageIn(path) | ||
| : tryLoadImage(path); |
| List<Path> candidates; | ||
| ArrayList<Path> candidates; | ||
| try (Stream<Path> stream = Files.list(imageDir)) { | ||
| candidates = stream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.