From e577c1710ef36bda672f80cb0962fb31c28985d5 Mon Sep 17 00:00:00 2001 From: Bagus Nur Listiyono Date: Wed, 19 Jun 2024 15:02:13 +0700 Subject: [PATCH 01/20] Force enable repair and cache on debug --- CollapseLauncher/Classes/Helper/Metadata/PresetConfig.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CollapseLauncher/Classes/Helper/Metadata/PresetConfig.cs b/CollapseLauncher/Classes/Helper/Metadata/PresetConfig.cs index 513f2d0ef..978c85576 100644 --- a/CollapseLauncher/Classes/Helper/Metadata/PresetConfig.cs +++ b/CollapseLauncher/Classes/Helper/Metadata/PresetConfig.cs @@ -195,12 +195,19 @@ internal class PresetConfig public List? GameDispatchArrayURL { get; init; } public bool? IsPluginUpdateEnabled { get; init; } = false; - public bool? IsCacheUpdateEnabled { get; init; } + public bool? IsConvertible { get; init; } public bool? IsExperimental { get; init; } public bool? IsGenshin { get; init; } public bool? IsHideSocMedDesc { get; init; } = true; + + #if !DEBUG public bool? IsRepairEnabled { get; init; } + public bool? IsCacheUpdateEnabled { get; init; } + #else + public bool? IsRepairEnabled = true; + public bool? IsCacheUpdateEnabled = true; + #endif public bool? LauncherSpriteURLMultiLang { get; init; } public byte? CachesListGameVerID { get; init; } From f3d3fb25cbe71f4dfe9cdc78e67444e4ff857a62 Mon Sep 17 00:00:00 2001 From: Bagus Nur Listiyono Date: Wed, 19 Jun 2024 15:02:38 +0700 Subject: [PATCH 02/20] Fix SR cache and repair --- .../GameVersion/StarRail/VersionCheck.cs | 11 ++++++++--- Hi3Helper.EncTool | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CollapseLauncher/Classes/GameManagement/GameVersion/StarRail/VersionCheck.cs b/CollapseLauncher/Classes/GameManagement/GameVersion/StarRail/VersionCheck.cs index 20197b38c..cdeb16df4 100644 --- a/CollapseLauncher/Classes/GameManagement/GameVersion/StarRail/VersionCheck.cs +++ b/CollapseLauncher/Classes/GameManagement/GameVersion/StarRail/VersionCheck.cs @@ -1,4 +1,5 @@ using CollapseLauncher.Interfaces; +using Hi3Helper; using Hi3Helper.EncTool.Parser.AssetMetadata; using Hi3Helper.EncTool.Proto.StarRail; using Microsoft.UI.Xaml; @@ -41,12 +42,16 @@ public GameTypeStarRailVersion(UIElement parentUIElement, RegionResourceProp gam public override DeltaPatchProperty GetDeltaPatchInfo() => GameDeltaPatchProp == null ? null : GameDeltaPatchProp; #nullable enable - private void InitializeProtoId() + public void InitializeProtoId() { if (base.GamePreset.GameDataTemplates != null && base.GamePreset.GameDataTemplates.Count != 0) { - byte[]? data = base.GamePreset.GetGameDataTemplate("MagicSpell", new byte[] { 2, 1, 0, 0 }); - if (data == null) return; + byte[]? data = base.GamePreset.GetGameDataTemplate("MagicSpell", new byte[] { 2, 3, 0, 0 }); + if (data == null) + { + Logger.LogWriteLine("[IGameVersionCheck:InitializeProtoId] data is null!", LogType.Error, true); + return; + } string jsonResponse = Encoding.UTF8.GetString(data); StarRailDispatchGatewayProps.Deserialize(jsonResponse); diff --git a/Hi3Helper.EncTool b/Hi3Helper.EncTool index 99fb0f258..18b1cef15 160000 --- a/Hi3Helper.EncTool +++ b/Hi3Helper.EncTool @@ -1 +1 @@ -Subproject commit 99fb0f25889c0a89463bcba41246fb6e63b52310 +Subproject commit 18b1cef1565110202172d98bf93271dcbee1679f From 16f322592e954630ca90d6bb53c2d93faafc3071 Mon Sep 17 00:00:00 2001 From: Shatyuka Date: Wed, 19 Jun 2024 21:22:58 +0800 Subject: [PATCH 03/20] Fix ContentDialog crash in install thread --- .../MainApp/Pages/Dialogs/SimpleDialogs.cs | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/CollapseLauncher/XAMLs/MainApp/Pages/Dialogs/SimpleDialogs.cs b/CollapseLauncher/XAMLs/MainApp/Pages/Dialogs/SimpleDialogs.cs index e9fe1eef3..bab213f94 100644 --- a/CollapseLauncher/XAMLs/MainApp/Pages/Dialogs/SimpleDialogs.cs +++ b/CollapseLauncher/XAMLs/MainApp/Pages/Dialogs/SimpleDialogs.cs @@ -6,6 +6,7 @@ using CollapseLauncher.Statics; using CommunityToolkit.WinUI; using Hi3Helper; +using Microsoft.UI.Dispatching; using Microsoft.UI.Text; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; @@ -1229,21 +1230,24 @@ public static async ValueTask SpawnDialog( string secondaryText = null, ContentDialogButton defaultButton = ContentDialogButton.Primary, ContentDialogTheme dialogTheme = ContentDialogTheme.Informational) { - // Create a new instance of dialog - ContentDialogCollapse dialog = new ContentDialogCollapse(dialogTheme) + return await DispatcherQueue.GetForCurrentThread().EnqueueAsync(async() => { - Title = title, - Content = content, - CloseButtonText = closeText, - PrimaryButtonText = primaryText, - SecondaryButtonText = secondaryText, - DefaultButton = defaultButton, - Style = CollapseUIExt.GetApplicationResource