🐛 修复一些问题
This commit is contained in:
@@ -314,6 +314,7 @@ End Class
|
|||||||
Public Class ValidateFolderPath
|
Public Class ValidateFolderPath
|
||||||
Inherits Validate
|
Inherits Validate
|
||||||
Public Property UseMinecraftCharCheck As Boolean = True
|
Public Property UseMinecraftCharCheck As Boolean = True
|
||||||
|
Public Property AllowNull As Boolean = False
|
||||||
Public Sub New()
|
Public Sub New()
|
||||||
End Sub
|
End Sub
|
||||||
Public Sub New(UseMinecraftCharCheck As Boolean)
|
Public Sub New(UseMinecraftCharCheck As Boolean)
|
||||||
@@ -325,9 +326,9 @@ Public Class ValidateFolderPath
|
|||||||
If Not Str.TrimEnd("\").EndsWithF(":") Then Str = Str.TrimEnd("\")
|
If Not Str.TrimEnd("\").EndsWithF(":") Then Str = Str.TrimEnd("\")
|
||||||
'检查是否为空
|
'检查是否为空
|
||||||
Dim LengthCheck As String = New ValidateNullOrWhiteSpace().Validate(Str)
|
Dim LengthCheck As String = New ValidateNullOrWhiteSpace().Validate(Str)
|
||||||
If Not LengthCheck = "" Then Return LengthCheck
|
If Not AllowNull AndAlso Not LengthCheck = "" Then Return LengthCheck
|
||||||
'检查长度
|
'检查长度
|
||||||
LengthCheck = New ValidateLength(1, 254).Validate(Str)
|
LengthCheck = New ValidateLength(If(AllowNull, 0, 1), 254).Validate(Str)
|
||||||
If Not LengthCheck = "" Then Return LengthCheck
|
If Not LengthCheck = "" Then Return LengthCheck
|
||||||
'检查开头
|
'检查开头
|
||||||
If Str.StartsWithF("\\Mac\") Then GoTo Fin
|
If Str.StartsWithF("\\Mac\") Then GoTo Fin
|
||||||
|
|||||||
@@ -987,9 +987,11 @@ Retry:
|
|||||||
|
|
||||||
'步骤 1:从 Modrinth 获取 Mod 工程信息,得到 URL
|
'步骤 1:从 Modrinth 获取 Mod 工程信息,得到 URL
|
||||||
Dim Mods As New List(Of McMod)
|
Dim Mods As New List(Of McMod)
|
||||||
For Each m In Directory.EnumerateFiles(Version.Path & "mods\")
|
If Directory.Exists(Version.Path & "mods\") Then
|
||||||
If m.EndsWithF(".jar") Then Mods.Add(New McMod(m))
|
For Each m In Directory.EnumerateFiles(Version.Path & "mods\")
|
||||||
Next
|
If m.EndsWithF(".jar") Then Mods.Add(New McMod(m))
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
'从 Modrinth 获取信息
|
'从 Modrinth 获取信息
|
||||||
Dim ModrinthHashes = Mods.Select(Function(m) m.ModrinthHash).ToList()
|
Dim ModrinthHashes = Mods.Select(Function(m) m.ModrinthHash).ToList()
|
||||||
|
|||||||
@@ -38,11 +38,7 @@
|
|||||||
<RowDefinition Height="28" />
|
<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" Grid.Column="1" MaxLength="100">
|
<local:MyTextBox Grid.Row="0" x:Name="TbExportName" Grid.ColumnSpan="2" Grid.Column="1" MaxLength="100" ShowValidateResult="True" />
|
||||||
<local:MyTextBox.ValidateRules>
|
|
||||||
<local:ValidateFileName AllowNull="True" />
|
|
||||||
</local:MyTextBox.ValidateRules>
|
|
||||||
</local:MyTextBox>
|
|
||||||
<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:MyTextBox Grid.Row="2" x:Name="TbExportVersion" HintText="1.0.0" Grid.ColumnSpan="2" Tag="VersionArgumentTitle" Grid.Column="1" MaxLength="100" />
|
<local:MyTextBox Grid.Row="2" x:Name="TbExportVersion" HintText="1.0.0" Grid.ColumnSpan="2" Tag="VersionArgumentTitle" Grid.Column="1" MaxLength="100" />
|
||||||
<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" />
|
||||||
|
|||||||
@@ -14,6 +14,11 @@
|
|||||||
Selected = New List(Of String)
|
Selected = New List(Of String)
|
||||||
CurrentVer = PageVersionLeft.Version.Path
|
CurrentVer = PageVersionLeft.Version.Path
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
TbExportName.ShowValidateResult = True
|
||||||
|
TbExportName.ValidateRules = New ObjectModel.Collection(Of Validate) From {New ValidateFileName() With {.AllowNull = True}}
|
||||||
|
TbExportName.Validate()
|
||||||
|
|
||||||
TbExportName.HintText = PageVersionLeft.Version.Name
|
TbExportName.HintText = PageVersionLeft.Version.Name
|
||||||
TbExportDesc.HintText = PageVersionLeft.Version.Info
|
TbExportDesc.HintText = PageVersionLeft.Version.Info
|
||||||
PanDisplayItem.Children.Clear()
|
PanDisplayItem.Children.Clear()
|
||||||
@@ -229,7 +234,9 @@
|
|||||||
|
|
||||||
#Region "整合包信息 & 预览栏"
|
#Region "整合包信息 & 预览栏"
|
||||||
Private Sub TbExportName_TextChanged(sender As MyTextBox, e As TextChangedEventArgs) Handles TbExportName.TextChanged
|
Private Sub TbExportName_TextChanged(sender As MyTextBox, e As TextChangedEventArgs) Handles TbExportName.TextChanged
|
||||||
ItemVersion.Title = If(String.IsNullOrWhiteSpace(sender.Text), PageVersionLeft.Version.Name, sender.Text)
|
If String.IsNullOrEmpty(TbExportName.ValidateResult) Then
|
||||||
|
ItemVersion.Title = If(String.IsNullOrWhiteSpace(sender.Text), PageVersionLeft.Version.Name, sender.Text)
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub TbExportDesc_TextChanged(sender As MyTextBox, e As TextChangedEventArgs) Handles TbExportDesc.TextChanged
|
Private Sub TbExportDesc_TextChanged(sender As MyTextBox, e As TextChangedEventArgs) Handles TbExportDesc.TextChanged
|
||||||
|
|||||||
Reference in New Issue
Block a user