diff --git a/Stardrop/Models/Data/ClientData.cs b/Stardrop/Models/Data/ClientData.cs index ddab36a..87d6a16 100644 --- a/Stardrop/Models/Data/ClientData.cs +++ b/Stardrop/Models/Data/ClientData.cs @@ -8,5 +8,8 @@ public class ClientData public Dictionary ColumnActiveStates { get; set; } = new Dictionary(); public Dictionary ColumnOrder { get; set; } = new Dictionary(); public LastSessionData LastSessionData { get; set; } + + // Mapping of mod unique id to the ignored suggested version string + public Dictionary IgnoredUpdates { get; set; } = new Dictionary(); } } diff --git a/Stardrop/Models/Mod.cs b/Stardrop/Models/Mod.cs index 562fec4..468f79e 100644 --- a/Stardrop/Models/Mod.cs +++ b/Stardrop/Models/Mod.cs @@ -74,6 +74,12 @@ public string ParsedStatus { get { + // If the suggested version is the same as an ignored version, treat as no update + if (!String.IsNullOrEmpty(SuggestedVersion) && !String.IsNullOrEmpty(IgnoredVersion) && IgnoredVersion.Equals(SuggestedVersion, StringComparison.OrdinalIgnoreCase)) + { + return String.Empty; + } + if (!String.IsNullOrEmpty(SuggestedVersion) && IsModOutdated(SuggestedVersion)) { if (_status == WikiCompatibilityStatus.Unofficial) @@ -96,6 +102,12 @@ public string InstallStatus { get { + // If the suggested version is the same as an ignored version, treat as no update + if (!String.IsNullOrEmpty(SuggestedVersion) && !String.IsNullOrEmpty(IgnoredVersion) && IgnoredVersion.Equals(SuggestedVersion, StringComparison.OrdinalIgnoreCase)) + { + return String.Empty; + } + if (!String.IsNullOrEmpty(SuggestedVersion) && IsModOutdated(SuggestedVersion)) { var nexusModId = GetNexusId(); @@ -117,6 +129,8 @@ public string InstallStatus private string _note { get; set; } public string Note { get { return _note; } set { _note = value; NotifyPropertyChanged("Note"); } } + private string? _ignoredVersion { get; set; } + public string? IgnoredVersion { get { return _ignoredVersion; } set { _ignoredVersion = value; NotifyPropertyChanged(nameof(IgnoredVersion)); NotifyPropertyChanged(nameof(ParsedStatus)); NotifyPropertyChanged(nameof(InstallStatus)); } } public event PropertyChangedEventHandler? PropertyChanged; diff --git a/Stardrop/ViewModels/MainWindowViewModel.cs b/Stardrop/ViewModels/MainWindowViewModel.cs index 5ce97e0..21c16c6 100644 --- a/Stardrop/ViewModels/MainWindowViewModel.cs +++ b/Stardrop/ViewModels/MainWindowViewModel.cs @@ -476,6 +476,11 @@ public void DiscoverMods(string modsFilePath) mod.LastUpdateTimestamp = localDataCache.ModInstallData.First(m => m.UniqueId.Equals(mod.UniqueId, StringComparison.OrdinalIgnoreCase)).LastUpdateTimestamp; } + if (localDataCache is not null && localDataCache.IgnoredUpdates is not null && localDataCache.IgnoredUpdates.TryGetValue(mod.UniqueId, out string? value)) + { + mod.IgnoredVersion = value; + } + // Check if any config file exists var configPath = Path.Combine(fileInfo.DirectoryName, "config.json"); if (File.Exists(configPath) && new FileInfo(configPath) is FileInfo configInfo && configInfo is not null) diff --git a/Stardrop/Views/MainWindow.axaml b/Stardrop/Views/MainWindow.axaml index 794f8a6..5e92f0e 100644 --- a/Stardrop/Views/MainWindow.axaml +++ b/Stardrop/Views/MainWindow.axaml @@ -27,66 +27,66 @@ WindowStartupLocation="CenterScreen" Icon="/Assets/icon.ico"> - - - + + + - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +