🚧 UI 设计(未完成)
This commit is contained in:
@@ -884,7 +884,7 @@ Retry:
|
||||
''' <summary>
|
||||
''' 要保留到整合包的文件。
|
||||
''' </summary>
|
||||
Public Remain As String()
|
||||
Public Additional As String()
|
||||
''' <summary>
|
||||
''' 是否需要保留 PCL 全局设置。仅在包括 PCL 时有效。
|
||||
''' </summary>
|
||||
@@ -904,7 +904,7 @@ Retry:
|
||||
Public Sub New(Version As McVersion,
|
||||
Dest As String,
|
||||
IncludePCL As Boolean,
|
||||
Remain As String(),
|
||||
Additional As String(),
|
||||
Optional PCLSetupGlobal As Boolean = True,
|
||||
Optional Name As String = "",
|
||||
Optional Desc As String = "",
|
||||
@@ -912,7 +912,7 @@ Retry:
|
||||
Me.Version = Version
|
||||
Me.Dest = Dest
|
||||
Me.IncludePCL = IncludePCL
|
||||
Me.Remain = Remain
|
||||
Me.Additional = Additional
|
||||
Me.PCLSetupGlobal = PCLSetupGlobal
|
||||
Me.Name = Name
|
||||
Me.Desc = Desc
|
||||
@@ -934,9 +934,9 @@ Retry:
|
||||
End Sub
|
||||
Private Function ModpackExportBlocking(Options As ExportOptions) As Boolean
|
||||
If Options.IncludePCL Then
|
||||
Return ExportCompressed(Options.Version, Options.Dest, Options.Remain, Options.PCLSetupGlobal)
|
||||
Return ExportCompressed(Options.Version, Options.Dest, Options.Additional, Options.Name, Options.VerID, Options.PCLSetupGlobal)
|
||||
End If
|
||||
Return ExportModrinth(Options.Version, Options.Dest, Options.Remain, Options.Name, Options.VerID)
|
||||
Return ExportModrinth(Options.Version, Options.Dest, Options.Additional, Options.Name, Options.VerID)
|
||||
End Function
|
||||
|
||||
#Region "冗余"
|
||||
@@ -954,7 +954,7 @@ Retry:
|
||||
".*\.BakaCoreInfo", 'BakaXL 配置
|
||||
"hmclversion\.cfg", "log4j2\.xml" 'HMCL 配置
|
||||
}
|
||||
Private Function IsVerRedundant(FilePath As String) As Boolean
|
||||
Public Function IsVerRedundant(FilePath As String) As Boolean
|
||||
For Each regex In VersionRedundant
|
||||
If RegexCheck(GetFileNameFromPath(FilePath).ToLower(), regex) Then Return True
|
||||
If FilePath.Replace("/", "\").EndsWithF("\journeymap\data\") OrElse
|
||||
@@ -967,9 +967,9 @@ Retry:
|
||||
#End Region
|
||||
|
||||
#Region "不同类型整合包的导出方法"
|
||||
Private Function ExportModrinth(Version As McVersion, DestPath As String, Saves As String(), Name As String, VerID As String)
|
||||
Private Function ExportModrinth(Version As McVersion, DestPath As String, Additional As String(), Name As String, VerID As String) As Boolean
|
||||
Try
|
||||
Log($"[Export] 导出整合包(Modrinth):{Version.Path} -> {DestPath},导出存档 {If(Saves Is Nothing OrElse Not Saves.Any, "不导出", Saves.Join(", "))}")
|
||||
Log($"[Export] 导出整合包(Modrinth):{Version.Path} -> {DestPath},额外版本文件 {If(Additional Is Nothing OrElse Not Additional.Any, "不导出", Additional.Join(", "))}")
|
||||
Dim tempDir As String = $"{ExpTempDir}{GetUuid()}\"
|
||||
Log($"[Export] 缓存文件夹:{tempDir}")
|
||||
Directory.CreateDirectory(tempDir)
|
||||
@@ -1035,11 +1035,15 @@ Retry:
|
||||
CopyFile(m, tempDir & "overrides\" & GetFileNameFromPath(m))
|
||||
Next
|
||||
|
||||
'存档
|
||||
For Each s In Saves
|
||||
If String.IsNullOrWhiteSpace(s) Then Continue For '草了,传空字串进去会直接把 saves 整个文件夹拷过去
|
||||
Dim fromPath As String = $"{Version.Path}saves\{s}"
|
||||
If Directory.Exists(fromPath) Then CopyDirectory(fromPath, $"{tempDir}overrides\saves\{s}")
|
||||
'额外文件
|
||||
For Each p In Additional
|
||||
If String.IsNullOrWhiteSpace(p) Then Continue For '传空字串进去会直接把整个版本文件夹拷过去
|
||||
Dim fromPath As String = $"{Version.Path}{p}"
|
||||
If Directory.Exists(fromPath) Then
|
||||
CopyDirectory(fromPath, $"{tempDir}overrides\{p}")
|
||||
ElseIf File.Exists(fromPath) Then
|
||||
CopyFile(fromPath, $"{tempDir}overrides\{p}")
|
||||
End If
|
||||
Next
|
||||
|
||||
If File.Exists(DestPath) Then File.Delete(DestPath) '选择文件的时候已经确认了要替换
|
||||
@@ -1051,52 +1055,23 @@ Retry:
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Function ExportCompressed(Version As McVersion, DestPath As String, Saves As String(), PCLSetupGlobal As Boolean)
|
||||
Private Function ExportCompressed(Version As McVersion, DestPath As String, Additional As String(), Name As String, VerID As String, PCLSetupGlobal As Boolean) As Boolean
|
||||
Try
|
||||
Log($"[Export] 导出整合包(压缩包):{Version.Path} -> {DestPath},导出存档 {If(Saves Is Nothing OrElse Not Saves.Any, "不导出", Saves.Join(", "))},全局设置 {If(PCLSetupGlobal, "导出", "不导出")}")
|
||||
Log($"[Export] 导出整合包(含启动器):{Version.Path} -> {DestPath},额外版本文件 {If(Additional Is Nothing OrElse Not Additional.Any, "不导出", Additional.Join(", "))},全局设置 {If(PCLSetupGlobal, "导出", "不导出")}")
|
||||
Dim tempDir As String = $"{ExpTempDir}{GetUuid()}\"
|
||||
Log($"[Export] 缓存文件夹:{tempDir}")
|
||||
Log($"[Export] 最终压缩包的缓存文件夹:{tempDir}")
|
||||
Directory.CreateDirectory(tempDir)
|
||||
Dim tempVerPath As String = $"{tempDir}{Version.Path.Replace(GetPathFromFullPath(Version.PathIndie), "")}"
|
||||
|
||||
For Each f In Directory.EnumerateFiles(Version.Path)
|
||||
If Not IsVerRedundant(GetFileNameFromPath(f)) Then
|
||||
Log($"[Export] 复制版本文件:{f} -> {tempVerPath}{GetFileNameFromPath(f)}")
|
||||
CopyFile(f, tempVerPath & GetFileNameFromPath(f))
|
||||
End If
|
||||
Next
|
||||
For Each d In Directory.EnumerateDirectories(Version.Path)
|
||||
If Not IsVerRedundant(GetFolderNameFromPath(d)) Then
|
||||
Log($"[Export] 复制版本文件夹:{d} -> {tempVerPath}{GetFolderNameFromPath(d)}\")
|
||||
CopyDirectory(d, $"{tempVerPath}{GetFolderNameFromPath(d)}\")
|
||||
End If
|
||||
Next
|
||||
|
||||
If Saves IsNot Nothing Then
|
||||
For Each s In Saves
|
||||
Dim saveFullPath As String = $"{Version.Path}saves\{s}"
|
||||
If Not Directory.Exists(saveFullPath) Then Continue For
|
||||
Log($"[Export] 复制存档文件夹:{saveFullPath} -> {tempVerPath}saves\{s}")
|
||||
CopyDirectory(saveFullPath, $"{tempVerPath}saves\{s}")
|
||||
Next
|
||||
End If
|
||||
|
||||
If PCLSetupGlobal Then
|
||||
Log($"[Export] 正在复制 PCL 全局设置")
|
||||
If File.Exists(Path & "PCL\Setup.ini") Then CopyFile("PCL\Setup.ini", tempDir & "PCL\Setup.ini")
|
||||
If File.Exists(Path & "PCL\Custom.xaml") Then CopyFile("PCL\Custom.xaml", tempDir & "PCL\Custom.xaml")
|
||||
If Directory.Exists(Path & "PCL\Pictures") Then CopyDirectory(Path & "PCL\Pictures", tempDir & "PCL\Pictures")
|
||||
If Directory.Exists(Path & "PCL\Musics") Then CopyDirectory(Path & "PCL\Musics", tempDir & "PCL\Musics")
|
||||
End If
|
||||
|
||||
If Directory.Exists($"{Version.PathIndie}libraries\optifine") Then '#114 OptiFine Libraries 缺失造成补全文件失败
|
||||
Log($"[Export] 正在复制 OptiFine Libraries")
|
||||
CopyDirectory($"{Version.PathIndie}libraries\optifine",
|
||||
$"{tempDir}{GetFolderNameFromPath(Version.PathIndie)}libraries\optifine")
|
||||
End If
|
||||
Log("[Export] 开始导出 Modrinth 整合包")
|
||||
ExportModrinth(Version, $"{tempDir}modpack.mrpack", Additional, Name, VerID)
|
||||
|
||||
Log($"[Export] 正在复制 PCL 本体")
|
||||
CopyFile(PathWithName, tempDir & GetFileNameFromPath(PathWithName)) 'PCL 本体
|
||||
CopyFile(PathWithName, tempDir & GetFileNameFromPath(PathWithName))
|
||||
|
||||
If PCLSetupGlobal Then
|
||||
Log($"[Export] 正在复制 PCL 全局配置")
|
||||
CopyFile(Path & "PCL\Setup.ini", tempDir & "PCL\Setup.ini")
|
||||
End If
|
||||
|
||||
If File.Exists(DestPath) Then File.Delete(DestPath) '选择文件的时候已经确认了要替换
|
||||
ZipFile.CreateFromDirectory(tempDir, DestPath)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<RowDefinition Height="9" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="9" />
|
||||
<RowDefinition Height="60" />
|
||||
<RowDefinition Height="28" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Text="整合包名称" Margin="0,0,25,0" />
|
||||
<local:MyTextBox Grid.Row="0" x:Name="TbExportName" Grid.ColumnSpan="2" Grid.Column="1" MaxLength="100" />
|
||||
@@ -59,15 +59,16 @@
|
||||
<local:MyComboBoxItem Content="狐狸(NeoForge)" Tag="pack://application:,,,/images/Blocks/NeoForge.png" />
|
||||
</local:MyComboBox>
|
||||
<TextBlock Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Left" Text="描述" Margin="0,0,25,0" />
|
||||
<local:MyTextBox Grid.Row="6" x:Name="TbExportDesc" Grid.ColumnSpan="2" Grid.Column="1" AcceptsReturn="True" TextWrapping="Wrap" VerticalContentAlignment="Top" Padding="0,5" MaxLength="100" />
|
||||
<local:MyTextBox Grid.Row="6" x:Name="TbExportDesc" Grid.ColumnSpan="2" Grid.Column="1" TextWrapping="Wrap" VerticalContentAlignment="Top" Padding="0,5" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</local:MyCard>
|
||||
|
||||
<local:MyCard x:Name="CardSwitch" Margin="0,0,0,15" Title="基础选项">
|
||||
<StackPanel Margin="25,38,15,15">
|
||||
<TextBlock Margin="0,1,0,1" Text="你可以在此勾选需要包含进整合包的文件或文件夹,其他文件或文件夹在高级选项添加。" TextWrapping="Wrap" />
|
||||
<Grid>
|
||||
<TextBlock x:Name="TbHint" Margin="0,1,0,1" Text="你可以在此勾选需要包含进整合包的文件或文件夹,其他文件或文件夹在高级选项添加。" TextWrapping="Wrap" />
|
||||
<!-- 注意:以上 TextBlock 的 Text 属性可能会在代码中被改动。 -->
|
||||
<Grid x:Name="PanFiles">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="18" />
|
||||
@@ -87,31 +88,33 @@
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="游戏配置" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" />
|
||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="2" Text="服务器列表"
|
||||
ToolTip="server.dat 文件" />
|
||||
Tag="server.dat" ToolTip="server.dat 文件" />
|
||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="3" Text="Mod 配置"
|
||||
ToolTip="config 文件夹" />
|
||||
Tag="config" ToolTip="config 文件夹" />
|
||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="4" Text="游戏配置"
|
||||
ToolTip="options.txt 文件" />
|
||||
Tag="options.txt" ToolTip="options.txt 文件" />
|
||||
<TextBlock Text="游戏文件" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" />
|
||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="2" Text="存档"
|
||||
ToolTip="saves 文件夹" />
|
||||
Tag="saves" ToolTip="saves 文件夹" />
|
||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="3" Text="材质包"
|
||||
ToolTip="resourcepacks 文件夹" />
|
||||
Tag="resources" ToolTip="resourcepacks 文件夹" />
|
||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="4" Text="光影包"
|
||||
ToolTip="shaderpacks 文件夹" />
|
||||
Tag="shaderpacks" ToolTip="shaderpacks 文件夹" />
|
||||
<TextBlock Text="PCL 配置" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" />
|
||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="3" Grid.Column="2" Text="包含启动器"
|
||||
ToolTip="将 PCL 程序包含在整合包内" />
|
||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="3" Grid.Column="3" Text="PCL 全局配置"
|
||||
ToolTip="将 PCL 全局配置包含在整合包内" />
|
||||
<local:MyCheckBox x:Name="CheckIncludePCL" Height="22" VerticalAlignment="Center" Grid.Row="3" Grid.Column="2" Text="包含启动器"
|
||||
Tag="" ToolTip="将 PCL 程序包含在整合包内" />
|
||||
<local:MyCheckBox x:Name="CheckIncludeSetup" Height="22" VerticalAlignment="Center" Grid.Row="3" Grid.Column="3" Text="PCL 全局配置"
|
||||
Tag="" ToolTip="将 PCL 全局配置包含在整合包内" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
</local:MyCard>
|
||||
<local:MyCard Title="高级选项" Margin="0,0,0,15" CanSwap="True" IsSwaped="True">
|
||||
<StackPanel x:Name="PanFileList" Margin="25,40,23,15">
|
||||
<local:MyListItem Type="CheckBox" Title="游戏存档" Height="35" />
|
||||
<local:MyListItem Type="CheckBox" Title="游戏存档" Height="35" />
|
||||
<TextBlock Margin="0,1,0,10" Text="你可以在此勾选需要包含进整合包的文件或文件夹。" TextWrapping="Wrap" />
|
||||
<local:MyListItem Type="CheckBox" Title="游戏存档" Height="35" Logo="M889.018182 418.909091H884.363636V316.509091a93.090909 93.090909 0 0 0-99.607272-89.832727h-302.545455l-93.090909-76.334546A46.545455 46.545455 0 0 0 358.865455 139.636364H146.152727A93.090909 93.090909 0 0 0 46.545455 229.469091V837.818182a46.545455 46.545455 0 0 0 46.545454 46.545454 46.545455 46.545455 0 0 0 16.756364-3.258181 109.381818 109.381818 0 0 0 25.134545 3.258181h586.472727a85.178182 85.178182 0 0 0 87.04-63.301818l163.374546-302.545454a46.545455 46.545455 0 0 0 5.585454-21.876364A82.385455 82.385455 0 0 0 889.018182 418.909091z m-744.727273-186.181818h198.283636l93.09091 76.334545a46.545455 46.545455 0 0 0 29.323636 10.705455h319.301818a12.101818 12.101818 0 0 1 6.516364 0V418.909091H302.545455a85.178182 85.178182 0 0 0-87.04 63.301818L139.636364 622.778182V232.727273a19.549091 19.549091 0 0 1 6.516363 0z m578.094546 552.029091a27.461818 27.461818 0 0 0-2.792728 6.516363H154.530909l147.083636-272.290909a27.461818 27.461818 0 0 0 2.792728-6.981818h565.061818z" />
|
||||
<local:MyListItem Type="CheckBox" Title="游戏存档" Height="35" Logo="M586.9 436h-74.7V62.4H177.1c-20.6 0-37.4 16.7-37.4 37.4v821.9c0 20.6 16.7 37.4 37.4 37.4h672.5c20.6 0 37.4-16.7 37.4-37.4V436H586.9z m0-74.7h297.8c-7.3-57.4-31.2-70.9-58.4-98.1l-66.5-66.5-0.1-0.1 0.1 0.1-0.9-0.9-22.8-22.8-0.9-0.9 0.1 0.1-0.1-0.1-66.5-66.5c-21.8-21.8-38.8-36.5-81.7-41.4l-0.1 297.1z" />
|
||||
<local:MyListItem Type="CheckBox" Title="游戏存档" Height="35" Logo="M834.5 684.1c-31.2-70.4-98.9-120.9-179.1-127.3 63.5-8.5 112.6-63 112.6-128.8 0-71.8-58.2-130-130-130s-130 58.2-130 130c0 65.9 49 120.3 112.6 128.8-80.2 6.4-148 57-179.1 127.3-8.7 19.7 6 42 27.6 42 12.1 0 22.7-7.5 27.7-18.5 24.3-53.9 78.5-91.5 141.3-91.5s117 37.6 141.3 91.5c5 11.1 15.6 18.5 27.7 18.5 21.4 0 36.1-22.3 27.4-42zM567.9 427.9c0-38.6 31.4-70 70-70s70 31.4 70 70-31.4 70-70 70-70-31.4-70-70zM460.3 347.9H216.9c-16.6 0-30 13.4-30 30s13.4 30 30 30h243.3c16.6 0 30-13.4 30-30 0.1-16.5-13.4-30-29.9-30zM367.4 459.6H216.9c-16.6 0-30 13.4-30 30s13.4 30 30 30h150.4c16.6 0 30-13.4 30-30 0.1-16.6-13.4-30-29.9-30zM297.4 571.2H217c-16.6 0-30 13.4-30 30s13.4 30 30 30h80.4c16.6 0 30-13.4 30-30 0-16.5-13.5-30-30-30zM900 236v552H124V236h776m0-60H124c-33.1 0-60 26.9-60 60v552c0 33.1 26.9 60 60 60h776c33.1 0 60-26.9 60-60V236c0-33.1-26.9-60-60-60z" />
|
||||
</StackPanel>
|
||||
</local:MyCard>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
End Sub
|
||||
|
||||
Public ItemVersion As MyListItem
|
||||
Private SelectedEntries As New List(Of String)
|
||||
Public Sub Reload()
|
||||
AniControlEnabled += 1
|
||||
|
||||
@@ -16,12 +17,56 @@
|
||||
PanDisplayItem.Children.Add(ItemVersion)
|
||||
ItemVersion.Title = If(String.IsNullOrWhiteSpace(TbExportName.Text), PageVersionLeft.Version.Name, TbExportName.Text)
|
||||
ItemVersion.Info = If(String.IsNullOrWhiteSpace(TbExportDesc.Text), PageVersionLeft.Version.Info, TbExportDesc.Text)
|
||||
#If BETA Then
|
||||
CheckIncludePCL.IsEnabled = True
|
||||
#Else
|
||||
CheckIncludePCL.IsEnabled = False
|
||||
TbHint.Text = "你可以在此勾选需要包含进整合包的文件或文件夹,其他文件或文件夹在高级选项添加。" & vbCrLf & "你当前的 PCL 不是正式版,有二次分发的限制,因此不能选择是否包含 PCL 程序。"
|
||||
#End If
|
||||
CheckIncludeSetup.IsEnabled = CheckIncludePCL.IsEnabled
|
||||
ReloadFileList()
|
||||
|
||||
AniControlEnabled -= 1
|
||||
End Sub
|
||||
Private Sub ReloadFileList()
|
||||
Dim tb As TextBlock = PanFileList.Children(0)
|
||||
PanFileList.Children.Clear()
|
||||
PanFileList.Children.Add(tb)
|
||||
|
||||
Private Type As ModpackType = ModpackType.Modrinth
|
||||
Private SelectedSaves As New List(Of Integer)
|
||||
For Each d In Directory.EnumerateDirectories(PageVersionLeft.Version.Path)
|
||||
If Directory.EnumerateFileSystemEntries(d).Count = 0 Then Continue For
|
||||
d = GetFolderNameFromPath(d)
|
||||
If IsVerRedundant(d) Then Continue For
|
||||
Dim title As String = ""
|
||||
Dim listItem As New MyListItem
|
||||
If Titles.TryGetValue(d, title) Then 'title 作为引用类型传入
|
||||
listItem.Title = title
|
||||
listItem.Info = d
|
||||
Else
|
||||
listItem.Title = d
|
||||
End If
|
||||
'图标按钮
|
||||
Dim btnSwap As New MyIconButton
|
||||
btnSwap.Path = New Shapes.Path With {.HorizontalAlignment = HorizontalAlignment.Right, .Stretch = Stretch.Uniform, .Height = 6, .Width = 10, .VerticalAlignment = VerticalAlignment.Top, .Margin = New Thickness(0, 17, 16, 0), .Data = New GeometryConverter().ConvertFromString("M2,4 l-2,2 10,10 10,-10 -2,-2 -8,8 -8,-8 z"), .RenderTransform = New RotateTransform(180), .RenderTransformOrigin = New Point(0.5, 0.5)}
|
||||
AddHandler btnSwap.Click, AddressOf BtnSwap_Click
|
||||
listItem.Buttons = {btnSwap}
|
||||
listItem.Type = MyListItem.CheckType.CheckBox
|
||||
listItem.Height = 35
|
||||
listItem.Logo = Logo.IconButtonOpen
|
||||
PanFileList.Children.Add(listItem)
|
||||
Next
|
||||
End Sub
|
||||
Private Titles As New Dictionary(Of String, String) From {
|
||||
{"saves", "存档"},
|
||||
{"resourcepacks", "资源包"},
|
||||
{"config", "Mod 配置"},
|
||||
{"shaderpacks", "光影包"},
|
||||
{"options.txt", "游戏配置"},
|
||||
{"servers.dat", "服务器列表"}
|
||||
}
|
||||
Private Sub BtnSwap_Click(sender As MyIconButton, e As Object)
|
||||
MsgBox("测试") 'TODO:处理展开操作
|
||||
End Sub
|
||||
Private ReadOnly Property Saves As List(Of String)
|
||||
Get
|
||||
If Directory.Exists(PageVersionLeft.Version.Path & "saves\") Then
|
||||
@@ -69,10 +114,13 @@
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "基本信息"
|
||||
Private Sub CheckIncludePCL_Change(sender As Object, user As Boolean) Handles CheckIncludePCL.Change
|
||||
CheckIncludeSetup.IsEnabled = CheckIncludePCL.IsEnabled
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "导出"
|
||||
Private Function IncludePCL() As Boolean
|
||||
Return True
|
||||
End Function
|
||||
'Private Sub ComboExportType_Change(sender As ComboBox, e As SelectionChangedEventArgs) Handles ComboExportType.SelectionChanged
|
||||
' If AniControlEnabled <> 0 Then Exit Sub
|
||||
' Type = sender.SelectedIndex
|
||||
@@ -89,20 +137,19 @@
|
||||
' CardExport.TriggerForceResize()
|
||||
'End Sub
|
||||
Private Sub BtnExportExport_Click() Handles BtnExportExport.Click
|
||||
If IncludePCL() 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 contains As New List(Of String)
|
||||
For Each c In PanFiles.Children
|
||||
If TypeOf c IsNot MyCheckBox Then Continue For
|
||||
If String.IsNullOrEmpty(c.Tag) Then Continue For
|
||||
contains.Add(c.Tag)
|
||||
Next
|
||||
Dim savePath As String = SelectAs(
|
||||
"选择导出位置", $"整合包 - {If(String.IsNullOrWhiteSpace(TbExportName.Text), PageVersionLeft.Version.Name, TbExportName.Text)}" & If(Type = ModpackType.Modrinth, ".mrpack", ".zip"),
|
||||
If(Type = ModpackType.Modrinth, "Modrinth 整合包(*.mrpack)|*.mrpack", "整合包文件(*.zip)|*.zip"))
|
||||
"选择导出位置", $"整合包 - {If(String.IsNullOrWhiteSpace(TbExportName.Text), PageVersionLeft.Version.Name, TbExportName.Text)}" & If(CheckIncludePCL.Checked, ".zip", ".mrpack"),
|
||||
If(CheckIncludePCL.Checked, "整合包文件(*.zip)|*.zip", "Modrinth 整合包(*.mrpack)|*.mrpack"))
|
||||
If String.IsNullOrEmpty(savePath) Then Exit Sub
|
||||
ModpackExport(New ExportOptions(PageVersionLeft.Version, savePath, Type, {}, 'TODO:改成要保留的文件列表
|
||||
Name:=TbExportName.Text, VerID:=TbExportVersion.Text))
|
||||
ModpackExport(New ExportOptions(PageVersionLeft.Version, savePath, CheckIncludePCL.Checked, {}, 'TODO:改成要保留的文件列表
|
||||
PCLSetupGlobal:=CheckIncludeSetup.Checked, Name:=TbExportName.Text, VerID:=TbExportVersion.Text))
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Reference in New Issue
Block a user