From f45322905f83bba83ffc2205a4e6d61b386fdd57 Mon Sep 17 00:00:00 2001 From: Pigeon0v0 Date: Sat, 27 Jul 2024 12:54:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=95=B0=E6=8D=AE=E5=8C=85?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=20(WIP)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plain Craft Launcher 2/FormMain.xaml.vb | 1 + .../Modules/Minecraft/ModComp.vb | 8 +- Plain Craft Launcher 2/Modules/ModMain.vb | 1 + .../PageDownload/PageDownloadDataPack.xaml | 115 +++++++++++++++++ .../PageDownload/PageDownloadDataPack.xaml.vb | 122 ++++++++++++++++++ .../Pages/PageDownload/PageDownloadLeft.xaml | 8 ++ .../PageDownload/PageDownloadLeft.xaml.vb | 11 +- .../Plain Craft Launcher 2.vbproj | 12 +- 8 files changed, 270 insertions(+), 8 deletions(-) create mode 100644 Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml create mode 100644 Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml.vb diff --git a/Plain Craft Launcher 2/FormMain.xaml.vb b/Plain Craft Launcher 2/FormMain.xaml.vb index 265004e7..5251dcce 100644 --- a/Plain Craft Launcher 2/FormMain.xaml.vb +++ b/Plain Craft Launcher 2/FormMain.xaml.vb @@ -1062,6 +1062,7 @@ Install: DownloadLiteLoader = 9 DownloadMod = 11 DownloadPack = 12 + DownloadDataPack = 15 SetupLaunch = 0 SetupUI = 1 SetupSystem = 2 diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb b/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb index 44ce4d07..c5548ee9 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb @@ -13,6 +13,10 @@ ''' 资源包。 ''' ResourcePack = 2 + ''' + ''' 数据包。 + ''' + DataPack = 4 End Enum Public Enum CompModLoaderType 'https://docs.curseforge.com/?http#tocS_ModLoaderType @@ -748,8 +752,8 @@ NoSubtitle: Address += "&classId=6" Case CompType.ModPack Address += "&classId=4471" - Case CompType.ResourcePack - 'FUTURE: Res + Case CompType.DataPack + Address += "&classId=6945" End Select Address += "&categoryId=" & If(Tag = "", "0", Tag.Before("/")) If ModLoader <> CompModLoaderType.Any Then Address += "&modLoaderType=" & CType(ModLoader, Integer) diff --git a/Plain Craft Launcher 2/Modules/ModMain.vb b/Plain Craft Launcher 2/Modules/ModMain.vb index a9718867..c2f845ad 100644 --- a/Plain Craft Launcher 2/Modules/ModMain.vb +++ b/Plain Craft Launcher 2/Modules/ModMain.vb @@ -398,6 +398,7 @@ EndHint: Public FrmDownloadFabric As PageDownloadFabric Public FrmDownloadMod As PageDownloadMod Public FrmDownloadPack As PageDownloadPack + Public FrmDownloadDataPack As PageDownloadDataPack '设置页面声明 Public FrmSetupLeft As PageSetupLeft diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml new file mode 100644 index 00000000..6edbc9a2 --- /dev/null +++ b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml.vb b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml.vb new file mode 100644 index 00000000..3adc461d --- /dev/null +++ b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml.vb @@ -0,0 +1,122 @@ +Public Class PageDownloadDataPack + + Public Const PageSize = 40 + + '加载器信息 + Public Shared Loader As New LoaderTask(Of CompProjectRequest, Integer)("CompProject Shader", AddressOf CompProjectsGet, AddressOf LoaderInput) With {.ReloadTimeout = 60 * 1000} + Public Shared Storage As New CompProjectStorage + Public Shared Page As Integer = 0 + Private Sub PageDownloadShader_Inited(sender As Object, e As EventArgs) Handles Me.Initialized + PageLoaderInit(Load, PanLoad, PanContent, PanAlways, Loader, AddressOf Load_OnFinish, AddressOf LoaderInput) + If McVersionHighest = -1 Then McVersionHighest = Math.Max(McVersionHighest, Integer.Parse(CType(TextSearchVersion.Items(1), MyComboBoxItem).Content.ToString.Split(".")(1))) + End Sub + Private Shared Function LoaderInput() As CompProjectRequest + Dim Request As New CompProjectRequest(CompType.DataPack, Storage, (Page + 1) * PageSize) + If FrmDownloadDataPack IsNot Nothing Then + With Request + .SearchText = FrmDownloadDataPack.TextSearchName.Text + .GameVersion = If(FrmDownloadDataPack.TextSearchVersion.Text = "全部 (也可自行输入)", Nothing, + If(FrmDownloadDataPack.TextSearchVersion.Text.Contains(".") OrElse FrmDownloadDataPack.TextSearchVersion.Text.Contains("w"), FrmDownloadDataPack.TextSearchVersion.Text, Nothing)) + .Tag = FrmDownloadDataPack.ComboSearchTag.SelectedItem.Tag + .Source = CType(Val(FrmDownloadDataPack.ComboSearchSource.SelectedItem.Tag), CompSourceType) + End With + End If + Return Request + End Function + + '结果 UI 化 + Private Sub Load_OnFinish() + Try + Log($"[Comp] 开始可视化数据包列表,已储藏 {Storage.Results.Count} 个结果,当前在第 {Page + 1} 页") + '列表项 + PanProjects.Children.Clear() + For i = Math.Min(Page * PageSize, Storage.Results.Count - 1) To Math.Min((Page + 1) * PageSize - 1, Storage.Results.Count - 1) + PanProjects.Children.Add(Storage.Results(i).ToCompItem(Loader.Input.GameVersion Is Nothing, False)) + Next + '页码 + CardPages.Visibility = If(Storage.Results.Count > 40 OrElse + Storage.CurseForgeOffset < Storage.CurseForgeTotal OrElse Storage.ModrinthOffset < Storage.ModrinthTotal, + Visibility.Visible, Visibility.Collapsed) + LabPage.Text = Page + 1 + BtnPageFirst.IsEnabled = Page > 1 + BtnPageFirst.Opacity = If(BtnPageFirst.IsEnabled, 1, 0.2) + BtnPageLeft.IsEnabled = Page > 0 + BtnPageLeft.Opacity = If(BtnPageLeft.IsEnabled, 1, 0.2) + BtnPageRight.IsEnabled = Storage.Results.Count > PageSize * (Page + 1) OrElse + Storage.CurseForgeOffset < Storage.CurseForgeTotal OrElse Storage.ModrinthOffset < Storage.ModrinthTotal + BtnPageRight.Opacity = If(BtnPageRight.IsEnabled, 1, 0.2) + '错误信息 + If Storage.ErrorMessage Is Nothing Then + HintError.Visibility = Visibility.Collapsed + Else + HintError.Visibility = Visibility.Visible + HintError.Text = Storage.ErrorMessage + End If + '强制返回顶部 + PanBack.ScrollToTop() + Catch ex As Exception + Log(ex, "可视化数据包列表出错", LogLevel.Feedback) + End Try + End Sub + + '自动重试 + Private Sub Load_State(sender As Object, state As MyLoading.MyLoadingState, oldState As MyLoading.MyLoadingState) Handles Load.StateChanged + Select Case Loader.State + Case LoadState.Failed + Dim ErrorMessage As String = "" + If Loader.Error IsNot Nothing Then ErrorMessage = Loader.Error.Message + If ErrorMessage.Contains("不是有效的 JSON 文件") Then + Log("[Download] 下载的数据包列表 JSON 文件损坏,已自动重试", LogLevel.Debug) + PageLoaderRestart() + End If + End Select + End Sub + + '切换页码 + + Private Sub BtnPageFirst_Click(sender As Object, e As RoutedEventArgs) Handles BtnPageFirst.Click + ChangePage(0) + End Sub + Private Sub BtnPageLeft_Click(sender As Object, e As RoutedEventArgs) Handles BtnPageLeft.Click + ChangePage(Page - 1) + End Sub + Private Sub BtnPageRight_Click(sender As Object, e As RoutedEventArgs) Handles BtnPageRight.Click + ChangePage(Page + 1) + End Sub + Private Sub ChangePage(NewPage As Integer) + CardPages.IsEnabled = False + Page = NewPage + FrmMain.BackToTop() + Log($"[Download] 数据包切换到第 {Page + 1} 页") + RunInThread(Sub() + Thread.Sleep(100) '等待向上滚的动画结束 + RunInUi(Sub() CardPages.IsEnabled = True) + Loader.Start() + End Sub) + End Sub + +#Region "搜索" + + '搜索按钮 + Private Sub StartNewSearch() Handles BtnSearchRun.Click + Page = 0 + If Loader.ShouldStart(LoaderInput()) Then Storage = New CompProjectStorage '避免连续搜索两次使得 CompProjectStorage 引用丢失(#1311) + Loader.Start() + End Sub + Private Sub EnterTrigger(sender As Object, e As KeyEventArgs) Handles TextSearchName.KeyDown, TextSearchVersion.KeyDown + If e.Key = Key.Enter Then StartNewSearch() + End Sub + + '重置按钮 + Private Sub BtnSearchReset_Click(sender As Object, e As EventArgs) Handles BtnSearchReset.Click + TextSearchName.Text = "" + TextSearchVersion.Text = "全部 (也可自行输入)" + TextSearchVersion.SelectedIndex = 0 + ComboSearchSource.SelectedIndex = 0 + ComboSearchTag.SelectedIndex = 0 + Loader.LastFinishedTime = 0 '要求强制重新开始 + End Sub + +#End Region + +End Class diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml index 8a646677..a910b048 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml +++ b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml @@ -84,6 +84,14 @@ + + + + + + + diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml.vb b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml.vb index 2658c33e..fcd1ad12 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml.vb +++ b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml.vb @@ -10,7 +10,7 @@ ''' ''' 勾选事件改变页面。 ''' - Private Sub PageCheck(sender As MyListItem, e As RouteEventArgs) Handles ItemInstall.Check, ItemClient.Check, ItemOptiFine.Check, ItemForge.Check, ItemNeoForge.Check, ItemLiteLoader.Check, ItemMod.Check, ItemFabric.Check, ItemPack.Check + Private Sub PageCheck(sender As MyListItem, e As RouteEventArgs) Handles ItemInstall.Check, ItemClient.Check, ItemOptiFine.Check, ItemForge.Check, ItemNeoForge.Check, ItemLiteLoader.Check, ItemMod.Check, ItemFabric.Check, ItemPack.Check, ItemDataPack.Check '尚未初始化控件属性时,sender.Tag 为 Nothing,会导致切换到页面 0 '若使用 IsLoaded,则会导致模拟点击不被执行(模拟点击切换页面时,控件的 IsLoaded 为 False) If sender.Tag IsNot Nothing Then PageChange(Val(sender.Tag)) @@ -46,6 +46,9 @@ Case FormMain.PageSubType.DownloadPack If FrmDownloadPack Is Nothing Then FrmDownloadPack = New PageDownloadPack Return FrmDownloadPack + Case FormMain.PageSubType.DownloadDataPack + If FrmDownloadDataPack Is Nothing Then FrmDownloadDataPack = New PageDownloadDataPack + Return FrmDownloadDataPack Case Else Throw New Exception("未知的下载子页面种类:" & ID) End Select @@ -114,6 +117,12 @@ CompProjectCache.Clear() If FrmDownloadPack IsNot Nothing Then FrmDownloadPack.PageLoaderRestart() ItemPack.Checked = True + Case FormMain.PageSubType.DownloadDataPack + PageDownloadDataPack.Storage = New CompProjectStorage + PageDownloadDataPack.Page = 0 + CompProjectCache.Clear() + If FrmDownloadDataPack IsNot Nothing Then FrmDownloadDataPack.PageLoaderRestart() + ItemDataPack.Checked = True Case FormMain.PageSubType.DownloadClient DlClientListLoader.Start(IsForceRestart:=True) ItemClient.Checked = True diff --git a/Plain Craft Launcher 2/Plain Craft Launcher 2.vbproj b/Plain Craft Launcher 2/Plain Craft Launcher 2.vbproj index d68df7af..85fb0fc8 100644 --- a/Plain Craft Launcher 2/Plain Craft Launcher 2.vbproj +++ b/Plain Craft Launcher 2/Plain Craft Launcher 2.vbproj @@ -185,9 +185,6 @@ MyIconTextButton.xaml - - - @@ -232,6 +229,9 @@ MyCompItem.xaml + + PageDownloadDataPack.xaml + PageDownloadMod.xaml @@ -472,7 +472,6 @@ FormMain.xaml Code - MSBuild:Compile Designer @@ -481,6 +480,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + Designer MSBuild:Compile @@ -928,7 +931,6 @@ - From c1ba65783d823f3f10fffe270e2d11814c4a501d Mon Sep 17 00:00:00 2001 From: Pigeon0v0 Date: Sat, 27 Jul 2024 18:33:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=95=B0=E6=8D=AE=E5=8C=85=E5=88=97=E8=A1=A8=EF=BC=88?= =?UTF-8?q?=E4=BD=86=E6=98=AF=E4=B8=8B=E4=B8=8D=E4=BA=86=E4=B8=80=E7=82=B9?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plain Craft Launcher 2/FormMain.xaml.vb | 2 + .../Modules/Minecraft/ModComp.vb | 36 ++++++++++++-- .../Modules/Minecraft/MyCompItem.xaml.vb | 2 + .../PageDownload/PageDownloadDataPack.xaml | 48 +++++++++---------- 4 files changed, 59 insertions(+), 29 deletions(-) diff --git a/Plain Craft Launcher 2/FormMain.xaml.vb b/Plain Craft Launcher 2/FormMain.xaml.vb index 5251dcce..17a6a42c 100644 --- a/Plain Craft Launcher 2/FormMain.xaml.vb +++ b/Plain Craft Launcher 2/FormMain.xaml.vb @@ -1098,6 +1098,8 @@ Install: Return "Mod 下载 - " & Project.TranslatedName Case CompType.ModPack Return "整合包下载 - " & Project.TranslatedName + Case CompType.DataPack + Return "数据包下载 - " & Project.TranslatedName 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 c5548ee9..1e7c7f51 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb @@ -277,8 +277,10 @@ Type = CompType.Mod ElseIf Website.Contains("/modpacks/") Then Type = CompType.ModPack - Else + ElseIf Website.Contains("/resourcepacks/") Then Type = CompType.ResourcePack + Else + Type = CompType.DataPack End If 'Tags Tags = New List(Of String) @@ -325,7 +327,15 @@ Case 4480 : Tags.Add("基于地图") Case 4481 : Tags.Add("轻量") Case 4482 : Tags.Add("大型") - 'FUTURE: Res + '数据包 + Case 6946 : Tags.Add("Mod 支持") + Case 6947 : Tags.Add("杂项") + Case 6948 : Tags.Add("冒险") + Case 6949 : Tags.Add("幻想") + Case 6950 : Tags.Add("支持库") + Case 6951 : Tags.Add("科技") + Case 6952 : Tags.Add("魔法") + Case 6953 : Tags.Add("实用工具") End Select Next If Not Tags.Any() Then Tags.Add("杂项") @@ -353,6 +363,7 @@ Case "mod" : Type = CompType.Mod Case "modpack" : Type = CompType.ModPack Case "resourcepack" : Type = CompType.ResourcePack + Case "datapack" : Type = CompType.DataPack End Select 'Tags & ModLoaders Tags = New List(Of String) @@ -391,7 +402,26 @@ Case "adventure" : Tags.Add("冒险") Case "kitchen-sink" : Tags.Add("烹饪") Case "lightweight" : Tags.Add("轻量") - 'FUTURE: Res + '数据包 + Case "adventure" : Tags.Add("冒险") + Case "cursed" : Tags.Add("Cursed") + Case "decoration" : Tags.Add("装饰") + Case "economy" : Tags.Add("经济") + Case "equipment" : Tags.Add("装备") + Case "food" : Tags.Add("食物") + Case "game-mechanics" : Tags.Add("游戏机制") + Case "library" : Tags.Add("支持库") + Case "magic" : Tags.Add("魔法") + Case "management" : Tags.Add("管理") + Case "minigame" : Tags.Add("小游戏") + Case "mobs" : Tags.Add("生物") + Case "optimization" : Tags.Add("优化") + Case "social" : Tags.Add("社交") + Case "storage" : Tags.Add("存储") + Case "technology" : Tags.Add("科技") + Case "transportation" : Tags.Add("交通") + Case "utility" : Tags.Add("实用工具") + Case "worldgen" : Tags.Add("世界生成") End Select Next If Not Tags.Any() Then Tags.Add("杂项") diff --git a/Plain Craft Launcher 2/Modules/Minecraft/MyCompItem.xaml.vb b/Plain Craft Launcher 2/Modules/Minecraft/MyCompItem.xaml.vb index 6bf0f720..81f03f4d 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/MyCompItem.xaml.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/MyCompItem.xaml.vb @@ -191,6 +191,8 @@ RetryStart: TargetLoader = PageDownloadMod.Loader.Input.ModLoader Case CompType.ModPack TargetVersion = If(PageDownloadPack.Loader.Input.GameVersion, "") + Case CompType.DataPack + TargetVersion = If(PageDownloadDataPack.Loader.Input.GameVersion, "") Case Else 'CompType.ResourcePack 'FUTURE: Res TargetVersion = "" 'If(PageDownloadResource.Loader.Input.GameVersion, "") diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml index 6edbc9a2..ea526766 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml +++ b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadDataPack.xaml @@ -51,32 +51,28 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -108,7 +104,7 @@ - + From 9d3be210904be25056905d63b511df86a01df87a Mon Sep 17 00:00:00 2001 From: Pigeon0v0 Date: Sun, 22 Sep 2024 10:15:49 +0800 Subject: [PATCH 3/3] =?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 17a6a42c..cbbeabda 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 1e7c7f51..c600a0b3 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 0302160b..9333ea3c 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