This commit is contained in:
龙腾猫跃
2026-07-02 23:24:29 +08:00
parent 124e3be6bf
commit c6d0457946
193 changed files with 3112 additions and 3747 deletions
@@ -1,4 +1,4 @@
Public Class PageSetupUI
Public Class PageSetupUI
Private Sub PageSetupUI_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
'重复加载部分
@@ -73,7 +73,7 @@
'背景图片
Private Sub BtnUIBgOpen_Click(sender As Object, e As EventArgs) Handles BtnBackgroundOpen.Click
OpenExplorer(PathExeFolder & "PCL\Pictures\")
OpenExplorer(Paths.Base & "PCL\Pictures\")
End Sub
Private Sub BtnBackgroundRefresh_Click(sender As Object, e As EventArgs) Handles BtnBackgroundRefresh.Click
BackgroundRefresh(True, True)
@@ -97,7 +97,7 @@
End Sub
Private Sub BtnBackgroundClear_Click(sender As Object, e As EventArgs) Handles BtnBackgroundClear.Click
If MyMsgBox("即将删除背景图片文件夹中的所有文件。" & vbCrLf & "此操作不可撤销,是否确定?", "警告",, "取消", IsWarn:=True) = 1 Then
DirectoryUtils.Delete(PathExeFolder & "PCL\Pictures")
DirectoryUtils.Delete(Paths.Base & "PCL\Pictures")
BackgroundRefresh(False, True)
Hint("背景图片已清空!", HintType.Green)
End If
@@ -111,9 +111,9 @@
Try
'获取可用的图片文件
DirectoryUtils.Create(PathExeFolder & "PCL\Pictures\")
DirectoryUtils.Create(Paths.Base & "PCL\Pictures\")
Dim Pic As New List(Of String)
For Each File In DirectoryUtils.GetFiles(PathExeFolder & "PCL\Pictures\")
For Each File In DirectoryUtils.EnumerateFiles(Paths.Base & "PCL\Pictures\", True)
Dim Extension As String = PathUtils.GetExtension(File)
If Extension <> "ini" AndAlso Extension <> "db" Then Pic.Add(File) '文件夹可能会被加入 .ini 和 thumbs.db
Next
@@ -157,7 +157,7 @@
Private Sub BtnLogoChange_Click(sender As Object, e As EventArgs) Handles BtnLogoChange.Click
Dim FileName As String = Dialogs.SelectFile("选择图片", False, filter:={({"png", "jpg", "jpeg", "gif", "webp"}, "常用图片文件")}).FirstOrDefault()
If String.IsNullOrEmpty(FileName) Then Return
Dim TargetPath As String = PathExeFolder & "PCL\Logo.png"
Dim TargetPath As String = Paths.Base & "PCL\Logo.png"
Try
'复制文件
FileUtils.Copy(FileName, TargetPath)
@@ -177,7 +177,7 @@
If Not (AniControlEnabled = 0 AndAlso e.RaiseByMouse) Then Return
Refresh:
'已有图片则不再选择
Dim TargetPath As String = PathExeFolder & "PCL\Logo.png"
Dim TargetPath As String = Paths.Base & "PCL\Logo.png"
If FileUtils.Exists(TargetPath) Then
Try
FrmMain.ImageTitleLogo.Source = Nothing '防止因为 Source 属性前后的值相同而不更新 (#5628)
@@ -214,7 +214,7 @@ Refresh:
End Sub
Private Sub BtnLogoDelete_Click(sender As Object, e As EventArgs) Handles BtnLogoDelete.Click
Try
FileUtils.Delete(PathExeFolder & "PCL\Logo.png")
FileUtils.Delete(Paths.Base & "PCL\Logo.png")
RadioLogoType1.SetChecked(True, True)
Hint("标题栏图片已清空!", HintType.Green)
Catch ex As Exception
@@ -224,7 +224,7 @@ Refresh:
'背景音乐
Private Sub BtnMusicOpen_Click(sender As Object, e As EventArgs) Handles BtnMusicOpen.Click
OpenExplorer(PathExeFolder & "PCL\Musics\")
OpenExplorer(Paths.Base & "PCL\Musics\")
End Sub
Private Sub BtnMusicRefresh_Click(sender As Object, e As EventArgs) Handles BtnMusicRefresh.Click
MusicRefreshPlay(True)
@@ -236,7 +236,7 @@ Refresh:
PanMusicDetail.Visibility = Visibility.Visible
BtnMusicClear.Visibility = Visibility.Visible
CardMusic.Title = "背景音乐(" &
DirectoryUtils.GetFiles(PathExeFolder & "PCL\Musics\").Count(Function(f) Not {"ini", "jpg", "txt", "cfg", "lrc", "db", "png"}.Contains(PathUtils.GetExtension(f))) &
DirectoryUtils.EnumerateFiles(Paths.Base & "PCL\Musics\", True).Count(Function(f) Not {"ini", "jpg", "txt", "cfg", "lrc", "db", "png"}.Contains(PathUtils.GetExtension(f))) &
" 首)"
Else
PanMusicVolume.Visibility = Visibility.Collapsed
@@ -258,13 +258,13 @@ Refresh:
Thread.Sleep(200)
'删除文件
Try
DirectoryUtils.Delete(PathExeFolder & "PCL\Musics")
DirectoryUtils.Delete(Paths.Base & "PCL\Musics")
Hint("背景音乐已删除!", HintType.Green)
Catch ex As Exception
Logger.Error(ex, "删除背景音乐失败", LogBehavior.Alert)
End Try
Try
DirectoryUtils.Create(PathExeFolder & "PCL\Musics\")
DirectoryUtils.Create(Paths.Base & "PCL\Musics\")
RunInUi(Sub() MusicRefreshPlay(False))
Catch ex As Exception
Logger.Error(ex, "重建背景音乐文件夹失败", LogBehavior.Alert)
@@ -284,12 +284,12 @@ Refresh:
'主页
Private Sub BtnCustomFile_Click(sender As Object, e As EventArgs) Handles BtnCustomFile.Click
Try
If FileUtils.Exists(PathExeFolder & "PCL\Custom.xaml") Then
If FileUtils.Exists(Paths.Base & "PCL\Custom.xaml") Then
If MyMsgBox("当前已存在布局文件,继续生成教学文件将会覆盖现有布局文件!", "覆盖确认", "继续", "取消", IsWarn:=True) = 2 Then Return
End If
ExtractResources(PathExeFolder & "PCL\Custom.xaml", "Custom")
ExtractResources(Paths.Base & "PCL\Custom.xaml", "Custom")
Hint("教学文件已生成!", HintType.Green)
OpenExplorer(PathExeFolder & "PCL\Custom.xaml")
OpenExplorer(Paths.Base & "PCL\Custom.xaml")
Catch ex As Exception
Logger.Error(ex, "生成教学文件失败")
End Try
@@ -588,7 +588,7 @@ Refresh:
SliderLauncherHue.GetHintText = Function(v) v & "°"
SliderLauncherSat.GetHintText = Function(v) v & "%"
SliderLauncherDelta.GetHintText =
Function(Value As Integer)
Function(Value As Integer) As String
If Value > 90 Then
Return "+" & (Value - 90)
ElseIf Value = 90 Then
@@ -598,7 +598,7 @@ Refresh:
End If
End Function
SliderLauncherLight.GetHintText =
Function(Value As Integer)
Function(Value As Integer) As String
If Value > 20 Then
Return "+" & (Value - 20)
ElseIf Value = 20 Then