diff --git a/CollapseLauncher/Classes/Helper/Metadata/PresetConfig.cs b/CollapseLauncher/Classes/Helper/Metadata/PresetConfig.cs index a5f3f12a4..a3f93b05a 100644 --- a/CollapseLauncher/Classes/Helper/Metadata/PresetConfig.cs +++ b/CollapseLauncher/Classes/Helper/Metadata/PresetConfig.cs @@ -559,7 +559,7 @@ public bool TryCheckGameLocationHYP() if (subKey == null) continue; string[] subKeyKey = subKey.GetSubKeyNames(); - if (subKeyKey?.Length == 0) continue; + if (subKeyKey.Length == 0) continue; string? gameKeyName = subKeyKey?.FirstOrDefault(x => x.Equals(LauncherBizName, StringComparison.OrdinalIgnoreCase)); if (string.IsNullOrEmpty(gameKeyName)) continue; diff --git a/CollapseLauncher/Classes/Interfaces/Class/CommunityToolsProperty.cs b/CollapseLauncher/Classes/Interfaces/Class/CommunityToolsProperty.cs index a76a950ac..355c39ddd 100644 --- a/CollapseLauncher/Classes/Interfaces/Class/CommunityToolsProperty.cs +++ b/CollapseLauncher/Classes/Interfaces/Class/CommunityToolsProperty.cs @@ -1,6 +1,5 @@ using CollapseLauncher.Helper.Metadata; using Hi3Helper; -using Hi3Helper.Shared.Region; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/CollapseLauncher/Classes/Interfaces/Class/Structs.cs b/CollapseLauncher/Classes/Interfaces/Class/Structs.cs index 840ca50ac..d2e0fb00a 100644 --- a/CollapseLauncher/Classes/Interfaces/Class/Structs.cs +++ b/CollapseLauncher/Classes/Interfaces/Class/Structs.cs @@ -3,6 +3,7 @@ using Hi3Helper.Http; using System; using System.IO; +// ReSharper disable CheckNamespace namespace CollapseLauncher { @@ -171,7 +172,7 @@ public bool IsMatch(string versionToCompare) public bool IsMatch(GameVersion? versionToCompare) { if (versionToCompare == null) return false; - return Major == versionToCompare?.Major && Minor == versionToCompare?.Minor && Build == versionToCompare?.Build && Revision == versionToCompare?.Revision; + return Major == versionToCompare.Value.Major && Minor == versionToCompare.Value.Minor && Build == versionToCompare.Value.Build && Revision == versionToCompare.Value.Revision; } public GameVersion GetIncrementedVersion() @@ -186,7 +187,7 @@ public GameVersion GetIncrementedVersion() NextMajor++; } - return new GameVersion(new int[] { NextMajor, NextMinor, Build, Revision }); + return new GameVersion(new[] { NextMajor, NextMinor, Build, Revision }); } public Version ToVersion() => new Version(Major, Minor, Build, Revision); diff --git a/CollapseLauncher/XAMLs/MainApp/MainPage.xaml.cs b/CollapseLauncher/XAMLs/MainApp/MainPage.xaml.cs index 425d874ca..02c1dcb7f 100644 --- a/CollapseLauncher/XAMLs/MainApp/MainPage.xaml.cs +++ b/CollapseLauncher/XAMLs/MainApp/MainPage.xaml.cs @@ -10,12 +10,10 @@ using CollapseLauncher.Helper.Update; using CollapseLauncher.Interfaces; using CollapseLauncher.Pages; -using CollapseLauncher.Statics; using CommunityToolkit.WinUI; using CommunityToolkit.WinUI.Animations; using Hi3Helper; using Hi3Helper.Shared.ClassStruct; -using Hi3Helper.Shared.Region; using InnoSetupHelper; using Microsoft.UI; using Microsoft.UI.Input; diff --git a/CollapseLauncher/XAMLs/MainApp/Pages/Dialogs/InstallationConvert.xaml.cs b/CollapseLauncher/XAMLs/MainApp/Pages/Dialogs/InstallationConvert.xaml.cs index 6147d72ff..bf575be0d 100644 --- a/CollapseLauncher/XAMLs/MainApp/Pages/Dialogs/InstallationConvert.xaml.cs +++ b/CollapseLauncher/XAMLs/MainApp/Pages/Dialogs/InstallationConvert.xaml.cs @@ -177,7 +177,7 @@ private async Task FetchDataIntegrityURL(PresetConfig Profile) GameVersion = _Entry.data.game.latest.version; - return _RepoList[GameVersion]; + return _RepoList[GameVersion ?? throw new InvalidOperationException()]; } internal bool IsSourceGameExist(PresetConfig Profile)