From 9d3be210904be25056905d63b511df86a01df87a Mon Sep 17 00:00:00 2001 From: Pigeon0v0 Date: Sun, 22 Sep 2024 10:15:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=95=B0=E6=8D=AE=E5=8C=85=E5=B7=A5=E7=A8=8B=E6=97=B6?= =?UTF-8?q?=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BD=86?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=BC=9A=E7=82=B8=E6=8E=89=E7=82=B9=E5=88=AB?= =?UTF-8?q?=E7=9A=84=E4=B8=9C=E8=A5=BF=EF=BC=8C=E9=9C=80=E8=A6=81=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plain Craft Launcher 2/FormMain.xaml.vb | 6 +++++- Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb | 8 ++++++++ .../Pages/PageDownload/PageDownloadCompDetail.xaml.vb | 8 +++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Plain Craft Launcher 2/FormMain.xaml.vb b/Plain Craft Launcher 2/FormMain.xaml.vb index 17a6a42..cbbeabd 100644 --- a/Plain Craft Launcher 2/FormMain.xaml.vb +++ b/Plain Craft Launcher 2/FormMain.xaml.vb @@ -1099,7 +1099,11 @@ Install: Case CompType.ModPack Return "整合包下载 - " & Project.TranslatedName Case CompType.DataPack - Return "数据包下载 - " & Project.TranslatedName + If Project.IsMix Then + Return "Mod / 数据包下载 - " & Project.TranslatedName + Else + Return "数据包下载 - " & Project.TranslatedName + End If Case Else 'CompType.ResourcePack Return "资源包下载 - " & Project.TranslatedName End Select diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb b/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb index 1e7c7f5..c600a0b 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb @@ -118,6 +118,10 @@ ''' Public ReadOnly Type As CompType ''' + ''' 是否为 Mod / 数据包融合工程。 + ''' + Public ReadOnly IsMix As Boolean + ''' ''' 工程的短名。例如 technical-enchant。 ''' Public ReadOnly Slug As String @@ -365,6 +369,10 @@ Case "resourcepack" : Type = CompType.ResourcePack Case "datapack" : Type = CompType.DataPack End Select + If Data("categories").ToArray.Contains("datapack") Then 'Modrinth 上的数据包由于未知原因,返回的 project_type 为 mod,这里做兜底处理 + Type = CompType.DataPack + IsMix = Data("categories").ToArray.Contains("forge") OrElse Data("categories").ToArray.Contains("fabric") OrElse Data("categories").ToArray.Contains("neoforge") OrElse Data("categories").ToArray.Contains("quilt") + End If 'Tags & ModLoaders Tags = New List(Of String) ModLoaders = New List(Of CompModLoaderType) diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml.vb b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml.vb index 0302160..9333ea3 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml.vb +++ b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml.vb @@ -205,7 +205,13 @@ RunInNewThread( Sub() Try - Dim Desc As String = If(Project.Type = CompType.ModPack, "整合包", If(Project.Type = CompType.Mod, "Mod ", "资源包")) + Dim Desc As String = "资源" + Select Case Project.Type + Case CompType.ModPack : Desc = "整合包" + Case CompType.Mod : Desc = "Mod " + Case CompType.ResourcePack : Desc = "资源包" + Case CompType.DataPack : Desc = If(File.FileName.EndsWith(".jar"), "Mod ", "数据包") '有些项目同时包含 Mod 版本和数据包版本 + End Select '确认默认保存位置 Dim DefaultFolder As String = Nothing If Project.Type = CompType.Mod Then