diff --git a/Plain Craft Launcher 2/App.config b/Plain Craft Launcher 2/App.config index 7ea53f51..57f4dae1 100644 --- a/Plain Craft Launcher 2/App.config +++ b/Plain Craft Launcher 2/App.config @@ -9,7 +9,8 @@ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/> </startup> <runtime> - <AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false" /> + <AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false"/> + <AppContextSwitchOverrides value="Switch.System.Windows.DoNotScaleForDpiChanges=false"/> <generatePublisherEvidence enabled="false"/> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> diff --git a/Plain Craft Launcher 2/Modules/Base/ModBase.vb b/Plain Craft Launcher 2/Modules/Base/ModBase.vb index dac3980c..8b5fde8f 100644 --- a/Plain Craft Launcher 2/Modules/Base/ModBase.vb +++ b/Plain Craft Launcher 2/Modules/Base/ModBase.vb @@ -1975,12 +1975,13 @@ RetryDir: End Function ''' <summary> - ''' 判断当前系统语言是否为中文。 + ''' 判断当前系统语言是否为中文(中国大陆)。 ''' </summary> Public Function IsSystemLanguageChinese() As Boolean - Return CultureInfo.CurrentCulture.TwoLetterISOLanguageName = "zh" OrElse CultureInfo.CurrentUICulture.TwoLetterISOLanguageName = "zh" + Return CultureInfo.CurrentCulture.Name = "zh-CN" OrElse CultureInfo.CurrentUICulture.Name = "zh-CN" End Function + Private Uuid As Integer = 1 Private UuidLock As Object ''' <summary> diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb b/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb index 36cc7ee5..67239766 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb @@ -434,7 +434,10 @@ Public Function ToCompItem(ShowMcVersionDesc As Boolean, ShowLoaderDesc As Boolean) As MyCompItem '获取版本描述 Dim GameVersionDescription As String - If GameVersions Is Nothing OrElse Not GameVersions.Any() Then + Dim AllSnapshot As Boolean = GameVersions.All(Function(v) RegexCheck(v, "[0-9]{2}w[0-9]{2}[a-z]{1}")) + If AllSnapshot Then + GameVersionDescription = "仅快照版本" + ElseIf GameVersions Is Nothing OrElse Not GameVersions.Any() Then GameVersionDescription = "未知" Else Dim SpaVersions As New List(Of String) @@ -493,12 +496,19 @@ ModLoaderDescriptionFull = "仅 " & ModLoadersForDesc.Single.ToString ModLoaderDescriptionPart = ModLoadersForDesc.Single.ToString Case Else - If ModLoaders.Contains(CompModLoaderType.Forge) AndAlso + If ModLoaders.Contains(CompModLoaderType.Forge) AndAlso Not AllSnapshot AndAlso (GameVersions.Max < 14 OrElse ModLoaders.Contains(CompModLoaderType.Fabric)) AndAlso (GameVersions.Max < 20 OrElse ModLoaders.Contains(CompModLoaderType.NeoForge)) AndAlso (GameVersions.Max < 14 OrElse ModLoaders.Contains(CompModLoaderType.Quilt) OrElse Setup.Get("ToolDownloadIgnoreQuilt")) Then ModLoaderDescriptionFull = "任意" ModLoaderDescriptionPart = "" + ElseIf AllSnapshot AndAlso + ModLoaders.Contains(CompModLoaderType.Forge) AndAlso + ModLoaders.Contains(CompModLoaderType.Fabric) AndAlso + ModLoaders.Contains(CompModLoaderType.NeoForge) AndAlso + (ModLoaders.Contains(CompModLoaderType.Quilt) OrElse Setup.Get("ToolDownloadIgnoreQuilt")) Then + ModLoaderDescriptionFull = "任意" + ModLoaderDescriptionPart = "" Else ModLoaderDescriptionFull = ModLoadersForDesc.Join(" / ") ModLoaderDescriptionPart = ModLoadersForDesc.Join(" / ") @@ -1481,7 +1491,9 @@ Retry: If Deps.Any Then For Each DepProject In Deps.Where(Function(id) CompProjectCache.ContainsKey(id)).Select(Function(id) CompProjectCache(id)) For Each File In CompFilesCache(ProjectId) - If File.RawDependencies.Contains(DepProject.Id) AndAlso DepProject.Id <> ProjectId Then + If File.RawDependencies.Contains(DepProject.Id) AndAlso + DepProject.Id <> ProjectId AndAlso + Not File.Dependencies.Contains(DepProject.Id) Then File.Dependencies.Add(DepProject.Id) End If Next diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb index 97f22535..320b0b3c 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb @@ -684,7 +684,7 @@ LoginFinish: Url:=Data.Input.BaseUrl & "/validate", Method:="POST", Data:=RequestData.ToString(0), - Headers:=New Dictionary(Of String, String) From {{"Accept-Language", "zh_CN"}}, + Headers:=New Dictionary(Of String, String) From {{"Accept-Language", "zh-CN"}}, ContentType:="application/json; charset=utf-8") '没有返回值的 '将登录结果输出 Data.Output.AccessToken = AccessToken @@ -742,7 +742,7 @@ LoginFinish: ""name"":""" & Setup.Get("Cache" & Data.Input.Token & "Name") & """},", "") & " ""accessToken"":""" & Setup.Get("Cache" & Data.Input.Token & "Access") & """, ""clientToken"":""" & Setup.Get("Cache" & Data.Input.Token & "Client") & """}", - Headers:=New Dictionary(Of String, String) From {{"Accept-Language", "zh_CN"}}, + Headers:=New Dictionary(Of String, String) From {{"Accept-Language", "zh-CN"}}, ContentType:="application/json; charset=utf-8")) '将登录结果输出 If LoginJson("selectedProfile") Is Nothing Then Throw New Exception("选择的角色 " & Setup.Get("Cache" & Data.Input.Token & "Name") & " 无效!") @@ -810,7 +810,7 @@ LoginFinish: Url:=Data.Input.BaseUrl & "/authenticate", Method:="POST", Data:=RequestData.ToString(0), - Headers:=New Dictionary(Of String, String) From {{"Accept-Language", "zh_CN"}}, + Headers:=New Dictionary(Of String, String) From {{"Accept-Language", "zh-CN"}}, ContentType:="application/json; charset=utf-8")) diff --git a/Plain Craft Launcher 2/Modules/Minecraft/MyLocalModItem.xaml.vb b/Plain Craft Launcher 2/Modules/Minecraft/MyLocalModItem.xaml.vb index f826928d..9acbea9d 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/MyLocalModItem.xaml.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/MyLocalModItem.xaml.vb @@ -138,8 +138,13 @@ Public Class MyLocalModItem End If '计算滑动范围 Dim Index = CType(Parent, StackPanel).Children.IndexOf(Me) + If Index < 0 OrElse Index >= CType(Parent, StackPanel).Children.Count Then Exit Sub SwipeStart = Math.Min(SwipeStart, Index) SwipeEnd = Math.Max(SwipeEnd, Index) + If SwipeStart < 0 Then SwipeStart = 0 + If SwipeEnd < 0 Then SwipeEnd = 0 + If SwipeStart >= CType(Parent, StackPanel).Children.Count Then SwipeStart = CType(Parent, StackPanel).Children.Count - 1 + If SwipeEnd >= CType(Parent, StackPanel).Children.Count Then SwipeEnd = CType(Parent, StackPanel).Children.Count - 1 '勾选所有范围中的项 If SwipeStart = SwipeEnd Then Exit Sub For i = SwipeStart To SwipeEnd diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml index 28f238f5..1d16b98a 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml +++ b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml @@ -26,7 +26,7 @@ </local:MyCard> <StackPanel Name="PanResults" /> </StackPanel> - <local:MyCard Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True" x:Name="PanLoad" UseAnimation="False" Margin="0,0,0,8"> + <local:MyCard Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True" x:Name="PanLoad" UseAnimation="False" Margin="0,0,0,8"> <local:MyLoading Text="正在获取版本列表" Margin="20,20,20,17" x:Name="Load" HorizontalAlignment="Center" VerticalAlignment="Center" /> </local:MyCard> </Grid> diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml.vb b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml.vb index c988751a..5ee8fd75 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml.vb +++ b/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompDetail.xaml.vb @@ -79,7 +79,7 @@ 'UI 化筛选器 PanFilter.Children.Clear() - If VersionFilters.Count <= 2 Then + If VersionFilters.Count < 2 Then CardFilter.Visibility = Visibility.Collapsed VersionFilter = Nothing Else diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.vb b/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.vb index 6d1ef201..9660a64a 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.vb +++ b/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.vb @@ -242,7 +242,8 @@ Retry: {"Vanilla", "原版披风"}, {"Minecon2011", "Minecon 2011 参与者披风"}, {"Minecon2012", "Minecon 2012 参与者披风"}, {"Minecon2013", "Minecon 2013 参与者披风"}, {"Minecon2015", "Minecon 2015 参与者披风"}, {"Minecon2016", "Minecon 2016 参与者披风"}, {"Cherry Blossom", "樱花披风"}, {"15th Anniversary", "15 周年纪念披风"}, {"Purple Heart", "紫色心形披风"}, - {"Follower's", "追随者披风"}, {"MCC 15th Year", "MCC 15 周年披风"}, {"Minecraft Experience", "村民救援披风"} + {"Follower's", "追随者披风"}, {"MCC 15th Year", "MCC 15 周年披风"}, {"Minecraft Experience", "村民救援披风"}, + {"Mojang Office", "Mojang 办公室披风"} } Dim SelectionControl As New List(Of IMyRadio) From {New MyRadioBox With {.Text = "无披风"}} For Each Cape In SkinData("capes") diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml b/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml index 0e2f9127..cc8949cf 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml +++ b/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml @@ -263,7 +263,7 @@ <ColumnDefinition Width="0.8*" /> <ColumnDefinition Width="0.9*" /> <ColumnDefinition Width="0.8*" /> - <ColumnDefinition Width="0.6*" /> + <ColumnDefinition Width="0.8*" /> <ColumnDefinition Width="1.0*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> diff --git a/Plain Craft Launcher 2/app.manifest b/Plain Craft Launcher 2/app.manifest index 2d4820fb..6be9dd1d 100644 --- a/Plain Craft Launcher 2/app.manifest +++ b/Plain Craft Launcher 2/app.manifest @@ -48,13 +48,15 @@ 自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需 选择加入。选择加入此设置的 Windows 窗体应用程序(目标设定为 .NET Framework 4.6 )还应 在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。--> - <!-- <application xmlns="urn:schemas-microsoft-com:asm.v3"> <windowsSettings> + <!-- The combination of below two tags have the following effect : + 1. Per-Monitor for >= Windows 10 Anniversary Update + 2. System < Windows 10 Anniversary Update --> + <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness> <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware> </windowsSettings> </application> - --> <!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) --> <dependency>