🚧 添加整合包描述的设置

This commit is contained in:
youzi-2333
2024-07-16 13:18:41 +08:00
parent aacaf792ef
commit 4547b81d68
3 changed files with 24 additions and 15 deletions
@@ -886,15 +886,19 @@ Retry:
''' </summary> ''' </summary>
Public Remain As String() Public Remain As String()
''' <summary> ''' <summary>
''' 是否需要保留 PCL 全局设置。仅在压缩包中有效。 ''' 是否需要保留 PCL 全局设置。仅在包括 PCL 时有效。
''' </summary> ''' </summary>
Public PCLSetupGlobal As Boolean = True Public PCLSetupGlobal As Boolean = True
''' <summary> ''' <summary>
''' 整合包名称。仅在 Modrinth 有效。 ''' 整合包名称。
''' </summary> ''' </summary>
Public Name As String = "" Public Name As String = ""
''' <summary> ''' <summary>
''' 版本号。仅在 Modrinth 有效。 ''' 整合包描述。
''' </summary>
Public Desc As String = ""
''' <summary>
''' 版本号。
''' </summary> ''' </summary>
Public VerID As String = "" Public VerID As String = ""
Public Sub New(Version As McVersion, Public Sub New(Version As McVersion,
@@ -903,7 +907,7 @@ Retry:
Remain As String(), Remain As String(),
Optional PCLSetupGlobal As Boolean = True, Optional PCLSetupGlobal As Boolean = True,
Optional Name As String = "", Optional Name As String = "",
Optional Author As String = "", Optional Desc As String = "",
Optional VerID As String = "") Optional VerID As String = "")
Me.Version = Version Me.Version = Version
Me.Dest = Dest Me.Dest = Dest
@@ -911,6 +915,7 @@ Retry:
Me.Remain = Remain Me.Remain = Remain
Me.PCLSetupGlobal = PCLSetupGlobal Me.PCLSetupGlobal = PCLSetupGlobal
Me.Name = Name Me.Name = Name
Me.Desc = Desc
Me.VerID = VerID Me.VerID = VerID
End Sub End Sub
End Class End Class
@@ -28,14 +28,15 @@
<RowDefinition Height="9" /> <RowDefinition Height="9" />
<RowDefinition Height="28" /> <RowDefinition Height="28" />
<RowDefinition Height="9" /> <RowDefinition Height="9" />
<RowDefinition Height="6" /> <RowDefinition Height="28" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<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" 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 x:Name="ComboDisplayLogo" Grid.Row="2" Grid.ColumnSpan="2" Grid.Column="1"> <local:MyTextBox Grid.Row="2" x:Name="TbExportDesc" Grid.ColumnSpan="2" Grid.Column="1" MaxLength="100" />
<TextBlock Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" Text="图标" Margin="0,0,25,0" />
<local:MyComboBox x:Name="ComboDisplayLogo" Grid.Row="4" Grid.ColumnSpan="2" Grid.Column="1">
<local:MyComboBoxItem Content="自动" IsSelected="True" Tag="" /> <local:MyComboBoxItem Content="自动" IsSelected="True" Tag="" />
<!-- 此处需要添加一个自定义图标 -->
<local:MyComboBoxItem x:Name="ItemDisplayLogoCustom" Content="自定义..." /> <local:MyComboBoxItem x:Name="ItemDisplayLogoCustom" Content="自定义..." />
<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" />
@@ -50,8 +51,8 @@
<local:MyComboBoxItem Content="布料(Fabric)" Tag="pack://application:,,,/images/Blocks/Fabric.png" /> <local:MyComboBoxItem Content="布料(Fabric)" Tag="pack://application:,,,/images/Blocks/Fabric.png" />
<local:MyComboBoxItem Content="狐狸(NeoForge)" Tag="pack://application:,,,/images/Blocks/NeoForge.png" /> <local:MyComboBoxItem Content="狐狸(NeoForge)" Tag="pack://application:,,,/images/Blocks/NeoForge.png" />
</local:MyComboBox> </local:MyComboBox>
<TextBlock Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" Text="整合包版本" Margin="0,0,25,0" /> <TextBlock Grid.Row="6" 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="6" x:Name="TbExportVersion" HintText="1.0.0" Grid.ColumnSpan="2" Tag="VersionArgumentTitle" Grid.Column="1" MaxLength="100" />
</Grid> </Grid>
</StackPanel> </StackPanel>
</local:MyCard> </local:MyCard>
@@ -1,8 +1,5 @@
Imports System.Runtime.CompilerServices Public Class PageVersionExport
Public Class PageVersionExport
Private Sub PageVersionExport_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded Private Sub PageVersionExport_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
TbExportName.HintText = PageVersionLeft.Version.Name
Reload() Reload()
End Sub End Sub
@@ -10,6 +7,8 @@ Public Class PageVersionExport
Public Sub Reload() Public Sub Reload()
AniControlEnabled += 1 AniControlEnabled += 1
TbExportName.HintText = PageVersionLeft.Version.Name
TbExportDesc.HintText = PageVersionLeft.Version.Info
PanDisplayItem.Children.Clear() PanDisplayItem.Children.Clear()
ItemVersion = PageSelectRight.McVersionListItem(PageVersionLeft.Version.Load()) ItemVersion = PageSelectRight.McVersionListItem(PageVersionLeft.Version.Load())
ItemVersion.IsHitTestVisible = False ItemVersion.IsHitTestVisible = False
@@ -38,6 +37,10 @@ Public Class PageVersionExport
ItemVersion.Title = If(String.IsNullOrWhiteSpace(sender.Text), PageVersionLeft.Version.Name, sender.Text) ItemVersion.Title = If(String.IsNullOrWhiteSpace(sender.Text), PageVersionLeft.Version.Name, sender.Text)
End Sub End Sub
Private Sub TbExportDesc_TextChanged(sender As MyTextBox, e As TextChangedEventArgs) Handles TbExportDesc.TextChanged
ItemVersion.Info = If(String.IsNullOrWhiteSpace(sender.Text), PageVersionLeft.Version.Info, sender.Text)
End Sub
Private CustomLogoVal As String Private CustomLogoVal As String
''' <summary> ''' <summary>
''' 自定义 Logo 的路径。 ''' 自定义 Logo 的路径。