修改了导出整合包UI

This commit is contained in:
淋淋 落
2024-07-12 09:02:15 +08:00
parent ae4f1b8672
commit b28c707cb5
2 changed files with 70 additions and 69 deletions
@@ -18,38 +18,9 @@
End Sub
#Region "控件事件"
Private Sub ComboExportType_Change(sender As ComboBox, e As SelectionChangedEventArgs) Handles ComboExportType.SelectionChanged
If AniControlEnabled <> 0 Then Exit Sub
Type = If(sender.SelectedIndex = 0, ModpackType.Compressed, ModpackType.Modrinth)
Select Case Type
Case ModpackType.Modrinth
If GridCompressed IsNot Nothing Then GridCompressed.Visibility = Visibility.Collapsed
If GridModrinth IsNot Nothing Then GridModrinth.Visibility = Visibility.Visible
Case ModpackType.Compressed
If GridCompressed IsNot Nothing Then GridCompressed.Visibility = Visibility.Visible
If GridModrinth IsNot Nothing Then GridModrinth.Visibility = Visibility.Collapsed
End Select
CardExport.TriggerForceResize()
End Sub
Private Sub BtnExportExport_Click() Handles BtnExportExport.Click
If Type = ModpackType.Compressed AndAlso Val(VersionBranchCode) <> 50 Then
If MyMsgBox("你当前的 PCL 不是正式版,有二次分发(制作压缩包)的限制。" & vbCrLf &
"请使用正式版再次尝试该操作!" & vbCrLf &
"其他类型的整合包(例如 Modrinth 整合包)没有该限制。", Button1:="下载正式版", Button2:="取消") = 1 Then
OpenWebsite("https://afdian.net/p/0164034c016c11ebafcb52540025c377")
End If
Exit Sub
End If
Dim savePath As String = SelectAs(
"选择导出位置", $"整合包 - {If(String.IsNullOrWhiteSpace(TbExportName.Text), CurrentVersion.Name, TbExportName.Text)}" & If(Type = ModpackType.Modrinth, ".mrpack", ".zip"),
If(Type = ModpackType.Modrinth, "Modrinth 整合包(*.mrpack)|*.mrpack", "整合包文件(*.zip)|*.zip"))
If String.IsNullOrEmpty(savePath) Then Exit Sub
ModpackExport(New ExportOptions(CurrentVersion, savePath, Type, {TbExportSave.Text},
PCLSetupGlobal:=CheckExportGlobal.Checked,
PCLSetupVer:=CheckExportVersion.Checked, Name:=TbExportName.Text,
VerID:=TbExportVersion.Text))
End Sub
#End Region