feat: 获取并显示实例安装的资源#202
Merged
AnemoFlower merged 30 commits intoJun 17, 2026
Merged
Conversation
删除线在 macOS 12 上需要通过 AttributedString 实现,MyText 目前不支持,需要等待 CylorineStudio#195 合并
There was a problem hiding this comment.
Pull request overview
该 PR 旨在实现 Issue #102:在实例设置中获取并展示当前实例已安装的资源(Mod / 资源包 / 光影包),并补齐资源解析、远端信息查询与本地缓存等基础能力。
Changes:
- 新增“已安装资源”页面与侧边栏入口,支持搜索、分页、打开文件位置、启用/禁用、查看远端项目信息等交互
- 在 Core 中新增资源扫描/解析(Mod/资源包/光影)与远端信息查询服务,并引入 ResourceCache 进行资源与图标缓存持久化
- 将原有
ProjectType语义升级/统一为ResourceType,并扩展 Modrinth API 客户端批量获取项目能力;同时移除部分旧工具类并以新扩展替代
Reviewed changes
Copilot reviewed 46 out of 53 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| Resources/licenses/TOMLDecoder.LICENSE.txt | 新增依赖许可 |
| PCL.Mac/Views/More/AboutPage.swift | 关于页新增依赖声明 |
| PCL.Mac/Views/Launch/InstanceSettings/InstanceSettingsSidebar.swift | 实例设置新增资源入口 |
| PCL.Mac/Views/Launch/InstanceSettings/InstalledResourcesPage.swift | 已安装资源 UI 页面 |
| PCL.Mac/Views/Download/ResourcesSearchPage.swift | 搜索页类型改为 ResourceType |
| PCL.Mac/Views/Download/ResourceInstallPage.swift | 增加跳转 Modrinth 按钮 |
| PCL.Mac/Views/CardContainer.swift | 交互状态可静态化 |
| PCL.Mac/ViewModels/ResourcesSearchViewModel.swift | 类型改为 ResourceType |
| PCL.Mac/ViewModels/Instance/InstanceViewModel.swift | 实例/仓库状态 VM |
| PCL.Mac/ViewModels/Instance/InstanceListViewModel.swift | 实例列表 VM |
| PCL.Mac/ViewModels/Instance/InstanceConfigViewModel.swift | 实例配置 VM |
| PCL.Mac/ViewModels/Instance/InstalledResourcesViewModel.swift | 已安装资源 VM(加载/分页/禁用) |
| PCL.Mac/Models/ResourceDisplayModel.swift | 资源展示模型 |
| PCL.Mac/Models/ProjectListItemModel.swift | tag 本地化辅助 |
| PCL.Mac/Models/ListItem.swift | 列表图标支持网络/系统图标 |
| PCL.Mac/Extensions/Localizable.swift | ResourceType 本地化 |
| PCL.Mac/Components/PaginatedContainer.swift | 翻页按钮边界修正 |
| PCL.Mac/Components/MyListItem.swift | 统一图标渲染 + 新按钮组件 |
| PCL.Mac/Assets.xcassets/Icons/iconModLogo.imageset/Contents.json | 新增占位图标资源 |
| PCL.Mac/Assets.xcassets/Controls/btnOpen.imageset/Contents.json | 新增控制图标资源 |
| PCL.Mac/Assets.xcassets/Controls/btnOpen.imageset/btnOpen.svg | 新增控制图标 |
| PCL.Mac/Assets.xcassets/Controls/btnEnable.imageset/Contents.json | 新增控制图标资源 |
| PCL.Mac/Assets.xcassets/Controls/btnEnable.imageset/btnEnable.svg | 新增控制图标 |
| PCL.Mac/Assets.xcassets/Controls/btnDisable.imageset/Contents.json | 新增控制图标资源 |
| PCL.Mac/Assets.xcassets/Controls/btnDisable.imageset/btnDisable.svg | 新增控制图标 |
| PCL.Mac/App/RootView.swift | 注入静态 CardInteractionState |
| PCL.Mac/App/AppRouter.swift | 新增 installedResources 路由 |
| PCL.Mac/App/AppDelegate.swift | 初始化/保存 ResourceCache |
| PCL.Mac.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 新增 TOMLDecoder 依赖 |
| PCL.Mac.xcodeproj/project.pbxproj | 链接 TOMLDecoder 包 |
| PCL.Mac.Core/Utils/Utils.swift | 移除旧模板替换工具 |
| PCL.Mac.Core/Utils/JarUtils.swift | Manifest 解析/提取优化 |
| PCL.Mac.Core/Utils/ArchiveUtils.swift | 移除旧归档工具 |
| PCL.Mac.Core/Services/Resource/ResourceRemoteLookupService.swift | 远端资源信息查询 |
| PCL.Mac.Core/Services/Resource/ResourceParser.swift | 资源解析协议/结果模型 |
| PCL.Mac.Core/Services/Resource/ResourceLoadService.swift | 扫描/解析/缓存资源 |
| PCL.Mac.Core/Services/Resource/Parsers/ShaderParser.swift | 光影包解析 |
| PCL.Mac.Core/Services/Resource/Parsers/ResourcepackParser.swift | 资源包解析 |
| PCL.Mac.Core/Services/Resource/Parsers/ModParser.swift | Mod 解析(含 TOML) |
| PCL.Mac.Core/Services/ModrinthAPIClient.swift | 批量获取项目接口 |
| PCL.Mac.Core/Services/ModpackImportService.swift | 归档提取方式调整 |
| PCL.Mac.Core/Services/MinecraftInstanceLoader.swift | 归档读取逻辑替换 |
| PCL.Mac.Core/Services/ForgeInstallService.swift | 模板替换方法迁移 |
| PCL.Mac.Core/Services/Cache/ResourceCache.swift | 新增资源缓存实现 |
| PCL.Mac.Core/Models/Resource.swift | 引入 Resource/ResourceType |
| PCL.Mac.Core/Models/Modrinth/ModrinthProject.swift | ProjectType -> ResourceType |
| PCL.Mac.Core/Models/ModLoader.swift | ModLoader 支持 Codable |
| PCL.Mac.Core/Models/CurseForge/CurseForgeMod.swift | 补齐 CurseForge 模型字段 |
| PCL.Mac.Core/Minecraft/Launch/MinecraftLauncher.swift | 模板替换方法迁移 |
| PCL.Mac.Core/Extensions/URL+Utils.swift | 删除所有扩展名工具 |
| PCL.Mac.Core/Extensions/String+Template.swift | 占位符替换扩展 |
| PCL.Mac.Core/Extensions/Archive+EntryExtract.swift | 归档 Entry 提取扩展 |
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.
closes #102