This commit is contained in:
龙腾猫跃
2022-10-15 21:10:59 +08:00
parent dcf0e17890
commit 0066d1b35e
40 changed files with 849 additions and 431 deletions
@@ -114,8 +114,8 @@
'设置文件
Try
'拷贝文件
File.Delete(PathTemp & "CustomSkin.png")
CopyFile(SkinInfo.LocalFile, PathTemp & "CustomSkin.png")
File.Delete(PathAppdata & "CustomSkin.png")
CopyFile(SkinInfo.LocalFile, PathAppdata & "CustomSkin.png")
'更新设置
Setup.Set("LaunchSkinSlim", SkinInfo.IsSlim)
Catch ex As Exception
@@ -129,7 +129,7 @@
If Not (AniControlEnabled = 0 AndAlso e.RaiseByMouse) Then Exit Sub
Try
'已有图片则不再选择
If File.Exists(PathTemp & "CustomSkin.png") Then Exit Sub
If File.Exists(PathAppdata & "CustomSkin.png") Then Exit Sub
'没有图片则要求选择
Dim SkinInfo As McSkinInfo = McSkinSelect(True)
If Not SkinInfo.IsVaild Then
@@ -137,8 +137,8 @@
Exit Sub
End If
'拷贝文件
File.Delete(PathTemp & "CustomSkin.png")
CopyFile(SkinInfo.LocalFile, PathTemp & "CustomSkin.png")
File.Delete(PathAppdata & "CustomSkin.png")
CopyFile(SkinInfo.LocalFile, PathAppdata & "CustomSkin.png")
'更新设置
Setup.Set("LaunchSkinSlim", SkinInfo.IsSlim)
Catch ex As Exception
@@ -151,7 +151,7 @@
End Sub
Private Sub BtnSkinDelete_Click(sender As Object, e As EventArgs) Handles BtnSkinDelete.Click
Try
File.Delete(PathTemp & "CustomSkin.png")
File.Delete(PathAppdata & "CustomSkin.png")
RadioSkinType0.SetChecked(True, True, True)
Hint("离线皮肤已清空!", HintType.Finish)
Catch ex As Exception
@@ -335,7 +335,7 @@
Dim RamTarget2 As Double '估计没啥问题了的内存
Dim RamTarget3 As Double '放一百万个材质和 Mod 和光影需要的内存
If Version IsNot Nothing AndAlso Not Version.IsLoaded Then Version.Load()
If Version IsNot Nothing AndAlso Version.Version.Modable Then
If Version IsNot Nothing AndAlso Version.Modable Then
'可安装 Mod 的版本
Dim ModDir As New DirectoryInfo(Version.PathIndie & "mods\")
Dim ModCount As Integer = If(ModDir.Exists, ModDir.GetFiles.Length, 0)
@@ -6,8 +6,14 @@
d:DesignWidth="800" d:DesignHeight="800">
<local:MyScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" x:Name="PanBack">
<StackPanel x:Name="PanMain" Margin="25,10">
<local:MyCard Margin="0,20,0,-5" Title="通用设置">
<StackPanel Margin="25,40,25,15">
<local:MyCard Margin="0,15" Title="HiPer">
<StackPanel Margin="25,40,25,20" Orientation="Vertical">
<local:MyCheckBox Text="在索引码还有 5 分钟到期时提醒我" x:Name="CheckHiperCertWarn" Tag="LinkHiperCertWarn" Height="22" />
<local:MyButton x:Name="BtnHiperLog" Height="35" MinWidth="140" Text="查看日志" Padding="13,0" Margin="0,10,20,0" HorizontalAlignment="Left" />
</StackPanel>
</local:MyCard>
<local:MyCard Margin="0,0,0,15" Title="IOI">
<StackPanel Margin="25,40,25,20">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Name" />
@@ -26,8 +32,6 @@
</local:MyTextBox.ValidateRules>
</local:MyTextBox>
</Grid>
<local:MyCheckBox Text="打开启动器时启动联机模块" Height="22" x:Name="CheckLinkAuto" Tag="LinkAuto" ToolTipService.ShowDuration="2333333" Margin="0,10,0,4"
ToolTip="开启联机模块的人越多,所有使用 PCL2 的玩家的初次连接速度就会越快。因此,启用此项可以为大家作出贡献。&#13;联机模块仅使用少许网络带宽,几乎不使用硬盘与 CPU。" />
</StackPanel>
</local:MyCard>
</StackPanel>
@@ -17,15 +17,15 @@
End Sub
Public Sub Reload()
CheckLinkAuto.Checked = Setup.Get("LinkAuto")
TextLinkName.Text = Setup.Get("LinkName")
CheckHiperCertWarn.Checked = Setup.Get("LinkHiperCertWarn")
End Sub
'初始化
Public Sub Reset()
Try
Setup.Reset("LinkAuto")
Setup.Reset("LinkName")
Setup.Reset("LinkHiperCertWarn")
Log("[Setup] 已初始化联机页设置")
Hint("已初始化联机页设置!", HintType.Finish, False)
@@ -37,11 +37,19 @@
End Sub
'将控件改变路由到设置改变
Private Shared Sub CheckBoxChange(sender As MyCheckBox, e As Object) Handles CheckLinkAuto.Change
If AniControlEnabled = 0 Then Setup.Set(sender.Tag, sender.Checked)
End Sub
Private Shared Sub TextBoxChange(sender As MyTextBox, e As Object) Handles TextLinkName.ValidatedTextChanged
If AniControlEnabled = 0 Then Setup.Set(sender.Tag, sender.Text)
End Sub
Private Shared Sub CheckBoxChange(sender As MyCheckBox, e As Object) Handles CheckHiperCertWarn.Change
If AniControlEnabled = 0 Then Setup.Set(sender.Tag, sender.Checked)
End Sub
Private Sub BtnHiperLog_Click(sender As Object, e As EventArgs) Handles BtnHiperLog.Click
If File.Exists(PageLinkHiper.PathHiper & "logs\hiper.log") Then
OpenExplorer("/select,""" & PageLinkHiper.PathHiper & "logs\hiper.log""")
Else
Hint("没有找到 HiPer 联机模块的日志!")
End If
End Sub
End Class
@@ -183,7 +183,6 @@
Dim Temp As String()
Temp = Directory.GetFiles(Path)
For Each str As String In Temp
If str = PathTemp & "CustomSkin.png" OrElse str = PathTemp & "联机模块.exe" Then Continue For '不删除的文件
Try
Dim Info As New FileInfo(str)
Dim FileActualSize = Math.Ceiling(Info.Length / 4096) * 4096