2.7.4
This commit is contained in:
@@ -384,24 +384,27 @@ Public Module ModDownloadLib
|
||||
End Sub
|
||||
Private Sub McDownloadOptiFineInstall(BaseMcFolderHome As String, Target As String, Task As LoaderTask(Of List(Of NetFile), Boolean), UseJavaWrapper As Boolean)
|
||||
'选择 Java
|
||||
Dim Java = JavaSelect("已取消安装。", New Version(1, 8, 0, 0))
|
||||
If Java Is Nothing Then
|
||||
If Not JavaDownloadConfirm("Java 8 或更高版本") Then Throw New Exception("由于未找到 Java,已取消安装。")
|
||||
'开始自动下载
|
||||
Dim JavaLoader = JavaFixLoaders(17)
|
||||
Try
|
||||
JavaLoader.Start(17, IsForceRestart:=True)
|
||||
Do While JavaLoader.State = LoadState.Loading AndAlso Not Task.IsAborted
|
||||
Thread.Sleep(10)
|
||||
Loop
|
||||
Finally
|
||||
JavaLoader.Abort() '确保取消时中止 Java 下载
|
||||
End Try
|
||||
'检查下载结果
|
||||
Dim Java As JavaEntry
|
||||
SyncLock JavaLock
|
||||
Java = JavaSelect("已取消安装。", New Version(1, 8, 0, 0))
|
||||
If Task.IsAborted Then Exit Sub
|
||||
If Java Is Nothing Then Throw New Exception("由于未找到 Java,已取消安装。")
|
||||
End If
|
||||
If Java Is Nothing Then
|
||||
If Not JavaDownloadConfirm("Java 8 或更高版本") Then Throw New Exception("由于未找到 Java,已取消安装。")
|
||||
'开始自动下载
|
||||
Dim JavaLoader = JavaFixLoaders(17)
|
||||
Try
|
||||
JavaLoader.Start(17, IsForceRestart:=True)
|
||||
Do While JavaLoader.State = LoadState.Loading AndAlso Not Task.IsAborted
|
||||
Thread.Sleep(10)
|
||||
Loop
|
||||
Finally
|
||||
JavaLoader.Abort() '确保取消时中止 Java 下载
|
||||
End Try
|
||||
'检查下载结果
|
||||
Java = JavaSelect("已取消安装。", New Version(1, 8, 0, 0))
|
||||
If Task.IsAborted Then Exit Sub
|
||||
If Java Is Nothing Then Throw New Exception("由于未找到 Java,已取消安装。")
|
||||
End If
|
||||
End SyncLock
|
||||
'添加 Java Wrapper 作为主 Jar
|
||||
Dim Arguments As String
|
||||
If UseJavaWrapper Then
|
||||
@@ -1111,24 +1114,27 @@ Retry:
|
||||
|
||||
Private Sub ForgeInjector(Target As String, Task As LoaderTask(Of Boolean, Boolean), McFolder As String, UseJavaWrapper As Boolean)
|
||||
'选择 Java
|
||||
Dim Java = JavaSelect("已取消安装。", New Version(1, 8, 0, 60))
|
||||
If Java Is Nothing Then
|
||||
If Not JavaDownloadConfirm("Java 8 或更高版本") Then Throw New Exception("由于未找到 Java,已取消安装。")
|
||||
'开始自动下载
|
||||
Dim JavaLoader = JavaFixLoaders(17)
|
||||
Try
|
||||
JavaLoader.Start(17, IsForceRestart:=True)
|
||||
Do While JavaLoader.State = LoadState.Loading AndAlso Not Task.IsAborted
|
||||
Thread.Sleep(10)
|
||||
Loop
|
||||
Finally
|
||||
JavaLoader.Abort() '确保取消时中止 Java 下载
|
||||
End Try
|
||||
'检查下载结果
|
||||
Dim Java As JavaEntry
|
||||
SyncLock JavaLock
|
||||
Java = JavaSelect("已取消安装。", New Version(1, 8, 0, 60))
|
||||
If Task.IsAborted Then Exit Sub
|
||||
If Java Is Nothing Then Throw New Exception("由于未找到 Java,已取消安装。")
|
||||
End If
|
||||
If Java Is Nothing Then
|
||||
If Not JavaDownloadConfirm("Java 8 或更高版本") Then Throw New Exception("由于未找到 Java,已取消安装。")
|
||||
'开始自动下载
|
||||
Dim JavaLoader = JavaFixLoaders(17)
|
||||
Try
|
||||
JavaLoader.Start(17, IsForceRestart:=True)
|
||||
Do While JavaLoader.State = LoadState.Loading AndAlso Not Task.IsAborted
|
||||
Thread.Sleep(10)
|
||||
Loop
|
||||
Finally
|
||||
JavaLoader.Abort() '确保取消时中止 Java 下载
|
||||
End Try
|
||||
'检查下载结果
|
||||
Java = JavaSelect("已取消安装。", New Version(1, 8, 0, 60))
|
||||
If Task.IsAborted Then Exit Sub
|
||||
If Java Is Nothing Then Throw New Exception("由于未找到 Java,已取消安装。")
|
||||
End If
|
||||
End SyncLock
|
||||
'添加 Java Wrapper 作为主 Jar
|
||||
Dim Arguments As String
|
||||
If UseJavaWrapper Then
|
||||
@@ -1275,8 +1281,8 @@ Retry:
|
||||
McFolder = If(McFolder, PathMcFolder)
|
||||
If Version.StartsWithF("1.") AndAlso Version.Contains("-") Then
|
||||
'类似 1.19.3-41.2.8 格式,优先使用 Version 中要求的版本而非 Inherit(例如 1.19.3 却使用了 1.19 的 Forge)
|
||||
Inherit = Version.Split("-").First
|
||||
Version = Version.Split("-").Last
|
||||
Inherit = Version.Before("-")
|
||||
Version = Version.After("-")
|
||||
End If
|
||||
Dim IsCustomFolder As Boolean = McFolder <> PathMcFolder
|
||||
Dim Id As String = Inherit & "-forge-" & Version
|
||||
@@ -1322,7 +1328,7 @@ Retry:
|
||||
Loaders.Add(New LoaderDownload("下载 Mod 加载器主文件", New List(Of NetFile)) With {.ProgressWeight = 9})
|
||||
|
||||
'安装(仅在新版安装时需要原版 Jar)
|
||||
If Version.Split(".")(0) >= 20 Then
|
||||
If Version.Before(".") >= 20 Then
|
||||
Log("[Download] 检测为新版 Forge:" & Version)
|
||||
Dim Libs As List(Of McLibToken) = Nothing
|
||||
Loaders.Add(New LoaderTask(Of String, List(Of NetFile))("分析 Mod 加载器支持库文件",
|
||||
@@ -1344,7 +1350,7 @@ Retry:
|
||||
Task.Progress = 0.4
|
||||
Dim RawJson As JObject = GetJson(NetGetCodeByDownload(DlSourceLauncherOrMetaGet(DlClientListGet(Inherit)), IsJson:=True))
|
||||
'[net.minecraft:client:1.17.1-20210706.113038:mappings@txt] 或 @tsrg]
|
||||
Dim OriginalName As String = Json("data")("MOJMAPS")("client").ToString.Trim("[]".ToCharArray()).Split("@")(0)
|
||||
Dim OriginalName As String = Json("data")("MOJMAPS")("client").ToString.Trim("[]".ToCharArray()).Before("@")
|
||||
Dim Address = McLibGet(OriginalName).Replace(".jar", "-mappings." & Json("data")("MOJMAPS")("client").ToString.Trim("[]".ToCharArray()).Split("@")(1))
|
||||
Libs.Add(New McLibToken With {.IsJumpLoader = False, .IsNatives = False, .LocalPath = Address, .OriginalName = OriginalName,
|
||||
.Url = RawJson("downloads")("client_mappings")("url"), .Size = RawJson("downloads")("client_mappings")("size"), .SHA1 = RawJson("downloads")("client_mappings")("sha1")})
|
||||
@@ -1788,7 +1794,7 @@ Retry:
|
||||
Public Function FabricApiDownloadListItem(Entry As CompFile, OnClick As MyListItem.ClickEventHandler) As MyListItem
|
||||
'建立控件
|
||||
Dim NewItem As New MyListItem With {
|
||||
.Title = Entry.DisplayName.Split("]")(1).Replace("Fabric API ", "").Replace(" build ", ".").Split("+").First.Trim, .SnapsToDevicePixels = True, .Height = 42, .Type = MyListItem.CheckType.Clickable, .Tag = Entry,
|
||||
.Title = Entry.DisplayName.Split("]")(1).Replace("Fabric API ", "").Replace(" build ", ".").Before("+").Trim, .SnapsToDevicePixels = True, .Height = 42, .Type = MyListItem.CheckType.Clickable, .Tag = Entry,
|
||||
.Info = Entry.StatusDescription & ",发布于 " & Entry.ReleaseDate.ToString("yyyy'/'MM'/'dd HH':'mm"),
|
||||
.Logo = PathImage & "Blocks/Fabric.png"
|
||||
}
|
||||
@@ -1978,7 +1984,7 @@ Retry:
|
||||
If Directory.Exists(TempMcFolder) Then DeleteDirectory(TempMcFolder)
|
||||
Dim OptiFineFolder As String = Nothing
|
||||
If Request.OptiFineVersion IsNot Nothing Then
|
||||
If Request.OptiFineVersion.Contains("_HD_U_") Then Request.OptiFineVersion = "HD_U_" & Request.OptiFineVersion.Split("_HD_U_").Last '#735
|
||||
If Request.OptiFineVersion.Contains("_HD_U_") Then Request.OptiFineVersion = "HD_U_" & Request.OptiFineVersion.After("_HD_U_") '#735
|
||||
Request.OptiFineEntry = New DlOptiFineListEntry With {
|
||||
.NameDisplay = Request.MinecraftName & " " & Request.OptiFineVersion.Replace("HD_U_", "").Replace("_", "").Replace("pre", " pre"),
|
||||
.Inherit = Request.MinecraftName,
|
||||
@@ -2062,7 +2068,7 @@ Retry:
|
||||
End Sub) With {.ProgressWeight = 2, .Block = True})
|
||||
'补全文件
|
||||
If Not DontFixLibraries AndAlso
|
||||
(Request.OptiFineEntry IsNot Nothing OrElse (Request.ForgeVersion IsNot Nothing AndAlso Request.ForgeVersion.Split(".")(0) >= 20) OrElse Request.FabricVersion IsNot Nothing OrElse Request.LiteLoaderEntry IsNot Nothing) Then
|
||||
(Request.OptiFineEntry IsNot Nothing OrElse (Request.ForgeVersion IsNot Nothing AndAlso Request.ForgeVersion.Before(".") >= 20) OrElse Request.FabricVersion IsNot Nothing OrElse Request.LiteLoaderEntry IsNot Nothing) Then
|
||||
Dim LoadersLib As New List(Of LoaderBase)
|
||||
LoadersLib.Add(New LoaderTask(Of String, List(Of NetFile))("分析游戏支持库文件(副加载器)", Sub(Task As LoaderTask(Of String, List(Of NetFile))) Task.Output = McLibFix(New McVersion(OutputFolder))) With {.ProgressWeight = 1, .Show = False})
|
||||
LoadersLib.Add(New LoaderDownload("下载游戏支持库文件(副加载器)", New List(Of NetFile)) With {.ProgressWeight = 7, .Show = False})
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
If Project.TranslatedName = Project.RawName Then
|
||||
FileName = File.FileName
|
||||
Else
|
||||
Dim ChineseName As String = Project.TranslatedName.Split(" (").First.Split(" - ").First.
|
||||
Dim ChineseName As String = Project.TranslatedName.Before(" (").Before(" - ").
|
||||
Replace("\", "\").Replace("/", "/").Replace("|", "|").Replace(":", ":").Replace("<", "<").Replace(">", ">").Replace("*", "*").Replace("?", "?").Replace("""", "").Replace(": ", ":")
|
||||
Select Case Setup.Get("ToolDownloadTranslate")
|
||||
Case 0
|
||||
@@ -299,7 +299,7 @@
|
||||
If(File.FileName.EndsWith(".mrpack"), "*.mrpack", "*.zip")), DefaultFolder)
|
||||
If Not Target.Contains("\") Then Exit Sub
|
||||
'构造步骤加载器
|
||||
Dim LoaderName As String = Desc & "下载:" & File.DisplayName & " "
|
||||
Dim LoaderName As String = Desc & "下载:" & GetFileNameWithoutExtentionFromPath(Target) & " "
|
||||
If Target <> DefaultFolder AndAlso Project.Type = CompType.Mod Then CachedFolder = GetPathFromFullPath(Target)
|
||||
Dim Loaders As New List(Of LoaderBase)
|
||||
Loaders.Add(New LoaderDownload("下载文件", New List(Of NetFile) From {File.ToNetFile(Target)}) With {.ProgressWeight = 6, .Block = True})
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<StackPanel Margin="25,37,25,15">
|
||||
<local:MyHint Text="你尚未选择安装 Fabric API,这会导致大多数 Mod 无法使用!" Margin="0,1,0,7" x:Name="HintFabricAPI" IsWarn="True" />
|
||||
<local:MyHint Text="你尚未选择安装 OptiFabric,这会导致 OptiFine 无法使用!" Margin="0,1,0,7" x:Name="HintOptiFabric" IsWarn="True" />
|
||||
<local:MyHint Text="OptiFine 与一部分 Mod 的兼容性不佳,请谨慎安装。" Margin="0,1,0,7" x:Name="HintModOptiFine" IsWarn="False" />
|
||||
<Grid Margin="0,0,0,11">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
@@ -60,26 +61,6 @@
|
||||
<TextBlock VerticalAlignment="Center" Text="返回" Grid.Column="3" Foreground="{StaticResource ColorBrushGray4}" />
|
||||
</Grid>
|
||||
</local:MyCard>
|
||||
<local:MyCard Title="OptiFine" Height="40" Margin="0,15,0,0" x:Name="CardOptiFine" IsSwaped="True" CanSwap="True" SwapLogoRight="True">
|
||||
<StackPanel Margin="20,40,18,15" VerticalAlignment="Top">
|
||||
<StackPanel Name="PanOptiFine" />
|
||||
</StackPanel>
|
||||
<Grid x:Name="PanOptiFineInfo" Height="18" Margin="175,11,15,0" VerticalAlignment="Top" Tag="True">
|
||||
<Grid.RenderTransform>
|
||||
<TranslateTransform />
|
||||
</Grid.RenderTransform>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image x:Name="ImgOptiFine" Margin="0,0,7,0" SnapsToDevicePixels="True" Height="18" RenderOptions.BitmapScalingMode="Linear" Source="pack://application:,,,/images/Blocks/GrassPath.png" />
|
||||
<TextBlock x:Name="LabOptiFine" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" Grid.Column="1" />
|
||||
</Grid>
|
||||
<Grid x:Name="BtnOptiFineClear" Height="30" Width="30" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,32,0" Background="{StaticResource ColorBrushSemiTransparent}">
|
||||
<Path x:Name="BtnOptiFineClearInner" Height="10" Width="10" Stretch="Uniform" Fill="{StaticResource ColorBrushGray1}" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Data="F1 M2,0 L0,2 8,10 0,18 2,20 10,12 18,20 20,18 12,10 20,2 18,0 10,8 2,0Z" />
|
||||
</Grid>
|
||||
</local:MyCard>
|
||||
<local:MyCard Title="Forge" Height="40" Margin="0,15,0,0" x:Name="CardForge" IsSwaped="True" CanSwap="True" SwapLogoRight="True">
|
||||
<StackPanel Margin="20,40,18,15" VerticalAlignment="Top" Name="PanForge" />
|
||||
<Grid x:Name="PanForgeInfo" Height="18" Margin="175,11,15,0" VerticalAlignment="Top" Tag="True">
|
||||
@@ -134,6 +115,26 @@
|
||||
Data="F1 M2,0 L0,2 8,10 0,18 2,20 10,12 18,20 20,18 12,10 20,2 18,0 10,8 2,0Z" />
|
||||
</Grid>
|
||||
</local:MyCard>
|
||||
<local:MyCard Title="OptiFine" Height="40" Margin="0,15,0,0" x:Name="CardOptiFine" IsSwaped="True" CanSwap="True" SwapLogoRight="True">
|
||||
<StackPanel Margin="20,40,18,15" VerticalAlignment="Top">
|
||||
<StackPanel Name="PanOptiFine" />
|
||||
</StackPanel>
|
||||
<Grid x:Name="PanOptiFineInfo" Height="18" Margin="175,11,15,0" VerticalAlignment="Top" Tag="True">
|
||||
<Grid.RenderTransform>
|
||||
<TranslateTransform />
|
||||
</Grid.RenderTransform>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image x:Name="ImgOptiFine" Margin="0,0,7,0" SnapsToDevicePixels="True" Height="18" RenderOptions.BitmapScalingMode="Linear" Source="pack://application:,,,/images/Blocks/GrassPath.png" />
|
||||
<TextBlock x:Name="LabOptiFine" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" Grid.Column="1" />
|
||||
</Grid>
|
||||
<Grid x:Name="BtnOptiFineClear" Height="30" Width="30" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,32,0" Background="{StaticResource ColorBrushSemiTransparent}">
|
||||
<Path x:Name="BtnOptiFineClearInner" Height="10" Width="10" Stretch="Uniform" Fill="{StaticResource ColorBrushGray1}" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Data="F1 M2,0 L0,2 8,10 0,18 2,20 10,12 18,20 20,18 12,10 20,2 18,0 10,8 2,0Z" />
|
||||
</Grid>
|
||||
</local:MyCard>
|
||||
<local:MyCard Title="OptiFabric" Height="40" Margin="0,15,0,0" x:Name="CardOptiFabric" IsSwaped="True" CanSwap="True" SwapLogoRight="True">
|
||||
<StackPanel Margin="20,40,18,15" VerticalAlignment="Top" Name="PanOptiFabric" />
|
||||
<Grid x:Name="PanOptiFabricInfo" Height="18" Margin="175,11,15,0" VerticalAlignment="Top" Tag="True">
|
||||
|
||||
@@ -305,20 +305,25 @@
|
||||
LabOptiFine.Foreground = ColorGray1
|
||||
End If
|
||||
'LiteLoader
|
||||
Dim LiteLoaderError As String = LoadLiteLoaderGetError()
|
||||
CardLiteLoader.MainSwap.Visibility = If(LiteLoaderError Is Nothing, Visibility.Visible, Visibility.Collapsed)
|
||||
If LiteLoaderError IsNot Nothing Then CardLiteLoader.IsSwaped = True '例如在同时展开卡片时选择了不兼容项则强制折叠
|
||||
SetLiteLoaderInfoShow(CardLiteLoader.IsSwaped)
|
||||
If SelectedLiteLoader Is Nothing Then
|
||||
BtnLiteLoaderClear.Visibility = Visibility.Collapsed
|
||||
ImgLiteLoader.Visibility = Visibility.Collapsed
|
||||
LabLiteLoader.Text = If(LiteLoaderError, "点击选择")
|
||||
LabLiteLoader.Foreground = ColorGray4
|
||||
If Not SelectedMinecraftId.Contains("1.") OrElse Val(SelectedMinecraftId.Split(".")(1)) > 12 Then
|
||||
CardLiteLoader.Visibility = Visibility.Collapsed
|
||||
Else
|
||||
BtnLiteLoaderClear.Visibility = Visibility.Visible
|
||||
ImgLiteLoader.Visibility = Visibility.Visible
|
||||
LabLiteLoader.Text = SelectedLiteLoader.Inherit
|
||||
LabLiteLoader.Foreground = ColorGray1
|
||||
CardLiteLoader.Visibility = Visibility.Visible
|
||||
Dim LiteLoaderError As String = LoadLiteLoaderGetError()
|
||||
CardLiteLoader.MainSwap.Visibility = If(LiteLoaderError Is Nothing, Visibility.Visible, Visibility.Collapsed)
|
||||
If LiteLoaderError IsNot Nothing Then CardLiteLoader.IsSwaped = True '例如在同时展开卡片时选择了不兼容项则强制折叠
|
||||
SetLiteLoaderInfoShow(CardLiteLoader.IsSwaped)
|
||||
If SelectedLiteLoader Is Nothing Then
|
||||
BtnLiteLoaderClear.Visibility = Visibility.Collapsed
|
||||
ImgLiteLoader.Visibility = Visibility.Collapsed
|
||||
LabLiteLoader.Text = If(LiteLoaderError, "点击选择")
|
||||
LabLiteLoader.Foreground = ColorGray4
|
||||
Else
|
||||
BtnLiteLoaderClear.Visibility = Visibility.Visible
|
||||
ImgLiteLoader.Visibility = Visibility.Visible
|
||||
LabLiteLoader.Text = SelectedLiteLoader.Inherit
|
||||
LabLiteLoader.Foreground = ColorGray1
|
||||
End If
|
||||
End If
|
||||
'Forge
|
||||
Dim ForgeError As String = LoadForgeGetError()
|
||||
@@ -337,60 +342,85 @@
|
||||
LabForge.Foreground = ColorGray1
|
||||
End If
|
||||
'Fabric
|
||||
Dim FabricError As String = LoadFabricGetError()
|
||||
CardFabric.MainSwap.Visibility = If(FabricError Is Nothing, Visibility.Visible, Visibility.Collapsed)
|
||||
If FabricError IsNot Nothing Then CardFabric.IsSwaped = True
|
||||
SetFabricInfoShow(CardFabric.IsSwaped)
|
||||
If SelectedFabric Is Nothing Then
|
||||
BtnFabricClear.Visibility = Visibility.Collapsed
|
||||
ImgFabric.Visibility = Visibility.Collapsed
|
||||
LabFabric.Text = If(FabricError, "点击选择")
|
||||
LabFabric.Foreground = ColorGray4
|
||||
If SelectedMinecraftId.Contains("1.") AndAlso Val(SelectedMinecraftId.Split(".")(1)) <= 13 Then
|
||||
CardFabric.Visibility = Visibility.Collapsed
|
||||
Else
|
||||
BtnFabricClear.Visibility = Visibility.Visible
|
||||
ImgFabric.Visibility = Visibility.Visible
|
||||
LabFabric.Text = SelectedFabric.Replace("+build", "")
|
||||
LabFabric.Foreground = ColorGray1
|
||||
CardFabric.Visibility = Visibility.Visible
|
||||
Dim FabricError As String = LoadFabricGetError()
|
||||
CardFabric.MainSwap.Visibility = If(FabricError Is Nothing, Visibility.Visible, Visibility.Collapsed)
|
||||
If FabricError IsNot Nothing Then CardFabric.IsSwaped = True
|
||||
SetFabricInfoShow(CardFabric.IsSwaped)
|
||||
If SelectedFabric Is Nothing Then
|
||||
BtnFabricClear.Visibility = Visibility.Collapsed
|
||||
ImgFabric.Visibility = Visibility.Collapsed
|
||||
LabFabric.Text = If(FabricError, "点击选择")
|
||||
LabFabric.Foreground = ColorGray4
|
||||
Else
|
||||
BtnFabricClear.Visibility = Visibility.Visible
|
||||
ImgFabric.Visibility = Visibility.Visible
|
||||
LabFabric.Text = SelectedFabric.Replace("+build", "")
|
||||
LabFabric.Foreground = ColorGray1
|
||||
End If
|
||||
End If
|
||||
'FabricApi
|
||||
Dim FabricApiError As String = LoadFabricApiGetError()
|
||||
CardFabricApi.MainSwap.Visibility = If(FabricApiError Is Nothing, Visibility.Visible, Visibility.Collapsed)
|
||||
If FabricApiError IsNot Nothing OrElse SelectedFabric Is Nothing Then CardFabricApi.IsSwaped = True
|
||||
SetFabricApiInfoShow(CardFabricApi.IsSwaped)
|
||||
If SelectedFabricApi Is Nothing Then
|
||||
BtnFabricApiClear.Visibility = Visibility.Collapsed
|
||||
ImgFabricApi.Visibility = Visibility.Collapsed
|
||||
LabFabricApi.Text = If(FabricApiError, "点击选择")
|
||||
LabFabricApi.Foreground = ColorGray4
|
||||
If SelectedFabric Is Nothing Then
|
||||
CardFabricApi.Visibility = Visibility.Collapsed
|
||||
Else
|
||||
BtnFabricApiClear.Visibility = Visibility.Visible
|
||||
ImgFabricApi.Visibility = Visibility.Visible
|
||||
LabFabricApi.Text = SelectedFabricApi.DisplayName.Split("]")(1).Replace("Fabric API ", "").Replace(" build ", ".").Split("+").First.Trim
|
||||
LabFabricApi.Foreground = ColorGray1
|
||||
CardFabricApi.Visibility = Visibility.Visible
|
||||
Dim FabricApiError As String = LoadFabricApiGetError()
|
||||
CardFabricApi.MainSwap.Visibility = If(FabricApiError Is Nothing, Visibility.Visible, Visibility.Collapsed)
|
||||
If FabricApiError IsNot Nothing OrElse SelectedFabric Is Nothing Then CardFabricApi.IsSwaped = True
|
||||
SetFabricApiInfoShow(CardFabricApi.IsSwaped)
|
||||
If SelectedFabricApi Is Nothing Then
|
||||
BtnFabricApiClear.Visibility = Visibility.Collapsed
|
||||
ImgFabricApi.Visibility = Visibility.Collapsed
|
||||
LabFabricApi.Text = If(FabricApiError, "点击选择")
|
||||
LabFabricApi.Foreground = ColorGray4
|
||||
Else
|
||||
BtnFabricApiClear.Visibility = Visibility.Visible
|
||||
ImgFabricApi.Visibility = Visibility.Visible
|
||||
LabFabricApi.Text = SelectedFabricApi.DisplayName.Split("]")(1).Replace("Fabric API ", "").Replace(" build ", ".").Split("+").First.Trim
|
||||
LabFabricApi.Foreground = ColorGray1
|
||||
End If
|
||||
End If
|
||||
'OptiFabric
|
||||
Dim OptiFabricError As String = LoadOptiFabricGetError()
|
||||
CardOptiFabric.MainSwap.Visibility = If(OptiFabricError Is Nothing, Visibility.Visible, Visibility.Collapsed)
|
||||
If OptiFabricError IsNot Nothing OrElse SelectedFabric Is Nothing Then CardOptiFabric.IsSwaped = True
|
||||
SetOptiFabricInfoShow(CardOptiFabric.IsSwaped)
|
||||
If SelectedOptiFabric Is Nothing Then
|
||||
BtnOptiFabricClear.Visibility = Visibility.Collapsed
|
||||
ImgOptiFabric.Visibility = Visibility.Collapsed
|
||||
LabOptiFabric.Text = If(OptiFabricError, "点击选择")
|
||||
LabOptiFabric.Foreground = ColorGray4
|
||||
If SelectedFabric Is Nothing OrElse SelectedOptiFine Is Nothing Then
|
||||
CardOptiFabric.Visibility = Visibility.Collapsed
|
||||
Else
|
||||
BtnOptiFabricClear.Visibility = Visibility.Visible
|
||||
ImgOptiFabric.Visibility = Visibility.Visible
|
||||
LabOptiFabric.Text = SelectedOptiFabric.DisplayName.ToLower.Replace("optifabric-", "").Replace(".jar", "").Trim.TrimStart("v")
|
||||
LabOptiFabric.Foreground = ColorGray1
|
||||
CardOptiFabric.Visibility = Visibility.Visible
|
||||
Dim OptiFabricError As String = LoadOptiFabricGetError()
|
||||
CardOptiFabric.MainSwap.Visibility = If(OptiFabricError Is Nothing, Visibility.Visible, Visibility.Collapsed)
|
||||
If OptiFabricError IsNot Nothing OrElse SelectedFabric Is Nothing Then CardOptiFabric.IsSwaped = True
|
||||
SetOptiFabricInfoShow(CardOptiFabric.IsSwaped)
|
||||
If SelectedOptiFabric Is Nothing Then
|
||||
BtnOptiFabricClear.Visibility = Visibility.Collapsed
|
||||
ImgOptiFabric.Visibility = Visibility.Collapsed
|
||||
LabOptiFabric.Text = If(OptiFabricError, "点击选择")
|
||||
LabOptiFabric.Foreground = ColorGray4
|
||||
Else
|
||||
BtnOptiFabricClear.Visibility = Visibility.Visible
|
||||
ImgOptiFabric.Visibility = Visibility.Visible
|
||||
LabOptiFabric.Text = SelectedOptiFabric.DisplayName.ToLower.Replace("optifabric-", "").Replace(".jar", "").Trim.TrimStart("v")
|
||||
LabOptiFabric.Foreground = ColorGray1
|
||||
End If
|
||||
End If
|
||||
'主警告
|
||||
HintFabricAPI.Visibility = If(SelectedFabric IsNot Nothing AndAlso SelectedFabricApi Is Nothing, Visibility.Visible, Visibility.Collapsed)
|
||||
If SelectedFabric IsNot Nothing AndAlso SelectedFabricApi Is Nothing Then
|
||||
HintFabricAPI.Visibility = Visibility.Visible
|
||||
Else
|
||||
HintFabricAPI.Visibility = Visibility.Collapsed
|
||||
End If
|
||||
If SelectedFabric IsNot Nothing AndAlso SelectedOptiFine IsNot Nothing AndAlso SelectedOptiFabric Is Nothing Then
|
||||
HintOptiFabric.Visibility = Visibility.Visible
|
||||
Else
|
||||
HintOptiFabric.Visibility = Visibility.Collapsed
|
||||
End If
|
||||
If SelectedMinecraftId.Contains("1.") AndAlso Val(SelectedMinecraftId.Split(".")(1)) >= 16 AndAlso SelectedOptiFine IsNot Nothing AndAlso
|
||||
(SelectedForge IsNot Nothing OrElse SelectedFabric IsNot Nothing) Then
|
||||
HintModOptiFine.Visibility = Visibility.Visible
|
||||
Else
|
||||
HintModOptiFine.Visibility = Visibility.Collapsed
|
||||
End If
|
||||
'结束
|
||||
IsReloading = False
|
||||
End Sub
|
||||
@@ -632,7 +662,7 @@
|
||||
Return (OptiFine.RequiredForgeVersion.Contains(".") AndAlso 'XX.X.XXX
|
||||
VersionSortInteger(Forge.Version, OptiFine.RequiredForgeVersion) >= 0) OrElse
|
||||
(Not OptiFine.RequiredForgeVersion.Contains(".") AndAlso '#XXXX
|
||||
VersionSortInteger(Forge.Version.Split(".").Last, OptiFine.RequiredForgeVersion) >= 0)
|
||||
Forge.Version.After(".") >= OptiFine.RequiredForgeVersion)
|
||||
End Function
|
||||
|
||||
'限制展开
|
||||
@@ -909,12 +939,12 @@
|
||||
If DisplayName.StartsWith("[" & MinecraftVersion & "]") Then Return True
|
||||
If Not DisplayName.Contains("/") OrElse Not DisplayName.Contains("]") Then Return False
|
||||
'直接的判断(例如 1.18.1/22w03a)
|
||||
For Each Part As String In DisplayName.Split("]")(0).TrimStart("[").Split("/")
|
||||
For Each Part As String In DisplayName.Before("]").TrimStart("[").Split("/")
|
||||
If Part = MinecraftVersion Then Return True
|
||||
Next
|
||||
'将版本名分割语素(例如 1.16.4/5)
|
||||
Dim Lefts = RegexSearch(DisplayName.Split("]")(0), "[a-z/]+|[0-9/]+")
|
||||
Dim Rights = RegexSearch(MinecraftVersion.Split("]")(0), "[a-z/]+|[0-9/]+")
|
||||
Dim Lefts = RegexSearch(DisplayName.Before("]"), "[a-z/]+|[0-9/]+")
|
||||
Dim Rights = RegexSearch(MinecraftVersion.Before("]"), "[a-z/]+|[0-9/]+")
|
||||
'对每段进行判断
|
||||
Dim i As Integer = 0
|
||||
While True
|
||||
|
||||
@@ -93,7 +93,7 @@ Public Class FormLoginOAuth
|
||||
If Not IsLoginSuccessed Then RaiseEvent OnLoginCanceled(IsSwitch)
|
||||
FrmMain.Focus()
|
||||
End Sub
|
||||
Private Sub HintSwitch_Click(sender As Object, e As EventArgs) Handles HintSwitch.Click
|
||||
Private Sub HintSwitch_Click() Handles HintSwitch.Click
|
||||
IsSwitch = True
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
@@ -400,7 +400,7 @@ Finish:
|
||||
ElseIf Setup.Get("LoginLegacyName") = "" Then
|
||||
Return New EqualableList(Of String) From {0, ""}
|
||||
Else
|
||||
Return New EqualableList(Of String) From {0, If(Setup.Get("LoginLegacyName").ToString.Split("¨")(0), "")}
|
||||
Return New EqualableList(Of String) From {0, If(Setup.Get("LoginLegacyName").ToString.Before("¨"), "")}
|
||||
End If
|
||||
Case 3
|
||||
Return New EqualableList(Of String) From {3, Setup.Get("LaunchSkinID")}
|
||||
|
||||
@@ -97,6 +97,10 @@ Download:
|
||||
Log("[Page] 主页预设:每日整合包推荐")
|
||||
Url = "https://pclsub.sodamc.com/"
|
||||
GoTo Download
|
||||
Case 5
|
||||
Log("[Page] 主页预设:Minecraft 皮肤推荐")
|
||||
Url = "https://forgepixel.com/pcl_sub_file"
|
||||
GoTo Download
|
||||
End Select
|
||||
End Select
|
||||
RunInUi(Sub() LoadContent(Content))
|
||||
@@ -106,16 +110,17 @@ Download:
|
||||
'联网获取自定义主页文件
|
||||
Private OnlineLoader As New LoaderTask(Of String, Integer)("自定义主页获取", AddressOf OnlineLoaderSub) With {.ReloadTimeout = 10 * 60 * 1000}
|
||||
Private Sub OnlineLoaderSub(Task As LoaderTask(Of String, Integer))
|
||||
Dim Address As String = Task.Input '#3721 中连续触发两次导致内容变化
|
||||
Try
|
||||
'获取版本校验地址
|
||||
Dim VersionAddress As String
|
||||
If Task.Input.Contains(".xaml") Then
|
||||
VersionAddress = Task.Input.Replace(".xaml", ".xaml.ini")
|
||||
If Address.Contains(".xaml") Then
|
||||
VersionAddress = Address.Replace(".xaml", ".xaml.ini")
|
||||
Else
|
||||
VersionAddress = Task.Input.Split("?").First
|
||||
VersionAddress = Address.Before("?")
|
||||
If Not VersionAddress.EndsWith("/") Then VersionAddress += "/"
|
||||
VersionAddress += "version"
|
||||
If Task.Input.Contains("?") Then VersionAddress += Task.Input.Split("?").Last
|
||||
If Address.Contains("?") Then VersionAddress += Address.After("?")
|
||||
End If
|
||||
'校验版本
|
||||
Dim Version As String = ""
|
||||
@@ -136,9 +141,9 @@ Download:
|
||||
End Try
|
||||
'实际下载
|
||||
If NeedDownload Then
|
||||
Dim FileContent As String = NetGetCodeByRequestRetry(Task.Input)
|
||||
Log($"[Page] 已联网下载自定义主页,内容长度:{FileContent.Length},来源:{Task.Input}")
|
||||
Setup.Set("CacheSavedPageUrl", Task.Input)
|
||||
Dim FileContent As String = NetGetCodeByRequestRetry(Address)
|
||||
Log($"[Page] 已联网下载自定义主页,内容长度:{FileContent.Length},来源:{Address}")
|
||||
Setup.Set("CacheSavedPageUrl", Address)
|
||||
Setup.Set("CacheSavedPageVersion", Version)
|
||||
WriteFile(PathTemp & "Cache\Custom.xaml", FileContent)
|
||||
End If
|
||||
@@ -146,11 +151,11 @@ Download:
|
||||
Refresh()
|
||||
Catch ex As Exception
|
||||
If Setup.Get("CacheSavedPageVersion") = "" Then
|
||||
Log(ex, $"联网下载自定义主页失败({Task.Input})", LogLevel.Msgbox)
|
||||
Log(ex, $"联网下载自定义主页失败({Address})", LogLevel.Msgbox)
|
||||
Else
|
||||
Log(ex, $"联网下载自定义主页失败({Task.Input})")
|
||||
Log(ex, $"联网下载自定义主页失败({Address})")
|
||||
End If
|
||||
Task.Input = ""
|
||||
Address = ""
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
@@ -208,6 +213,7 @@ Download:
|
||||
GoTo Refresh '防止 SyncLock 死锁
|
||||
End If
|
||||
End Try
|
||||
Log($"[Page] 实例化:加载自定义主页 UI 完成")
|
||||
End SyncLock
|
||||
Return
|
||||
Refresh:
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
ComboName.ItemsSource = Nothing
|
||||
Else
|
||||
ComboName.ItemsSource = Setup.Get("LoginAuthEmail").ToString.Split("¨")
|
||||
ComboName.Text = Setup.Get("LoginAuthEmail").ToString.Split("¨")(0)
|
||||
If Setup.Get("LoginRemember") Then TextPass.Password = Setup.Get("LoginAuthPass").ToString.Split("¨")(0).Trim
|
||||
ComboName.Text = Setup.Get("LoginAuthEmail").ToString.Before("¨")
|
||||
If Setup.Get("LoginRemember") Then TextPass.Password = Setup.Get("LoginAuthPass").ToString.Before("¨").Trim
|
||||
End If
|
||||
End If
|
||||
IsFirstLoad = False
|
||||
|
||||
@@ -26,7 +26,7 @@ Public Class PageLoginLegacy
|
||||
ComboName.ItemsSource = Nothing
|
||||
Else
|
||||
ComboName.ItemsSource = Setup.Get("LoginLegacyName").ToString.Split("¨")
|
||||
ComboName.Text = Setup.Get("LoginLegacyName").ToString.Split("¨")(0).Trim
|
||||
ComboName.Text = Setup.Get("LoginLegacyName").ToString.Before("¨").Trim
|
||||
End If
|
||||
End If
|
||||
IsReloaded = True
|
||||
|
||||
@@ -67,39 +67,43 @@
|
||||
ComboAccounts.IsEnabled = False
|
||||
BtnLogin.IsEnabled = False
|
||||
BtnLogin.Text = "0%"
|
||||
RunInNewThread(Sub()
|
||||
Try
|
||||
McLoginMsLoader.Start(GetLoginData(), IsForceRestart:=True)
|
||||
Do While McLoginMsLoader.State = LoadState.Loading
|
||||
RunInUi(Sub() BtnLogin.Text = Math.Round(McLoginMsLoader.Progress * 100) & "%")
|
||||
Thread.Sleep(50)
|
||||
Loop
|
||||
If McLoginMsLoader.State = LoadState.Finished Then
|
||||
RunInUi(Sub() FrmLaunchLeft.RefreshPage(False, True))
|
||||
ElseIf McLoginMsLoader.State = LoadState.Aborted Then
|
||||
Throw New ThreadInterruptedException
|
||||
ElseIf McLoginMsLoader.Error Is Nothing Then
|
||||
Throw New Exception("未知错误!")
|
||||
Else
|
||||
Throw New Exception(McLoginMsLoader.Error.Message, McLoginMsLoader.Error)
|
||||
End If
|
||||
Catch ex As ThreadInterruptedException
|
||||
Hint("已取消登录!")
|
||||
Catch ex As Exception
|
||||
If ex.Message = "$$" Then
|
||||
ElseIf ex.Message.StartsWith("$") Then
|
||||
Hint(ex.Message.TrimStart("$"), HintType.Critical)
|
||||
Else
|
||||
Log(ex, "微软登录尝试失败", LogLevel.Msgbox)
|
||||
End If
|
||||
Finally
|
||||
RunInUi(Sub()
|
||||
ComboAccounts.IsEnabled = True
|
||||
BtnLogin.IsEnabled = True
|
||||
BtnLogin.Text = "登录"
|
||||
End Sub)
|
||||
End Try
|
||||
End Sub, "Ms Login")
|
||||
RunInNewThread(
|
||||
Sub()
|
||||
Try
|
||||
McLoginMsLoader.Start(GetLoginData(), IsForceRestart:=True)
|
||||
Do While McLoginMsLoader.State = LoadState.Loading
|
||||
RunInUi(Sub() BtnLogin.Text = Math.Round(McLoginMsLoader.Progress * 100) & "%")
|
||||
Thread.Sleep(50)
|
||||
Loop
|
||||
If McLoginMsLoader.State = LoadState.Finished Then
|
||||
RunInUi(Sub() FrmLaunchLeft.RefreshPage(False, True))
|
||||
ElseIf McLoginMsLoader.State = LoadState.Aborted Then
|
||||
Throw New ThreadInterruptedException
|
||||
ElseIf McLoginMsLoader.Error Is Nothing Then
|
||||
Throw New Exception("未知错误!")
|
||||
Else
|
||||
Throw New Exception(McLoginMsLoader.Error.Message, McLoginMsLoader.Error)
|
||||
End If
|
||||
Catch ex As ThreadInterruptedException
|
||||
Hint("已取消登录!")
|
||||
Catch ex As Exception
|
||||
If ex.Message = "$$" Then
|
||||
ElseIf ex.Message.StartsWith("$") Then
|
||||
Hint(ex.Message.TrimStart("$"), HintType.Critical)
|
||||
ElseIf TypeOf ex Is Security.Authentication.AuthenticationException AndAlso ex.Message.ContainsF("SSL/TLS") Then
|
||||
Log(ex, "正版登录验证失败,请尝试在 [设置 → 启动器] 中关闭 [验证 SSL 证书] 然后再试。" & vbCrLf & vbCrLf & "原始错误信息:", LogLevel.Msgbox)
|
||||
Else
|
||||
Log(ex, "正版登录尝试失败", LogLevel.Msgbox)
|
||||
End If
|
||||
Finally
|
||||
RunInUi(
|
||||
Sub()
|
||||
ComboAccounts.IsEnabled = True
|
||||
BtnLogin.IsEnabled = True
|
||||
BtnLogin.Text = "登录"
|
||||
End Sub)
|
||||
End Try
|
||||
End Sub, "Ms Login")
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
ComboName.ItemsSource = Nothing
|
||||
Else
|
||||
ComboName.ItemsSource = Setup.Get("LoginNideEmail").ToString.Split("¨")
|
||||
ComboName.Text = Setup.Get("LoginNideEmail").ToString.Split("¨")(0)
|
||||
If Setup.Get("LoginRemember") Then TextPass.Password = Setup.Get("LoginNidePass").ToString.Split("¨")(0).Trim
|
||||
ComboName.Text = Setup.Get("LoginNideEmail").ToString.Before("¨")
|
||||
If Setup.Get("LoginRemember") Then TextPass.Password = Setup.Get("LoginNidePass").ToString.Before("¨").Trim
|
||||
End If
|
||||
End If
|
||||
IsFirstLoad = False
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
For i = 0 To Folders.Count - 1
|
||||
If Folders(i) = "" Then Exit For
|
||||
If Folders(i).ToString.EndsWith(Folder.Path) Then
|
||||
Name = Folders(i).ToString.Split(">")(0)
|
||||
Name = Folders(i).ToString.Before(">")
|
||||
Folders.RemoveAt(i)
|
||||
Exit For
|
||||
End If
|
||||
@@ -320,7 +320,7 @@
|
||||
For i = 0 To Folders.Count - 1
|
||||
If Folders(i) = "" Then Exit For
|
||||
If Folders(i).ToString.EndsWith(Folder.Path) Then
|
||||
'Name = Folders(i).ToString.Split(">")(0)
|
||||
'Name = Folders(i).ToString.Before(">")
|
||||
Folders.RemoveAt(i)
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Text="游戏窗口标题" Margin="0,0,25,0" />
|
||||
<local:MyTextBox x:Name="TextArgumentTitle" Grid.Row="0" Grid.ColumnSpan="2" Tag="LaunchArgumentTitle" Grid.Column="1" ToolTip="自定义游戏窗口的标题,若留空则不进行更改。
支持以下替换标记:
 · {user}:玩家名字
 · {login}:玩家的登录方式
 · {name}:游戏版本名
 · {date}、{time}:当前的系统时间
 · {version}:游戏对应的原版版本号" HintText="默认" MaxLength="100" />
|
||||
<TextBlock Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Text="自定义信息" Margin="0,0,25,0" />
|
||||
<local:MyTextBox x:Name="TextArgumentInfo" Grid.Row="2" Grid.ColumnSpan="2" Tag="LaunchArgumentInfo" Text="Plain Craft Launcher 2" Grid.Column="1" ToolTip="该信息会显示在游戏主界面的左下角,与 F3 调试页面的左上角">
|
||||
<local:MyTextBox x:Name="TextArgumentInfo" Grid.Row="2" Grid.ColumnSpan="2" Tag="LaunchArgumentInfo" Text="PCL" Grid.Column="1" ToolTip="该信息会显示在游戏主界面的左下角,与 F3 调试页面的左上角">
|
||||
<local:MyTextBox.ValidateRules>
|
||||
<local:ValidateExcept>
|
||||
<local:ValidateExcept.Excepts>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
ToolTip="下载 Mod 时,若该 Mod 支持 Forge 和 Fabric,则显示为支持任意 Mod 加载器。
例如,开启时 JEI 显示支持全版本,关闭后 JEI 就会显示仅支持 Forge / Fabric 全版本。" />
|
||||
<local:MyCheckBox Margin="0,2,0,4" Text="验证 SSL 证书" Grid.Row="9" Height="22" Grid.ColumnSpan="2"
|
||||
x:Name="CheckDownloadCert" Tag="ToolDownloadCert"
|
||||
ToolTip="在进行连接时,检查 SSL 证书是否正常。
进行验证会提高安全性,但疑似会导致少部分玩家的微软登录失败。" />
|
||||
ToolTip="验证证书会提高安全性,但疑似有概率导致正版登录失败(#3018)。
如果在正版登录时因为 [根据验证过程,远程证书无效] 失败,可以尝试关闭此项。" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</local:MyCard>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Public Class PageSpeedLeft
|
||||
Imports System.Threading.Tasks
|
||||
|
||||
Public Class PageSpeedLeft
|
||||
Private Const WatcherInterval As Integer = 300
|
||||
|
||||
'初始化
|
||||
@@ -59,8 +61,8 @@
|
||||
If FrmSpeedRight Is Nothing OrElse FrmSpeedRight.PanMain Is Nothing Then Exit Sub
|
||||
Try
|
||||
SyncLock LoaderTaskbarLock
|
||||
For i = 0 To LoaderTaskbar.Count - 1
|
||||
TaskRefresh(LoaderTaskbar(i))
|
||||
For Each Loader In LoaderTaskbar.ToList
|
||||
TaskRefresh(Loader)
|
||||
Next
|
||||
End SyncLock
|
||||
Catch ex As Exception
|
||||
@@ -110,7 +112,7 @@
|
||||
#Region "进度不同,更新卡片"
|
||||
Try
|
||||
If Card.Children.Count < LoaderList.Count * 2 Then
|
||||
Log("刷新下载管理卡片失败:卡片中仅有 " & Card.Children.Count & " 个子项", LogLevel.Debug)
|
||||
Log($"[Watcher] 刷新下载管理卡片 {Loader.Name} 失败:卡片中仅有 {Card.Children.Count} 个子项,要求至少有 {LoaderList.Count * 2} 个子项", LogLevel.Debug)
|
||||
Exit Try
|
||||
End If
|
||||
Dim Row As Integer = 0
|
||||
@@ -137,7 +139,7 @@
|
||||
Row += 1
|
||||
Next
|
||||
Catch ex As Exception
|
||||
Log(ex, "刷新下载管理卡片失败", LogLevel.Feedback)
|
||||
Log(ex, $"刷新下载管理卡片 {Loader.Name} 失败", LogLevel.Feedback)
|
||||
End Try
|
||||
#End Region
|
||||
End Select
|
||||
@@ -191,13 +193,18 @@
|
||||
'添加取消按钮
|
||||
Dim Cancel As New MyIconButton With {.Name = "BtnCancel", .Logo = "F1 M2,0 L0,2 8,10 0,18 2,20 10,12 18,20 20,18 12,10 20,2 18,0 10,8 2,0Z", .Height = 20, .Margin = New Thickness(0, 10, 10, 0), .LogoScale = 1.1, .HorizontalAlignment = HorizontalAlignment.Right, .VerticalAlignment = VerticalAlignment.Top}
|
||||
Card.Children.Add(Cancel)
|
||||
AddHandler Cancel.Click, Sub(sender As MyIconButton, e As EventArgs)
|
||||
AniDispose(sender, False)
|
||||
AniDispose(Card, True, Sub() If FrmSpeedRight.PanMain.Children.Count = 0 AndAlso FrmMain.PageCurrent = FormMain.PageType.DownloadManager Then FrmMain.PageBack())
|
||||
RightCards.Remove(Loader.Name)
|
||||
Log($"[Watcher] 关闭下载管理卡片:{Loader.Name}")
|
||||
RunInThread(Sub() Loader.Abort())
|
||||
End Sub
|
||||
AddHandler Cancel.Click,
|
||||
Sub(sender As MyIconButton, e As EventArgs)
|
||||
AniDispose(sender, False)
|
||||
AniDispose(Card, True, Sub() If FrmSpeedRight.PanMain.Children.Count = 0 AndAlso FrmMain.PageCurrent = FormMain.PageType.DownloadManager Then FrmMain.PageBack())
|
||||
RightCards.Remove(Loader.Name)
|
||||
SyncLock LoaderTaskbarLock
|
||||
LoaderTaskbar.Remove(Loader)
|
||||
Log($"[Taskbar] 由于下载管理卡片关闭,{Loader.Name} 已移出任务列表")
|
||||
End SyncLock
|
||||
Log($"[Watcher] 关闭下载管理卡片:{Loader.Name}")
|
||||
RunInThread(Sub() Loader.Abort())
|
||||
End Sub
|
||||
'如果已经失败,再刷新一次,修改成失败的控件
|
||||
If Loader.State = LoadState.Failed Then
|
||||
Card.Tag = Nothing '避免重复导致刷新无效
|
||||
|
||||
Reference in New Issue
Block a user