🐛 修复问题
This commit is contained in:
@@ -919,7 +919,8 @@ Retry:
|
|||||||
''' </summary>
|
''' </summary>
|
||||||
Public Sub ModpackExport(Options As ExportOptions)
|
Public Sub ModpackExport(Options As ExportOptions)
|
||||||
Hint("正在导出……")
|
Hint("正在导出……")
|
||||||
RunInNewThread(Sub()
|
RunInNewThread(
|
||||||
|
Sub()
|
||||||
If ModpackExportBlocking(Options) Then
|
If ModpackExportBlocking(Options) Then
|
||||||
Hint("导出成功!", HintType.Finish)
|
Hint("导出成功!", HintType.Finish)
|
||||||
OpenExplorer($"""{GetPathFromFullPath(Options.Dest)}""")
|
OpenExplorer($"""{GetPathFromFullPath(Options.Dest)}""")
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
<StackPanel Margin="25,10">
|
<StackPanel Margin="25,10">
|
||||||
|
|
||||||
<local:MyCard Margin="0,15" Title="">
|
<local:MyCard Margin="0,15" Title="">
|
||||||
<Grid Margin="10,7" Name="PanDisplayItem" />
|
<Grid Margin="10,7,10,7" Name="PanDisplayItem" />
|
||||||
<TextBlock TextWrapping="Wrap" Margin="0,0,0,4" Text="空白填充" />
|
<local:MyButton x:Name="BtnExportExport" Margin="0,0,10,0" HorizontalAlignment="Right" Text="导出整合包" Height="35" Width="150" ColorType="Highlight" />
|
||||||
</local:MyCard>
|
</local:MyCard>
|
||||||
|
|
||||||
<local:MyCard x:Name="CardExport" Margin="0,0,0,15" Title="整合包信息">
|
<local:MyCard x:Name="CardExport" Margin="0,0,0,15" Title="整合包信息">
|
||||||
@@ -33,11 +33,10 @@
|
|||||||
<TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Text="整合包名称" Margin="0,0,25,0" />
|
<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" Tag="VersionArgumentTitle" Grid.Column="1" MaxLength="100" />
|
<local:MyTextBox Grid.Row="0" x:Name="TbExportName" Grid.ColumnSpan="2" Tag="VersionArgumentTitle" Grid.Column="1" MaxLength="100" />
|
||||||
<TextBlock Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Text="图标" Margin="0,0,25,0" />
|
<TextBlock Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Text="图标" Margin="0,0,25,0" />
|
||||||
<local:MyComboBox Grid.Row="2" Grid.ColumnSpan="2" Grid.Column="1">
|
<local:MyComboBox x:Name="ItemDisplayLogoCustom" Grid.Row="2" Grid.ColumnSpan="2" Grid.Column="1">
|
||||||
<local:MyComboBoxItem Content="自动" IsSelected="True" Tag="" />
|
<local:MyComboBoxItem Content="自动" IsSelected="True" Tag="" />
|
||||||
<!-- 此处需要添加一个自定义图标 -->
|
<!-- 此处需要添加一个自定义图标 -->
|
||||||
<local:MyComboBoxItem Content="自定义..." />
|
<local:MyComboBoxItem Content="自定义..." />
|
||||||
<!--x:Name="ItemDisplayLogoCustom"-->
|
|
||||||
<local:MyComboBoxItem Content="圆石" Tag="pack://application:,,,/images/Blocks/CobbleStone.png" />
|
<local:MyComboBoxItem Content="圆石" Tag="pack://application:,,,/images/Blocks/CobbleStone.png" />
|
||||||
<local:MyComboBoxItem Content="命令方块" Tag="pack://application:,,,/images/Blocks/CommandBlock.png" />
|
<local:MyComboBoxItem Content="命令方块" Tag="pack://application:,,,/images/Blocks/CommandBlock.png" />
|
||||||
<local:MyComboBoxItem Content="金块" Tag="pack://application:,,,/images/Blocks/GoldBlock.png" />
|
<local:MyComboBoxItem Content="金块" Tag="pack://application:,,,/images/Blocks/GoldBlock.png" />
|
||||||
@@ -54,14 +53,12 @@
|
|||||||
<TextBlock Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" Text="整合包版本" Margin="0,0,25,0" />
|
<TextBlock Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" Text="整合包版本" Margin="0,0,25,0" />
|
||||||
<local:MyTextBox Grid.Row="4" x:Name="TbExportVersion" HintText="1.0.0" Grid.ColumnSpan="2" Tag="VersionArgumentTitle" Grid.Column="1" MaxLength="100" />
|
<local:MyTextBox Grid.Row="4" x:Name="TbExportVersion" HintText="1.0.0" Grid.ColumnSpan="2" Tag="VersionArgumentTitle" Grid.Column="1" MaxLength="100" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<local:MyButton x:Name="BtnExportExport" HorizontalAlignment="Left" Text="导出整合包" Height="35" Width="150" ColorType="Highlight" />
|
|
||||||
<local:MyListItem Title="游戏存档" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</local:MyCard>
|
</local:MyCard>
|
||||||
|
|
||||||
<local:MyCard x:Name="CardSwitch" Margin="0,0,0,15" Title="基础选项">
|
<local:MyCard x:Name="CardSwitch" Margin="0,0,0,15" Title="基础选项">
|
||||||
<StackPanel Margin="25,38,15,15">
|
<StackPanel Margin="25,38,15,15">
|
||||||
<TextBlock Margin="0,1,0,1" Text="你可以在此勾选需要包含进整合包的文件或者文件夹,其他文件或者文件夹在高级选项添加。" TextWrapping="Wrap" />
|
<TextBlock Margin="0,1,0,1" Text="你可以在此勾选需要包含进整合包的文件或文件夹,其他文件或文件夹在高级选项添加。" TextWrapping="Wrap" />
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
@@ -77,31 +74,36 @@
|
|||||||
<RowDefinition Height="4" />
|
<RowDefinition Height="4" />
|
||||||
<RowDefinition Height="30" />
|
<RowDefinition Height="30" />
|
||||||
<RowDefinition Height="30" />
|
<RowDefinition Height="30" />
|
||||||
|
<RowDefinition Height="30" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="2" Text="服务器文件"
|
<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 文件" />
|
ToolTip="server.dat 文件" />
|
||||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="3" Text="模组配置"
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="3" Text="Mod 配置"
|
||||||
ToolTip="config 文件夹" />
|
ToolTip="config 文件夹" />
|
||||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="4" Text="游戏配置"
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="4" Text="游戏配置"
|
||||||
ToolTip="options.txt 文件" />
|
ToolTip="options.txt 文件" />
|
||||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="5" Text="存档"
|
<TextBlock Text="游戏文件" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" />
|
||||||
ToolTip="默认包含整个存档文件夹"/>
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="2" Text="存档"
|
||||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="6" Text="材质包"
|
ToolTip="saves 文件夹" />
|
||||||
ToolTip="默认包含整个材质包文件夹"/>
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="3" Text="材质包"
|
||||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="7" Text="光影包"
|
ToolTip="resourcepacks 文件夹" />
|
||||||
ToolTip="默认包含整个光影包文件夹"/>
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="4" Text="光影包"
|
||||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="2" Text="包含启动器"
|
ToolTip="shaderpacks 文件夹" />
|
||||||
ToolTip="勾选将pcl2包含在整合包内"/>
|
<TextBlock Text="PCL 配置" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" />
|
||||||
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="3" Text="启动器全局配置"
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="3" Grid.Column="2" Text="包含启动器"
|
||||||
ToolTip="勾选将启动器的全局配置包含在整合包内"/>
|
ToolTip="将 PCL 程序包含在整合包内" />
|
||||||
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="3" Grid.Column="3" Text="PCL 全局配置"
|
||||||
|
ToolTip="将 PCL 全局配置包含在整合包内" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</local:MyCard>
|
</local:MyCard>
|
||||||
<local:MyCard Title="高级选项" Margin="0,0,0,15" CanSwap="True" IsSwaped="True">
|
<local:MyCard Title="高级选项" Margin="0,0,0,15" CanSwap="True" IsSwaped="True">
|
||||||
<StackPanel Margin="25,40,23,15">
|
<StackPanel x:Name="PanFileList" Margin="25,40,23,15">
|
||||||
<TextBlock TextWrapping="Wrap" Margin="0,0,0,4" Text="空白填充" />
|
<local:MyListItem Type="CheckBox" Title="游戏存档" Height="35" />
|
||||||
|
<local:MyListItem Type="CheckBox" Title="游戏存档" Height="35" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</local:MyCard>
|
</local:MyCard>
|
||||||
|
|
||||||
|
|||||||
@@ -1,42 +1,53 @@
|
|||||||
Public Class PageVersionExport
|
Public Class PageVersionExport
|
||||||
|
Private Sub PageVersionExport_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
TbExportName.HintText = PageVersionLeft.Version.Name
|
||||||
|
Reload()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public ItemVersion As MyListItem
|
||||||
|
Public Sub Reload()
|
||||||
|
PanDisplayItem.Children.Clear()
|
||||||
|
ItemVersion = PageSelectRight.McVersionListItem(PageVersionLeft.Version)
|
||||||
|
ItemVersion.IsHitTestVisible = False
|
||||||
|
PanDisplayItem.Children.Add(ItemVersion)
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private CurrentVersion As McVersion = PageVersionLeft.Version
|
|
||||||
Private Type As ModpackType = ModpackType.Modrinth
|
Private Type As ModpackType = ModpackType.Modrinth
|
||||||
Private SelectedSaves As New List(Of Integer)
|
Private SelectedSaves As New List(Of Integer)
|
||||||
Private ReadOnly Property Saves As List(Of String)
|
Private ReadOnly Property Saves As List(Of String)
|
||||||
Get
|
Get
|
||||||
If Directory.Exists(CurrentVersion.Path & "saves\") Then
|
If Directory.Exists(PageVersionLeft.Version.Path & "saves\") Then
|
||||||
Return Directory.EnumerateDirectories(CurrentVersion.Path & "saves\").ToList
|
Return Directory.EnumerateDirectories(PageVersionLeft.Version.Path & "saves\").ToList
|
||||||
End If
|
End If
|
||||||
Return New List(Of String)
|
Return New List(Of String)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Sub PageVersionExport_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
#Region "整合包信息 & 预览栏"
|
||||||
CurrentVersion = PageVersionLeft.Version '各个版本不同,每次都需要重新加载
|
Private Sub TbExportName_TextChanged(sender As MyTextBox, e As TextChangedEventArgs) Handles TbExportName.TextChanged
|
||||||
TbExportName.HintText = CurrentVersion.Name
|
ItemVersion.Title = If(String.IsNullOrWhiteSpace(sender.Text), PageVersionLeft.Version.Name, sender.Text)
|
||||||
End Sub
|
End Sub
|
||||||
|
#End Region
|
||||||
|
|
||||||
#Region "控件事件"
|
#Region "导出"
|
||||||
Private Function IncludePCL() As Boolean
|
Private Function IncludePCL() As Boolean
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
Private Sub ComboExportType_Change(sender As ComboBox, e As SelectionChangedEventArgs) Handles ComboExportType.SelectionChanged
|
'Private Sub ComboExportType_Change(sender As ComboBox, e As SelectionChangedEventArgs) Handles ComboExportType.SelectionChanged
|
||||||
If AniControlEnabled <> 0 Then Exit Sub
|
' If AniControlEnabled <> 0 Then Exit Sub
|
||||||
Type = sender.SelectedIndex
|
' Type = sender.SelectedIndex
|
||||||
Select Case Type
|
' Select Case Type
|
||||||
Case ModpackType.Modrinth
|
' Case ModpackType.Modrinth
|
||||||
If IncludePCL() Then 'TODO:修改这里的条件
|
' If IncludePCL() Then 'TODO:修改这里的条件
|
||||||
If GridCompressed IsNot Nothing Then GridCompressed.Visibility = Visibility.Visible
|
' If GridCompressed IsNot Nothing Then GridCompressed.Visibility = Visibility.Visible
|
||||||
If GridModrinth IsNot Nothing Then GridModrinth.Visibility = Visibility.Collapsed
|
' If GridModrinth IsNot Nothing Then GridModrinth.Visibility = Visibility.Collapsed
|
||||||
Else
|
' Else
|
||||||
If GridCompressed IsNot Nothing Then GridCompressed.Visibility = Visibility.Collapsed
|
' If GridCompressed IsNot Nothing Then GridCompressed.Visibility = Visibility.Collapsed
|
||||||
If GridModrinth IsNot Nothing Then GridModrinth.Visibility = Visibility.Visible
|
' If GridModrinth IsNot Nothing Then GridModrinth.Visibility = Visibility.Visible
|
||||||
End If
|
' End If
|
||||||
End Select
|
' End Select
|
||||||
CardExport.TriggerForceResize()
|
' CardExport.TriggerForceResize()
|
||||||
End Sub
|
'End Sub
|
||||||
If GridModrinth IsNot Nothing Then GridModrinth.Visibility = Visibility.Visible
|
|
||||||
Private Sub BtnExportExport_Click() Handles BtnExportExport.Click
|
Private Sub BtnExportExport_Click() Handles BtnExportExport.Click
|
||||||
If IncludePCL() AndAlso Val(VersionBranchCode) <> 50 Then
|
If IncludePCL() AndAlso Val(VersionBranchCode) <> 50 Then
|
||||||
If MyMsgBox("你当前的 PCL 不是正式版,有二次分发(制作压缩包)的限制。" & vbCrLf &
|
If MyMsgBox("你当前的 PCL 不是正式版,有二次分发(制作压缩包)的限制。" & vbCrLf &
|
||||||
@@ -47,17 +58,11 @@
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
Dim savePath As String = SelectAs(
|
Dim savePath As String = SelectAs(
|
||||||
"选择导出位置", $"整合包 - {If(String.IsNullOrWhiteSpace(TbExportName.Text), CurrentVersion.Name, TbExportName.Text)}" & If(Type = ModpackType.Modrinth, ".mrpack", ".zip"),
|
"选择导出位置", $"整合包 - {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(Type = ModpackType.Modrinth, "Modrinth 整合包(*.mrpack)|*.mrpack", "整合包文件(*.zip)|*.zip"))
|
||||||
If String.IsNullOrEmpty(savePath) Then Exit Sub
|
If String.IsNullOrEmpty(savePath) Then Exit Sub
|
||||||
ModpackExport(New ExportOptions(CurrentVersion, savePath, Type, {TbExportSave.Text},
|
ModpackExport(New ExportOptions(PageVersionLeft.Version, savePath, Type, {}, 'TODO:改成要保留的文件列表
|
||||||
PCLSetupGlobal:=CheckExportGlobal.Checked, Name:=TbExportName.Text,
|
Name:=TbExportName.Text, VerID:=TbExportVersion.Text))
|
||||||
VerID:=TbExportVersion.Text))
|
|
||||||
End Sub
|
|
||||||
ModpackExport(New ExportOptions(CurrentVersion, savePath, Type, {TbExportSave.Text},
|
|
||||||
PCLSetupGlobal:=CheckExportGlobal.Checked,
|
|
||||||
PCLSetupVer:=CheckExportVersion.Checked, Name:=TbExportName.Text,
|
|
||||||
VerID:=TbExportVersion.Text))
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|||||||
Reference in New Issue
Block a user