龙腾猫跃 3 лет назад
Родитель
Сommit
b06328645c

+ 1 - 1
Plain Craft Launcher 2/Controls/MyListItem.xaml.vb

@@ -231,7 +231,7 @@
                             .RenderTransform = New ScaleTransform With {.ScaleX = LogoScale, .ScaleY = LogoScale},
                             .SnapsToDevicePixels = True, .UseLayoutRounding = False}
                     RenderOptions.SetBitmapScalingMode(PathLogo, BitmapScalingMode.Linear)
-                ElseIf _Logo.ToLower.EndsWith(".png") Then
+                ElseIf _Logo.ToLower.EndsWith(".png") OrElse _Logo.ToLower.EndsWith(".jpg") Then
                     '位图
                     Dim Bitmap = New MyBitmap(_Logo)
                     PathLogo = New Canvas With {

+ 13 - 11
Plain Craft Launcher 2/Controls/MySlider.xaml.vb

@@ -84,12 +84,8 @@
         AniStart({
                  AaScaleTransform(ShapeDot, 1.3 - CType(ShapeDot.RenderTransform, ScaleTransform).ScaleX, 40,, New AniEaseOutFluent)
             }, "MySlider Scale " & Uuid)
-        '更新 Popup
-        If GetHintText IsNot Nothing Then
-            TextHint.Text = GetHintText.DynamicInvoke(Value)
-            Popup.IsOpen = True
-            AniStop("MySlider KeyPopup " & Uuid)
-        End If
+        RefreshPopup()
+        AniStop("MySlider KeyPopup " & Uuid)
     End Sub
     Public Sub DragDoing()
         Dim Percent As Double = MathRange((Mouse.GetPosition(PanMain).X - ShapeDot.Width / 2) / (ActualWidth - ShapeDot.Width), 0, 1)
@@ -97,15 +93,22 @@
         If Not NewValue = Value Then
             Value = NewValue
         End If
-        '更新 Popup
-        If GetHintText IsNot Nothing Then TextHint.Text = GetHintText.DynamicInvoke(NewValue)
+        RefreshPopup()
     End Sub
     Public Sub DragStop()
         RefreshColor()
         AniStart({
                  AaScaleTransform(ShapeDot, 1 - CType(ShapeDot.RenderTransform, ScaleTransform).ScaleX, 200,, New AniEaseOutFluent)
             }, "MySlider Scale " & Uuid)
-        If GetHintText IsNot Nothing Then Popup.IsOpen = False
+        Popup.IsOpen = False
+    End Sub
+    Public Sub RefreshPopup()
+        If GetHintText Is Nothing Then Exit Sub
+        Popup.IsOpen = True
+        TextHint.Text = GetHintText.DynamicInvoke(Value)
+        Dim typeface As New Typeface(TextHint.FontFamily, TextHint.FontStyle, TextHint.FontWeight, TextHint.FontStretch)
+        Dim formattedText As New FormattedText(TextHint.Text, Thread.CurrentThread.CurrentCulture, TextHint.FlowDirection, typeface, TextHint.FontSize, TextHint.Foreground, DPI)
+        TextHint.Width = formattedText.Width '使用手动测量的宽度修复 #1057
     End Sub
 
     '指向动画
@@ -179,8 +182,7 @@
         End If
         '更新 Popup
         If GetHintText IsNot Nothing Then
-            TextHint.Text = GetHintText.DynamicInvoke(Value)
-            Popup.IsOpen = True
+            RefreshPopup()
             AniStop("MySlider KeyPopup " & Uuid)
             AniStart(AaCode(Sub() Popup.IsOpen = False, 700 * AniSpeed), "MySlider KeyPopup " & Uuid)
         End If

+ 15 - 2
Plain Craft Launcher 2/FormMain.xaml.vb

@@ -10,6 +10,10 @@ Public Class FormMain
         Dim FeatureList As New List(Of KeyValuePair(Of Integer, String))
         '统计更新日志条目
 #If BETA Then
+        If LastVersion < 279 Then 'Release 2.4.8
+            FeatureCount += 1
+            BugCount += 10
+        End If
         If LastVersion < 276 Then 'Release 2.4.7
             FeatureList.Add(New KeyValuePair(Of Integer, String)(4, "增加 在游戏启动前执行命令 设置"))
             FeatureList.Add(New KeyValuePair(Of Integer, String)(3, "在百宝箱添加了清理 MC 日志、崩溃报告的按钮"))
@@ -117,6 +121,14 @@ Public Class FormMain
         '3:BUG+ IMP* FEAT-
         '2:BUG* IMP-
         '1:BUG-
+        If LastVersion < 280 Then 'Snapshot 2.4.8
+            FeatureCount += 1
+            BugCount += 10
+        End If
+        If LastVersion < 278 Then 'Snapshot 2.4.7
+            If LastVersion = 277 Then FeatureList.Add(New KeyValuePair(Of Integer, String)(1, "修复设置背景音乐可能导致无法启动 PCL 的 Bug"))
+            BugCount += 2
+        End If
         If LastVersion < 278 Then 'Snapshot 2.4.7
             If LastVersion = 277 Then FeatureList.Add(New KeyValuePair(Of Integer, String)(1, "修复设置背景音乐可能导致无法启动 PCL 的 Bug"))
             BugCount += 2
@@ -797,7 +809,8 @@ Reopen:
                 If FilePathList.Count > 1 Then
                     '必须要求全部为 jar 文件
                     For Each File In FilePathList
-                        If File.Split(".").Last.ToLower <> "jar" Then
+                        Dim Extension As String = File.Split(".").Last.ToLower
+                        If Not {"jar", "litemod", "disabled"}.Contains(Extension) Then
                             Hint("一次请只拖入一个文件!", HintType.Critical)
                             Exit Sub
                         End If
@@ -809,7 +822,7 @@ Reopen:
                 RunInNewThread(Sub()
                                    Dim Extension As String = FilePath.Split(".").Last.ToLower
                                    'Mod 安装
-                                   If {"jar", "litemod"}.Contains(Extension) Then
+                                   If {"jar", "litemod", "disabled"}.Contains(Extension) Then
                                        Log("[System] 文件为 jar/litemod 格式,尝试作为 Mod 安装")
                                        '获取并检查目标版本
                                        Dim TargetVersion As McVersion = McVersionCurrent

+ 4 - 4
Plain Craft Launcher 2/Modules/Base/ModBase.vb

@@ -10,12 +10,12 @@ Public Module ModBase
 #Region "声明"
 
     '下列版本信息由更新器自动修改
-    Public Const VersionBaseName As String = "2.4.7" '不含分支前缀的显示用版本名
-    Public Const VersionStandardCode As String = "2.4.7." & VersionBranchCode '标准格式的四段式版本号
+    Public Const VersionBaseName As String = "2.4.8" '不含分支前缀的显示用版本名
+    Public Const VersionStandardCode As String = "2.4.8." & VersionBranchCode '标准格式的四段式版本号
 #If BETA Then
-    Public Const VersionCode As Integer = 276 'Release
+    Public Const VersionCode As Integer = 279 'Release
 #Else
-    Public Const VersionCode As Integer = 278 'Snapshot
+    Public Const VersionCode As Integer = 280 'Snapshot
 #End If
     '自动生成的版本信息
     Public Const VersionDisplayName As String = VersionBranchName & " " & VersionBaseName

+ 1 - 1
Plain Craft Launcher 2/Modules/Minecraft/ModCrash.vb

@@ -742,7 +742,7 @@ Redo:
                             Case "RawOutput.log"
                                 FileName = "游戏崩溃前的输出.txt"
                         End Select
-                        CopyFile(OutputFile, TempFolder & "Report\" & FileName)
+                        WriteFile(TempFolder & "Report\" & FileName, SecretFilter(ReadFile(OutputFile)))
                     Next
                     '导出报告
                     Compression.ZipFile.CreateFromDirectory(TempFolder & "Report\", FileAddress)

+ 4 - 3
Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb

@@ -62,6 +62,7 @@ Public Module ModLaunch
     ''' 记录启动日志。
     ''' </summary>
     Public Sub McLaunchLog(Text As String)
+        Text = SecretFilter(Text)
         RunInUi(Sub() FrmLaunchRight.LabLog.Text += vbCrLf & "[" & GetTimeNow() & "] " & Text)
         Log("[Launch] " & Text)
     End Sub
@@ -1325,7 +1326,7 @@ SystemBrowser:
         Arguments += " " & If(ArgumentGame = "", Setup.Get("LaunchAdvanceGame"), ArgumentGame)
         '输出
         McLaunchLog("Minecraft 启动参数:")
-        McLaunchLog(Arguments.Replace(McLoginLoader.Output.AccessToken, McLoginLoader.Output.AccessToken.Substring(0, 22) & "[数据删除]" & McLoginLoader.Output.AccessToken.Substring(30)))
+        McLaunchLog(Arguments)
         McLaunchArgument = Arguments
     End Sub
 
@@ -1930,7 +1931,7 @@ IgnoreCustomSkin:
                 """" & McLaunchJavaSelected.PathJava & """ " & McLaunchArgument & vbCrLf &
                 "echo 游戏已退出。" & vbCrLf &
                 "pause"
-            WriteFile(If(McLaunchLoader.Input.SaveBatch, Path & "PCL\LatestLaunch.bat"), CmdString,
+            WriteFile(If(McLaunchLoader.Input.SaveBatch, Path & "PCL\LatestLaunch.bat"), SecretFilter(CmdString),
                       Encoding:=If(Encoding.Default.Equals(Encoding.UTF8), Encoding.UTF8, Encoding.GetEncoding("GB18030")))
             If McLaunchLoader.Input.SaveBatch IsNot Nothing Then
                 McLaunchLog("导出启动脚本完成,强制结束启动过程")
@@ -2032,7 +2033,7 @@ IgnoreCustomSkin:
         McLaunchLog("")
         McLaunchLog("~ 登录参数 ~")
         McLaunchLog("玩家用户名:" & McLoginLoader.Output.Name)
-        McLaunchLog("AccessToken:" & McLoginLoader.Output.AccessToken.Substring(0, 22) & "[数据删除]" & McLoginLoader.Output.AccessToken.Substring(30))
+        McLaunchLog("AccessToken:" & McLoginLoader.Output.AccessToken)
         McLaunchLog("ClientToken:" & McLoginLoader.Output.ClientToken)
         McLaunchLog("UUID:" & McLoginLoader.Output.Uuid)
         McLaunchLog("登录方式:" & McLoginLoader.Output.Type)

+ 2 - 2
Plain Craft Launcher 2/My Project/AssemblyInfo.vb

@@ -51,6 +51,6 @@ Imports System.Runtime.InteropServices
 ' 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
 ' 方法是按如下所示使用“*”
 
-<Assembly: AssemblyVersion("2.4.7.0")>
-<Assembly: AssemblyFileVersion("2.4.7.0")>
+<Assembly: AssemblyVersion("2.4.8.0")>
+<Assembly: AssemblyFileVersion("2.4.8.0")>
 <Assembly: NeutralResourcesLanguage("")>

+ 1 - 1
Plain Craft Launcher 2/Pages/PageDownload/PageDownloadPack.xaml

@@ -33,7 +33,7 @@
                             <local:MyComboBoxItem Tag="4487" Content="FTB" Margin="15,0,0,0" ToolTip="该整合包由 FTB 官方发布" />
                             <local:MyComboBoxItem Tag="4480" Content="基于地图" Margin="15,0,0,0" ToolTip="该整合包基于已有的 Minecraft 游戏地图运行" />
                             <local:MyComboBoxItem Tag="4479" Content="硬核" />
-                            <local:MyComboBoxItem Tag="4471" Content="科幻" />
+                            <local:MyComboBoxItem Tag="4474" Content="科幻" />
                             <local:MyComboBoxItem Tag="4483" Content="战斗" />
                             <local:MyComboBoxItem Tag="4478" Content="任务" />
                             <local:MyComboBoxItem Tag="4484" Content="多人" />

+ 1 - 1
Plain Craft Launcher 2/Pages/PageVersion/PageVersionSetup.xaml

@@ -202,7 +202,7 @@
                     </local:MyComboBox>
                     <TextBlock Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Left" Text="启动前执行命令" Margin="0,0,25,3" />
                     <local:MyTextBox x:Name="TextAdvanceRun" Grid.Row="6" Grid.ColumnSpan="2" Tag="VersionAdvanceRun" Grid.Column="1" HintText="" Margin="0,0,0,3"
-                                     ToolTip="在 MC 启动前执行特定命令或程序,语法与 Windows 的运行窗口一致。&#xa;&#xa;可以使用以下替换标记实现相对路径(路径均以 \ 结尾):&#xa; · {path}:PCL 的 exe 文件所在的文件夹&#xa; · {minecraft}:.minecraft 文件夹&#xa; · {verpath}:版本文件夹(.minecraft\versions\版本名\)&#xa; · {verindie}:开启版本隔离时等同版本文件夹,未开启时等同 .minecraft 文件夹&#xa; · {java}:游戏运行时的 Java 文件夹&#xa;&#xa;除此之外,也支持以下替换标记:&#xa; · {user}:玩家名字&#xa; · {login}:玩家的登录方式&#xa; · {uuid}:玩家的 UUID&#xa; · {name}:游戏版本名&#xa; · {time}:当前的系统时间&#xa; · {version}:游戏对应的原版版本号&#xa;&#xa;例如:&#xa; · &quot;{verpath}test.exe&quot; :运行版本文件夹下的 test.exe 程序&#xa; · &quot;{java}java.exe&quot; -jar &quot;{verpath}test.jar&quot; :用 Java 运行版本文件夹下的 test.jar&#xa; · notepad &quot;{verindie}option.txt&quot; :使用记事本打开该版本的设置文件&#xa;&#xa;涉及路径的操作最好都打上双引号,以避免路径中的空格导致运行失败。" />
+                                     ToolTip="在 MC 启动前执行特定命令或程序,语法与 Windows 的命令提示符一致。&#xa;&#xa;可以使用以下替换标记实现相对路径(路径均以 \ 结尾):&#xa; · {path}:PCL 的 exe 文件所在的文件夹&#xa; · {minecraft}:.minecraft 文件夹&#xa; · {verpath}:版本文件夹(.minecraft\versions\版本名\)&#xa; · {verindie}:开启版本隔离时等同版本文件夹,未开启时等同 .minecraft 文件夹&#xa; · {java}:游戏运行时的 Java 文件夹&#xa;&#xa;除此之外,也支持以下替换标记:&#xa; · {user}:玩家名字&#xa; · {login}:玩家的登录方式&#xa; · {uuid}:玩家的 UUID&#xa; · {name}:游戏版本名&#xa; · {time}:当前的系统时间&#xa; · {version}:游戏对应的原版版本号&#xa;&#xa;例如:&#xa; · &quot;{verpath}test.exe&quot; :运行版本文件夹下的 test.exe 程序&#xa; · &quot;{java}java.exe&quot; -jar &quot;{verpath}test.jar&quot; :用 Java 运行版本文件夹下的 test.jar&#xa; · notepad &quot;{verindie}option.txt&quot; :使用记事本打开该版本的设置文件&#xa;&#xa;涉及路径的操作最好都打上双引号,以避免路径中的空格导致运行失败。" />
                     <local:MyCheckBox Grid.Row="7" Grid.Column="1" x:Name="CheckAdvanceRunWait" Tag="VersionAdvanceRunWait" Visibility="Collapsed"
                                       Text="等待命令执行完成后再继续启动" Margin="0,5,0,0" />
                 </Grid>