2.13.1.0
This commit is contained in:
@@ -181,6 +181,18 @@
|
||||
RequireModLoaderOrOptiFine="True" />
|
||||
</local:MyCheckBox.Tag>
|
||||
</local:MyCheckBox>
|
||||
<StackPanel Margin="30,0,0,0"
|
||||
Visibility="{Binding Checked, ElementName=CheckOptionsShaderPacks, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<local:MyCheckBox x:Name="CheckOptionsShaderPackSettings">
|
||||
<local:MyCheckBox.Tag>
|
||||
<local:ExportOption
|
||||
Title="光影包设置"
|
||||
Description="已选光影包的自定义设置"
|
||||
ShowRules="shaderpacks/*.txt"
|
||||
DefaultChecked="True" />
|
||||
</local:MyCheckBox.Tag>
|
||||
</local:MyCheckBox>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="30,0,0,0" x:Name="PanOptionsShaderPacks"
|
||||
Visibility="{Binding Checked, ElementName=CheckOptionsShaderPacks, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
</StackPanel>
|
||||
@@ -299,4 +311,4 @@
|
||||
x:Name="BtnExport" Text="开始导出"
|
||||
LogoScale="1.1" Logo="M511 995a128 128 0 0 1-57-13L70 791a126 126 0 0 1-70-113V311a126 126 0 0 1 15-60V248c1-2 3-5 5-8a127 127 0 0 1 49-42L454 13a128 128 0 0 1 112 0l383 190a126 126 0 0 1 72 113v360a126 126 0 0 1-70 115L568 984c-17 7-37 11-57 11z m42-470v370l360-178c14-7 23-21 23-38v-335L554 524zM85 330v347a42 42 0 0 0 23 38l360 178V523L85 330zM135 260l375 189 137-65L286 188 135 260z m245-118l363 197 150-71-365-180a42 42 0 0 0-37 0l-111 53z" />
|
||||
</Grid>
|
||||
</local:MyPageRight>
|
||||
</local:MyPageRight>
|
||||
|
||||
@@ -76,6 +76,7 @@ Public Class PageInstanceExport
|
||||
If Not SubFolder.EnumerateFileSystemInfos().Any() Then Continue For
|
||||
Dim NewCheckBox As New MyCheckBox With {. _
|
||||
Tag = New ExportOption With {.Title = SubFolder.Name, .DefaultChecked = True, .Rules = StringUtils.LikePatternEscape($"{Folder}/{SubFolder.Name}/")}}
|
||||
If AcceptCompressedFile Then GetExportOption(NewCheckBox).Description = "文件夹"
|
||||
If Panel Is PanOptionsSaves Then GetExportOption(NewCheckBox).Description = SubFolder.LastWriteTime.ToString("yyyy'/'MM'/'dd HH':'mm")
|
||||
Panel.Children.Add(NewCheckBox)
|
||||
Next
|
||||
@@ -249,9 +250,22 @@ Public Class PageInstanceExport
|
||||
For Each CheckBox In GetAllOptions(False)
|
||||
If Not CheckBox.Checked Then Continue For
|
||||
Dim TargetOption = GetExportOption(CheckBox)
|
||||
If TargetOption.Rules Is Nothing Then Continue For
|
||||
Dim Rules = If(TargetOption.Rules?.Split("|"c).ToList(), New List(Of String))
|
||||
|
||||
'动态 Rules
|
||||
If CheckBox Is CheckOptionsShaderPackSettings Then '光影包设置:只导出勾选的光影包的设置
|
||||
For Each ShaderPackCheckBox In PanOptionsShaderPacks.Children.OfType(Of MyCheckBox)()
|
||||
If Not ShaderPackCheckBox.Checked Then Continue For
|
||||
Dim ShaderPackOption = GetExportOption(ShaderPackCheckBox)
|
||||
Dim SettingFileName = ShaderPackOption.Rules.TrimEnd("/") & ".txt"
|
||||
If Not FileUtils.Exists(Path.Combine(PageInstanceLeft.Instance.PathIndie, SettingFileName)) Then Continue For
|
||||
Rules.Add(StringUtils.LikePatternEscape($"shaderpacks/{SettingFileName}"))
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not Rules.Any() Then Continue For
|
||||
Yield $"# {TargetOption.Title}"
|
||||
For Each Rule In TargetOption.Rules.Split("|"c)
|
||||
For Each Rule In Rules
|
||||
Yield Rule
|
||||
Next
|
||||
Yield ""
|
||||
@@ -412,7 +426,7 @@ Public Class PageInstanceExport
|
||||
Dim LoaderName As String = $"导出整合包:" & PackName
|
||||
For Each OngoingLoader In LoaderTaskbar
|
||||
If OngoingLoader.Name <> LoaderName Then Continue For
|
||||
FrmMain.PageChange(FormMain.PageType.DownloadManager)
|
||||
FrmMain.PageChange(FormMain.PageType.TaskManager)
|
||||
Return
|
||||
Next
|
||||
|
||||
@@ -608,7 +622,7 @@ Public Class PageInstanceExport
|
||||
Try
|
||||
If ModrinthUploadMode Then Return 'Modrinth 上传模式下,不从 CurseForge 获取信息
|
||||
Dim CurseForgeHashes = Loader.Input.Select(Function(m) m.CurseForgeHash)
|
||||
Dim CurseForgeRaw As JContainer = DlModRequest("https://api.curseforge.com/v1/fingerprints/432/", HttpMethod.Post,
|
||||
Dim CurseForgeRaw As JContainer = DlModRequest("https://api.curseforge.com/v1/fingerprints/432", HttpMethod.Post,
|
||||
$"{{""fingerprints"": [{CurseForgeHashes.Join(",")}]}}", "application/json")("data")("exactMatches")
|
||||
For Each ResultJson As JObject In CurseForgeRaw
|
||||
If Not ResultJson.ContainsKey("file") Then Continue For
|
||||
@@ -712,7 +726,7 @@ Public Class PageInstanceExport
|
||||
LoaderTaskbarAdd(MainLoader)
|
||||
FrmMain.BtnExtraDownload.ShowRefresh()
|
||||
FrmMain.BtnExtraDownload.Ribble()
|
||||
FrmMain.PageChange(FormMain.PageType.DownloadManager)
|
||||
FrmMain.PageChange(FormMain.PageType.TaskManager)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -309,7 +309,10 @@ Install:
|
||||
For Each ModFile In FilePathList
|
||||
Dim NewFileName = PathUtils.GetLastPart(ModFile).Replace(".disabled", "").Replace(".old", "")
|
||||
If Not NewFileName.Contains(".") Then NewFileName += ".jar" '#4227
|
||||
FileUtils.Copy(ModFile, Instance.PathIndie & "mods\" & NewFileName)
|
||||
NewFileName = Instance.PathIndie & "mods\" & NewFileName
|
||||
If ModFile = NewFileName Then Continue For '防止安装相同文件导致文件被删除
|
||||
FileUtils.Delete(NewFileName, True)
|
||||
FileUtils.Copy(ModFile, NewFileName)
|
||||
Next
|
||||
If FilePathList.IsSingle Then
|
||||
Hint($"已安装 {PathUtils.GetLastPart(FilePathList.First).Replace(".disabled", "").Replace(".old", "")}!", HintType.Green)
|
||||
|
||||
@@ -62,18 +62,12 @@
|
||||
</StackPanel>
|
||||
</local:MyCard>
|
||||
<local:MyCard Margin="0,0,0,15" Title="快捷方式" x:Name="PanFolder">
|
||||
<StackPanel Margin="25,40,25,15">
|
||||
<Grid Margin="0,2,0,7" Height="35">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Button" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Button" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Button" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<local:MyButton x:Name="BtnFolderVersion" Text="版本文件夹" MinWidth="140" Padding="13,0" Margin="0,0,20,0" />
|
||||
<local:MyButton x:Name="BtnFolderSaves" Text="存档文件夹" MinWidth="140" Padding="13,0" Margin="0,0,20,0" Grid.Column="1" />
|
||||
<local:MyButton x:Name="BtnFolderMods" Text="Mod 文件夹" MinWidth="140" Padding="13,0" Margin="0,0,20,0" Grid.Column="2" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<WrapPanel Margin="25,30,25,20">
|
||||
<local:MyButton x:Name="BtnFolderVersion" Text="版本文件夹" MinWidth="140" Padding="13,0" Margin="0,13,20,0" Height="35" />
|
||||
<local:MyButton x:Name="BtnFolderSaves" Text="存档文件夹" MinWidth="140" Padding="13,0" Margin="0,13,20,0" Height="35"/>
|
||||
<local:MyButton x:Name="BtnFolderMods" Text="Mod 文件夹" MinWidth="140" Padding="13,0" Margin="0,13,20,0" Height="35"/>
|
||||
<local:MyButton x:Name="BtnFolderScreen" Text="截图文件夹" MinWidth="140" Padding="13,0" Margin="0,13,20,0" Height="35" />
|
||||
</WrapPanel>
|
||||
</local:MyCard>
|
||||
<local:MyCard Margin="0,0,0,15" Title="高级管理" x:Name="PanManage">
|
||||
<StackPanel Margin="25,40,25,15">
|
||||
|
||||
@@ -109,7 +109,8 @@ Public Class PageInstanceOverall
|
||||
Dim OldPath As String = PageInstanceLeft.Instance.PathVersion
|
||||
'修改此部分的同时修改快速安装的版本名检测*
|
||||
Dim NewName As String = MyMsgBoxInput("重命名版本", "", OldName, New ObjectModel.Collection(Of Validate) From {
|
||||
New ValidateFolderName(McFolderSelected & "versions", IgnoreCase:=False)})
|
||||
New ValidateFolderName(McFolderSelected & "versions", IgnoreList:=New List(Of String) From {OldName})
|
||||
})
|
||||
If String.IsNullOrWhiteSpace(NewName) Then Return
|
||||
Dim NewPath As String = McFolderSelected & "versions\" & NewName & "\"
|
||||
'重新读取版本 JSON 信息,避免 JsonObject 中已被合并的项被重新存储
|
||||
@@ -157,7 +158,7 @@ Public Class PageInstanceOverall
|
||||
End Sub
|
||||
|
||||
'版本图标
|
||||
Private Sub ComboDisplayLogo_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles ComboDisplayLogo.SelectionChanged
|
||||
Private Sub ComboDisplayLogo_SelectionChanged() Handles ItemDisplayLogoCustom.PreviewMouseLeftButtonUp, ComboDisplayLogo.SelectionChanged
|
||||
If Not (IsLoad AndAlso AniControlEnabled = 0) Then Return
|
||||
'选择 自定义 时修改图片
|
||||
Try
|
||||
@@ -228,6 +229,13 @@ Public Class PageInstanceOverall
|
||||
OpenExplorer(Folder)
|
||||
End Sub
|
||||
|
||||
'截图文件夹
|
||||
Private Sub BtnFolderScreen_Click(sender As Object, e As MouseButtonEventArgs) Handles BtnFolderScreen.Click
|
||||
Dim Folder As String = PageInstanceLeft.Instance.PathIndie & "screenshots\"
|
||||
DirectoryUtils.Create(Folder)
|
||||
OpenExplorer(Folder)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "卡片:管理"
|
||||
@@ -298,8 +306,11 @@ Public Class PageInstanceOverall
|
||||
Try
|
||||
Dim IsShiftPressed As Boolean = My.Computer.Keyboard.ShiftKeyDown
|
||||
Dim IsHintIndie As Boolean = PageInstanceLeft.Instance.State <> McInstanceState.Error AndAlso PageInstanceLeft.Instance.PathIndie <> McFolderSelected
|
||||
Dim SavesFolder = DirectoryUtils.GetInfo(PageInstanceLeft.Instance.PathIndie & "saves\")
|
||||
Dim SaveEntries = If(SavesFolder.Exists, SavesFolder.EnumerateDirectories.OrderByDescending(Function(Save) Save.LastWriteTime).Select(Function(Save) $"{Save.Name}(上次修改:{StringUtils.FormatTimeSpan(Save.LastWriteTime - Date.Now, False)})").ToList, New List(Of String))
|
||||
Select Case MyMsgBox($"你确定要{If(IsShiftPressed, "永久", "")}删除版本 {PageInstanceLeft.Instance.Name} 吗?" &
|
||||
If(IsHintIndie, vbCrLf & "由于该版本开启了版本隔离,删除版本时该版本对应的存档、资源包、Mod 等文件也将被一并删除!", ""),
|
||||
If(IsHintIndie, vbCrLf & "该版本对应的存档、资源包、Mod 等文件也将被一并删除!" &
|
||||
If(SaveEntries.Any, vbCrLf & vbCrLf & "这会删除以下存档:" & vbCrLf & "· " & SaveEntries.Join(vbCrLf & "· "), ""), ""),
|
||||
"版本删除确认", , "取消",, IsHintIndie OrElse IsShiftPressed)
|
||||
Case 1
|
||||
PageInstanceLeft.Instance.ResetSettingsCache()
|
||||
|
||||
@@ -83,7 +83,7 @@ Public Class PageInstanceSetup
|
||||
Settings.Reset("VersionServerLogin", Instance:=PageInstanceLeft.Instance)
|
||||
Settings.Reset("VersionArgumentIndieV2", Instance:=PageInstanceLeft.Instance)
|
||||
Settings.Reset("VersionAdvanceAssets", Instance:=PageInstanceLeft.Instance)
|
||||
Configs.InstanceForcedJava.Reset(PageInstanceLeft.Instance.Config)
|
||||
Configs.JavaForced.Reset(PageInstanceLeft.Instance.Config)
|
||||
JavaListRefreshWorker.Start()
|
||||
|
||||
Logger.Info("已初始化版本独立设置")
|
||||
@@ -474,7 +474,7 @@ PreFin:
|
||||
'========================================== 显示结果 ==========================================
|
||||
BtnArgumentJavaSearch.IsEnabled = True
|
||||
ComboArgumentJavaSelect.IsEnabled = True
|
||||
Dim SelectedJava As Java = Configs.InstanceForcedJava.Get(PageInstanceLeft.Instance.Config)
|
||||
Dim SelectedJava As Java = Configs.JavaForced.Get(PageInstanceLeft.Instance.Config)
|
||||
'更新下拉框文本
|
||||
If Not Configs.JavaList.Get().Any() Then
|
||||
LabArgumentJava.Text = "未找到 Java,点击以导入已有的 Java"
|
||||
@@ -492,7 +492,7 @@ PreFin:
|
||||
AddHandler JavaItem.MouseLeftButtonUp, Sub(sender As Object, e As MouseButtonEventArgs) e.Handled = True
|
||||
AddHandler JavaItem.Click,
|
||||
Sub()
|
||||
Configs.InstanceForcedJava.Set(JavaEntry, PageInstanceLeft.Instance.Config)
|
||||
Configs.JavaForced.Set(JavaEntry, PageInstanceLeft.Instance.Config)
|
||||
UpdateJavaList()
|
||||
ComboArgumentJavaSelect.IsDropDownOpen = False
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user