This commit is contained in:
龙腾猫跃
2023-08-21 04:02:19 +08:00
parent 79778490d5
commit 41250d8387
12 changed files with 818 additions and 505 deletions
+34 -1
View File
@@ -49,7 +49,6 @@
End Property End Property
Public RelativeSetup As String = "" Public RelativeSetup As String = ""
Private Sub MyHint_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded Private Sub MyHint_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
If CanClose AndAlso Setup.Get(RelativeSetup) Then If CanClose AndAlso Setup.Get(RelativeSetup) Then
Visibility = Visibility.Collapsed Visibility = Visibility.Collapsed
@@ -60,6 +59,40 @@
AniDispose(Me, False) AniDispose(Me, False)
End Sub End Sub
'触发点击事件
Private IsMouseDown As Boolean = False
Private Sub MyHint_MouseUp(sender As Object, e As MouseButtonEventArgs) Handles Me.MouseLeftButtonUp
If Not IsMouseDown Then Return
IsMouseDown = False
Log("[Control] 按下提示条" & If(String.IsNullOrEmpty(Name), "", ":" & Name))
e.Handled = True
ModEvent.TryStartEvent(EventType, EventData)
End Sub
Private Sub MyHint_MouseDown(sender As Object, e As MouseButtonEventArgs) Handles Me.MouseLeftButtonDown
IsMouseDown = True
End Sub
Private Sub MyHint_MouseLeave() Handles Me.MouseLeave
IsMouseDown = False
End Sub
Public Property EventType As String
Get
Return GetValue(EventTypeProperty)
End Get
Set(value As String)
SetValue(EventTypeProperty, value)
End Set
End Property
Public Shared ReadOnly EventTypeProperty As DependencyProperty = DependencyProperty.Register("EventType", GetType(String), GetType(MyHint), New PropertyMetadata(Nothing))
Public Property EventData As String
Get
Return GetValue(EventDataProperty)
End Get
Set(value As String)
SetValue(EventDataProperty, value)
End Set
End Property
Public Shared ReadOnly EventDataProperty As DependencyProperty = DependencyProperty.Register("EventData", GetType(String), GetType(MyHint), New PropertyMetadata(Nothing))
End Class End Class
Partial Public Module ModAnimation Partial Public Module ModAnimation
Public Sub AniDispose(Control As MyHint, RemoveFromChildren As Boolean, Optional CallBack As ParameterizedThreadStart = Nothing) Public Sub AniDispose(Control As MyHint, RemoveFromChildren As Boolean, Optional CallBack As ParameterizedThreadStart = Nothing)
+14
View File
@@ -10,6 +10,15 @@ Public Class FormMain
Dim FeatureList As New List(Of KeyValuePair(Of Integer, String)) Dim FeatureList As New List(Of KeyValuePair(Of Integer, String))
'统计更新日志条目 '统计更新日志条目
#If BETA Then #If BETA Then
If LastVersion < 300 Then 'Release 2.6.6
FeatureList.Add(New KeyValuePair(Of Integer, String)(3, "修复网络条件差时可能无法下载 MC 的 Bug"))
FeatureList.Add(New KeyValuePair(Of Integer, String)(3, "支持选择多种预设的主页"))
FeatureList.Add(New KeyValuePair(Of Integer, String)(3, "Mod 管理中允许多选 Mod 进行批量操作"))
FeatureList.Add(New KeyValuePair(Of Integer, String)(2, "优化崩溃分析,添加多种崩溃情况的判断"))
FeatureList.Add(New KeyValuePair(Of Integer, String)(2, "优化联网获取的主页的加载与缓存"))
FeatureCount += 40
BugCount += 34
End If
If LastVersion < 296 Then 'Release 2.6.3 If LastVersion < 296 Then 'Release 2.6.3
FeatureList.Add(New KeyValuePair(Of Integer, String)(4, "新增内存优化功能,可以将所有程序的物理内存占用降低约 1/3")) FeatureList.Add(New KeyValuePair(Of Integer, String)(4, "新增内存优化功能,可以将所有程序的物理内存占用降低约 1/3"))
FeatureList.Add(New KeyValuePair(Of Integer, String)(2, "在选择 OptiFine 与 Fabric 后会自动选择 OptiFabric")) FeatureList.Add(New KeyValuePair(Of Integer, String)(2, "在选择 OptiFine 与 Fabric 后会自动选择 OptiFabric"))
@@ -116,6 +125,11 @@ Public Class FormMain
'3:BUG+ IMP* FEAT- '3:BUG+ IMP* FEAT-
'2:BUG* IMP- '2:BUG* IMP-
'1:BUG- '1:BUG-
If LastVersion < 301 Then 'Snapshot 2.6.6
FeatureList.Add(New KeyValuePair(Of Integer, String)(3, "修复网络条件差时可能无法下载 MC 的 Bug"))
FeatureCount += 4
BugCount += 2
End If
If LastVersion < 299 Then 'Snapshot 2.6.5 If LastVersion < 299 Then 'Snapshot 2.6.5
FeatureList.Add(New KeyValuePair(Of Integer, String)(3, "支持选择多种预设的主页")) FeatureList.Add(New KeyValuePair(Of Integer, String)(3, "支持选择多种预设的主页"))
FeatureList.Add(New KeyValuePair(Of Integer, String)(2, "优化联网获取的主页的加载与缓存")) FeatureList.Add(New KeyValuePair(Of Integer, String)(2, "优化联网获取的主页的加载与缓存"))
@@ -11,12 +11,12 @@ Public Module ModBase
#Region "声明" #Region "声明"
'下列版本信息由更新器自动修改 '下列版本信息由更新器自动修改
Public Const VersionBaseName As String = "2.6.5" '不含分支前缀的显示用版本名 Public Const VersionBaseName As String = "2.6.6" '不含分支前缀的显示用版本名
Public Const VersionStandardCode As String = "2.6.5." & VersionBranchCode '标准格式的四段式版本号 Public Const VersionStandardCode As String = "2.6.6." & VersionBranchCode '标准格式的四段式版本号
#If BETA Then #If BETA Then
Public Const VersionCode As Integer = 296 'Release Public Const VersionCode As Integer = 300 'Release
#Else #Else
Public Const VersionCode As Integer = 299 'Snapshot Public Const VersionCode As Integer = 301 'Snapshot
#End If #End If
'自动生成的版本信息 '自动生成的版本信息
Public Const VersionDisplayName As String = VersionBranchName & " " & VersionBaseName Public Const VersionDisplayName As String = VersionBranchName & " " & VersionBaseName
@@ -421,7 +421,7 @@
Dim NewItem As New MyCompItem With {.Tag = Me} Dim NewItem As New MyCompItem With {.Tag = Me}
'整理 FinalName 与 ExNameList '整理 FinalName 与 ExNameList
'检查下列代码时可以参考 #1567 的测试例 '检查下列代码时可以参考 #1567 的测试例
Dim FinalName As String Dim FinalName As String = RawName
Dim ExNameList As List(Of String) Dim ExNameList As List(Of String)
If TranslatedName = RawName Then If TranslatedName = RawName Then
'没有中文翻译 '没有中文翻译
@@ -476,7 +476,7 @@
'显示 FinalName 与 ExNameList '显示 FinalName 与 ExNameList
If ExNameList.Count = 0 Then If ExNameList.Count = 0 Then
NoExName: NoExName:
NewItem.LabTitle.Text = RawName NewItem.LabTitle.Text = FinalName
CType(NewItem.LabTitleRaw.Parent, StackPanel).Children.Remove(NewItem.LabTitleRaw) CType(NewItem.LabTitleRaw.Parent, StackPanel).Children.Remove(NewItem.LabTitleRaw)
Else Else
NewItem.LabTitle.Text = FinalName NewItem.LabTitle.Text = FinalName
@@ -52,7 +52,7 @@
If IndexUrl = "" Then If IndexUrl = "" Then
Return Nothing Return Nothing
Else Else
Return New NetFile(DlSourceLauncherOrMetaGet(IndexUrl, False), IndexAddress, New FileChecker(CanUseExistsFile:=False, IsJson:=True)) Return New NetFile(DlSourceLauncherOrMetaGet(IndexUrl), IndexAddress, New FileChecker(CanUseExistsFile:=False, IsJson:=True))
End If End If
End Function End Function
@@ -960,34 +960,27 @@
Public Function DlSourceResourceGet(MojangBase As String) As String() Public Function DlSourceResourceGet(MojangBase As String) As String()
MojangBase = MojangBase.Replace("http://resources.download.minecraft.net", "https://resources.download.minecraft.net") MojangBase = MojangBase.Replace("http://resources.download.minecraft.net", "https://resources.download.minecraft.net")
Return {MojangBase.Replace("https://resources.download.minecraft.net", "https://download.mcbbs.net/assets"), Return {MojangBase.Replace("https://piston-meta.mojang.com", "https://download.mcbbs.net/assets").Replace("https://resources.download.minecraft.net", "https://download.mcbbs.net/assets"),
MojangBase, MojangBase,
MojangBase.Replace("https://resources.download.minecraft.net", "https://bmclapi2.bangbang93.com/assets") MojangBase.Replace("https://piston-meta.mojang.com", "https://bmclapi2.bangbang93.com/assets").Replace("https://resources.download.minecraft.net", "https://bmclapi2.bangbang93.com/assets")
} }
End Function End Function
Public Function DlSourceLibraryGet(MojangBase As String) As String() Public Function DlSourceLibraryGet(MojangBase As String) As String()
Return {MojangBase.Replace("https://libraries.minecraft.net", "https://download.mcbbs.net/maven"), Return {MojangBase.Replace("https://piston-meta.mojang.com", "https://download.mcbbs.net/maven").Replace("https://libraries.minecraft.net", "https://download.mcbbs.net/maven"),
MojangBase.Replace("https://libraries.minecraft.net", "https://download.mcbbs.net/libraries"), MojangBase.Replace("https://piston-meta.mojang.com", "https://download.mcbbs.net/libraries").Replace("https://libraries.minecraft.net", "https://download.mcbbs.net/libraries"),
MojangBase, MojangBase,
MojangBase.Replace("https://libraries.minecraft.net", "https://bmclapi2.bangbang93.com/maven"), MojangBase.Replace("https://piston-meta.mojang.com", "https://bmclapi2.bangbang93.com/maven").Replace("https://libraries.minecraft.net", "https://bmclapi2.bangbang93.com/maven"),
MojangBase.Replace("https://libraries.minecraft.net", "https://bmclapi2.bangbang93.com/libraries") MojangBase.Replace("https://piston-meta.mojang.com", "https://bmclapi2.bangbang93.com/libraries").Replace("https://libraries.minecraft.net", "https://bmclapi2.bangbang93.com/libraries")
} }
End Function End Function
Public Function DlSourceLauncherOrMetaGet(MojangBase As String, Optional IsStatic As Boolean = True) As String() Public Function DlSourceLauncherOrMetaGet(MojangBase As String) As String()
If MojangBase Is Nothing Then Throw New Exception("无对应的 json 下载地址") If MojangBase Is Nothing Then Throw New Exception("无对应的 json 下载地址")
If IsStatic Then Return {MojangBase.Replace("https://piston-meta.mojang.com", "https://download.mcbbs.net").Replace("https://launcher.mojang.com", "https://download.mcbbs.net").Replace("https://launchermeta.mojang.com", "https://download.mcbbs.net"),
Return {MojangBase.Replace("https://launcher.mojang.com", "https://download.mcbbs.net").Replace("https://launchermeta.mojang.com", "https://download.mcbbs.net"),
MojangBase, MojangBase,
MojangBase.Replace("https://launcher.mojang.com", "https://bmclapi2.bangbang93.com").Replace("https://launchermeta.mojang.com", "https://bmclapi2.bangbang93.com") MojangBase.Replace("https://piston-meta.mojang.com", "https://bmclapi2.bangbang93.com").Replace("https://launcher.mojang.com", "https://bmclapi2.bangbang93.com").Replace("https://launchermeta.mojang.com", "https://bmclapi2.bangbang93.com")
} }
Else
Return {MojangBase.Replace("https://launcher.mojang.com", "https://download.mcbbs.net").Replace("https://launchermeta.mojang.com", "https://download.mcbbs.net"),
MojangBase,
MojangBase.Replace("https://launcher.mojang.com", "https://bmclapi2.bangbang93.com").Replace("https://launchermeta.mojang.com", "https://bmclapi2.bangbang93.com")
}
End If
End Function End Function
Private Sub DlSourceLoader(Of InputType, OutputType)(MainLoader As LoaderTask(Of InputType, OutputType), Private Sub DlSourceLoader(Of InputType, OutputType)(MainLoader As LoaderTask(Of InputType, OutputType),
@@ -51,6 +51,6 @@ Imports System.Runtime.InteropServices
' 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 ' 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
' 方法是按如下所示使用“*” ' 方法是按如下所示使用“*”
<Assembly: AssemblyVersion("2.6.5.0")> <Assembly: AssemblyVersion("2.6.6.0")>
<Assembly: AssemblyFileVersion("2.6.5.0")> <Assembly: AssemblyFileVersion("2.6.6.0")>
<Assembly: NeutralResourcesLanguage("")> <Assembly: NeutralResourcesLanguage("")>
@@ -114,6 +114,7 @@
TextSearchName.Text = "" TextSearchName.Text = ""
TextSearchVersion.Text = "全部 (也可自行输入)" TextSearchVersion.Text = "全部 (也可自行输入)"
TextSearchVersion.SelectedIndex = 0 TextSearchVersion.SelectedIndex = 0
ComboSearchSource.SelectedIndex = 0
ComboSearchTag.SelectedIndex = 0 ComboSearchTag.SelectedIndex = 0
ComboSearchLoader.SelectedIndex = 0 ComboSearchLoader.SelectedIndex = 0
Loader.LastFinishedTime = 0 '要求强制重新开始 Loader.LastFinishedTime = 0 '要求强制重新开始
@@ -116,6 +116,7 @@
TextSearchName.Text = "" TextSearchName.Text = ""
TextSearchVersion.Text = "全部 (也可自行输入)" TextSearchVersion.Text = "全部 (也可自行输入)"
TextSearchVersion.SelectedIndex = 0 TextSearchVersion.SelectedIndex = 0
ComboSearchSource.SelectedIndex = 0
ComboSearchTag.SelectedIndex = 0 ComboSearchTag.SelectedIndex = 0
Loader.LastFinishedTime = 0 '要求强制重新开始 Loader.LastFinishedTime = 0 '要求强制重新开始
End Sub End Sub
@@ -86,7 +86,7 @@ Download:
</local:MyCard>" </local:MyCard>"
Case 2 '新闻主页 Case 2 '新闻主页
Log("[Page] 主页预设:Minecraft 新闻") Log("[Page] 主页预设:Minecraft 新闻")
Url = "https://news.bugjump.net" Url = "http://pcl2.mc-news.top"
GoTo Download GoTo Download
End Select End Select
End Select End Select
@@ -136,7 +136,11 @@ Download:
'要求刷新 '要求刷新
Refresh() Refresh()
Catch ex As Exception Catch ex As Exception
Log(ex, $"联网下载自定义主页失败({Task.Input})", LogLevel.Hint) If Setup.Get("CacheSavedPageVersion") = "" Then
Log(ex, $"联网下载自定义主页失败({Task.Input})", LogLevel.Msgbox)
Else
Log(ex, $"联网下载自定义主页失败({Task.Input})")
End If
Task.Input = "" Task.Input = ""
End Try End Try
End Sub End Sub
@@ -165,7 +165,7 @@
</local:MyCard> </local:MyCard>
<local:MyCard Margin="0,0,0,15" Title="游戏内存"> <local:MyCard Margin="0,0,0,15" Title="游戏内存">
<StackPanel Margin="25,40,25,15"> <StackPanel Margin="25,40,25,15">
<local:MyHint x:Name="LabRamWarn" CanClose="False" Text="32 位 Java 最多只能分配 1 GB 内存,建议安装 64 位 Java!" IsWarn="True" Margin="0,0,0,12" /> <local:MyHint x:Name="LabRamWarn" Text="32 位 Java 最多只能分配 1 GB 内存,建议安装 64 位 Java!" IsWarn="True" Margin="0,0,0,12" />
<Grid Margin="0,0,0,3"> <Grid Margin="0,0,0,3">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
@@ -58,7 +58,7 @@
</local:MyCard> </local:MyCard>
<local:MyCard Margin="0,0,0,15" Title="游戏内存"> <local:MyCard Margin="0,0,0,15" Title="游戏内存">
<StackPanel Margin="25,40,25,15"> <StackPanel Margin="25,40,25,15">
<local:MyHint x:Name="LabRamWarn" CanClose="False" Text="32 位 Java 最多只能分配 1 GB 内存,建议安装 64 位 Java!" IsWarn="True" Margin="0,0,0,12" /> <local:MyHint x:Name="LabRamWarn" Text="32 位 Java 最多只能分配 1 GB 内存,建议安装 64 位 Java!" IsWarn="True" Margin="0,0,0,12" />
<Grid Margin="0,0,0,3"> <Grid Margin="0,0,0,3">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
File diff suppressed because it is too large Load Diff