修改了导出整合包UI
This commit is contained in:
@@ -7,7 +7,13 @@
|
|||||||
PanScroll="{Binding ElementName=PanBack}">
|
PanScroll="{Binding ElementName=PanBack}">
|
||||||
<local:MyScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
<local:MyScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||||
<StackPanel Margin="25,10">
|
<StackPanel Margin="25,10">
|
||||||
<local:MyCard x:Name="CardExport" Margin="0,20,0,15" Title="导出选项">
|
|
||||||
|
<local:MyCard Margin="0,15" Title="">
|
||||||
|
<Grid Margin="10,7" Name="PanDisplayItem" />
|
||||||
|
<TextBlock TextWrapping="Wrap" Margin="0,0,0,4" Text="空白填充" />
|
||||||
|
</local:MyCard>
|
||||||
|
|
||||||
|
<local:MyCard x:Name="CardExport" Margin="0,0,0,15" Title="整合包信息">
|
||||||
<StackPanel Margin="25,40,25,21">
|
<StackPanel Margin="25,40,25,21">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -20,49 +26,73 @@
|
|||||||
<RowDefinition Height="9" />
|
<RowDefinition Height="9" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="9" />
|
<RowDefinition Height="9" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="9" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock Grid.Column="0" Grid.Row="0" Text="整合包类型" VerticalAlignment="Center" />
|
<TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Text="整合包名称" Margin="0,0,25,0" />
|
||||||
<local:MyComboBox x:Name="ComboExportType" Margin="10,0,0,0" Grid.Column="1" Grid.Row="0">
|
<local:MyTextBox Grid.Row="0" x:Name="TbExportName" Grid.ColumnSpan="2" Tag="VersionArgumentTitle" Grid.Column="1" MaxLength="100" />
|
||||||
<local:MyComboBoxItem Content="压缩包" IsSelected="True" />
|
<TextBlock Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Text="图标" Margin="0,0,25,0" />
|
||||||
<local:MyComboBoxItem Content="Modrinth" />
|
<local:MyComboBox Grid.Row="2" Grid.ColumnSpan="2" Grid.Column="1">
|
||||||
|
<local:MyComboBoxItem Content="自动" IsSelected="True" Tag="" />
|
||||||
|
<!-- 此处需要添加一个自定义图标 -->
|
||||||
|
<local:MyComboBoxItem Content="自定义..." />
|
||||||
|
<!--x:Name="ItemDisplayLogoCustom"-->
|
||||||
|
<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/GoldBlock.png" />
|
||||||
|
<local:MyComboBoxItem Content="草方块" Tag="pack://application:,,,/images/Blocks/Grass.png" />
|
||||||
|
<local:MyComboBoxItem Content="草径" Tag="pack://application:,,,/images/Blocks/GrassPath.png" />
|
||||||
|
<local:MyComboBoxItem Content="铁砧" Tag="pack://application:,,,/images/Blocks/Anvil.png" />
|
||||||
|
<local:MyComboBoxItem Content="红石块" Tag="pack://application:,,,/images/Blocks/RedstoneBlock.png" />
|
||||||
|
<local:MyComboBoxItem Content="红石灯(开)" Tag="pack://application:,,,/images/Blocks/RedstoneLampOn.png" />
|
||||||
|
<local:MyComboBoxItem Content="红石灯(关)" Tag="pack://application:,,,/images/Blocks/RedstoneLampOff.png" />
|
||||||
|
<local:MyComboBoxItem Content="鸡蛋" Tag="pack://application:,,,/images/Blocks/Egg.png" />
|
||||||
|
<local:MyComboBoxItem Content="布料(Fabric)" Tag="pack://application:,,,/images/Blocks/Fabric.png" />
|
||||||
|
<local:MyComboBoxItem Content="狐狸(NeoForge)" Tag="pack://application:,,,/images/Blocks/NeoForge.png" />
|
||||||
</local:MyComboBox>
|
</local:MyComboBox>
|
||||||
<TextBlock Grid.Column="0" Grid.Row="2" Text="包含存档" VerticalAlignment="Center" />
|
<TextBlock Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" Text="整合包版本" Margin="0,0,25,0" />
|
||||||
<local:MyTextBox x:Name="TbExportSave" HintText="不包含存档" ToolTip="在此处填写存档目录名,可以将存档包含在整合包内,留空则不包含存档。" Margin="10,0,0,0" Grid.Column="1" Grid.Row="2" Tag="1" />
|
<local:MyTextBox Grid.Row="4" x:Name="TbExportVersion" HintText="1.0.0" Grid.ColumnSpan="2" Tag="VersionArgumentTitle" Grid.Column="1" MaxLength="100" />
|
||||||
</Grid>
|
|
||||||
<Grid x:Name="GridCompressed">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Name" />
|
|
||||||
<ColumnDefinition Width="20" />
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="9" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<local:MyCheckBox x:Name="CheckExportGlobal" Text="导出 PCL 全局设置" Grid.Column="0" Grid.Row="0" Checked="True" />
|
|
||||||
<local:MyCheckBox x:Name="CheckExportVersion" Text="导出 PCL 版本设置" Grid.Column="2" Grid.Row="0" Checked="True" />
|
|
||||||
</Grid>
|
|
||||||
<Grid x:Name="GridModrinth" Visibility="Collapsed">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Name" />
|
|
||||||
<ColumnDefinition Width="10" />
|
|
||||||
<ColumnDefinition Width="1*" />
|
|
||||||
<ColumnDefinition Width="60" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="9" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="9" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Text="整合包名称" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" />
|
|
||||||
<local:MyTextBox x:Name="TbExportName" HintText="" Grid.Column="2" Grid.Row="0" />
|
|
||||||
<TextBlock Text="整合包版本" Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" />
|
|
||||||
<local:MyTextBox x:Name="TbExportVersion" HintText="1.0.0" Grid.Column="2" Grid.Row="2" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<local:MyButton x:Name="BtnExportExport" HorizontalAlignment="Left" Text="导出整合包" Height="35" Width="150" ColorType="Highlight" />
|
<local:MyButton x:Name="BtnExportExport" HorizontalAlignment="Left" Text="导出整合包" Height="35" Width="150" ColorType="Highlight" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</local:MyCard>
|
</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>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="18" />
|
||||||
|
<ColumnDefinition Width="1.0*" />
|
||||||
|
<ColumnDefinition Width="1.2*" />
|
||||||
|
<ColumnDefinition Width="1.0*" />
|
||||||
|
<ColumnDefinition Width="1.0*" />
|
||||||
|
<ColumnDefinition Width="1.0*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="4" />
|
||||||
|
<RowDefinition Height="30" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="2" Text="包含启动器" />
|
||||||
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="1" Grid.Column="3" Text="启动器全局配置" />
|
||||||
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="2" Text="配置" />
|
||||||
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="3" Text="存档" />
|
||||||
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="4" Text="材质包" />
|
||||||
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="5" Text="光影包" />
|
||||||
|
<local:MyCheckBox Height="22" VerticalAlignment="Center" Grid.Row="2" Grid.Column="6" Text="光影配置" />
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</local:MyCard>
|
||||||
|
<local:MyCard Title="高级选项" Margin="0,0,0,15" CanSwap="True" IsSwaped="True">
|
||||||
|
<StackPanel Margin="25,40,23,15">
|
||||||
|
<TextBlock TextWrapping="Wrap" Margin="0,0,0,4"
|
||||||
|
Text="空白填充" />
|
||||||
|
</StackPanel>
|
||||||
|
</local:MyCard>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</local:MyScrollViewer>
|
</local:MyScrollViewer>
|
||||||
</local:MyPageRight>
|
</local:MyPageRight>
|
||||||
|
|||||||
@@ -18,38 +18,9 @@
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "控件事件"
|
#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
|
#End Region
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user