From 87cfacfdbb5d17b649588778d6f17e4f697a0e40 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Thu, 20 Jun 2024 22:40:19 +0200 Subject: [PATCH] remove allow extras from option -> controlled by update config --- ModpackUpdater.Manager/ModpackInstaller.cs | 4 ++-- ModpackUpdater.Manager/UpdateCheckOptions.cs | 1 - ModpackUpdater.Model/ModpackConfig.cs | 1 + ModpackUpdater/Options.cs | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ModpackUpdater.Manager/ModpackInstaller.cs b/ModpackUpdater.Manager/ModpackInstaller.cs index fdab3b4..09005ca 100644 --- a/ModpackUpdater.Manager/ModpackInstaller.cs +++ b/ModpackUpdater.Manager/ModpackInstaller.cs @@ -56,7 +56,7 @@ public class ModpackInstaller(ModpackConfig updateConfig, ModpackInfo modpackInf if (installInfos is not null && installInfos.Actions.Count != 0) { - var actions = installInfos.Actions.Where(n => n.Side.IsSide(options.Side) && (!n.IsExtra || options.IncludeExtraActions)); + var actions = installInfos.Actions.Where(n => n.Side.IsSide(options.Side) && (!n.IsExtra || updateConfig.IncludeExtras)); if (actions.Any()) { result.Actions.AddRange(installInfos.Actions); @@ -88,7 +88,7 @@ public class ModpackInstaller(ModpackConfig updateConfig, ModpackInfo modpackInf foreach (var action in checkingVersion.Actions) { - if (action.Side.IsSide(options.Side) && (!action.IsExtra || options.IncludeExtraActions) && !result.Actions.Any(n => n.DestPath == action.DestPath)) + if (action.Side.IsSide(options.Side) && (!action.IsExtra || updateConfig.IncludeExtras) && !result.Actions.Any(n => n.DestPath == action.DestPath)) actionsToAdd.Add(action); } diff --git a/ModpackUpdater.Manager/UpdateCheckOptions.cs b/ModpackUpdater.Manager/UpdateCheckOptions.cs index e0c0993..bf28bbd 100644 --- a/ModpackUpdater.Manager/UpdateCheckOptions.cs +++ b/ModpackUpdater.Manager/UpdateCheckOptions.cs @@ -7,5 +7,4 @@ public class UpdateCheckOptions public bool IgnoreMaintenance { get; set; } public bool AllowUpdaterAfterInstall { get; set; } = true; public Side Side { get; set; } = Side.Client; - public bool IncludeExtraActions { get; set; } } diff --git a/ModpackUpdater.Model/ModpackConfig.cs b/ModpackUpdater.Model/ModpackConfig.cs index b30e30c..3b8bb6a 100644 --- a/ModpackUpdater.Model/ModpackConfig.cs +++ b/ModpackUpdater.Model/ModpackConfig.cs @@ -8,6 +8,7 @@ public class ModpackConfig public string Name { get; set; } public string UpdateUrl { get; set; } public string InstallUrl { get; set; } + public bool IncludeExtras { get; set; } [JsonIgnore] public string ConfigUrl { get; set; } diff --git a/ModpackUpdater/Options.cs b/ModpackUpdater/Options.cs index 488774a..e4c4fac 100644 --- a/ModpackUpdater/Options.cs +++ b/ModpackUpdater/Options.cs @@ -24,7 +24,6 @@ internal class Options { "uai", "Allow an update directly after install. This only has affect if there is no existing installation.", uai => UpdateOptions.AllowUpdaterAfterInstall = uai != null}, { "noupdate", "Skip the update check.", noupdate => UpdateOptions.NoUpdate = noupdate != null}, { "m|maintenance", "Ignores the maintenance mode.", m => UpdateOptions.IgnoreMaintenance = m != null}, - { "e|extraactions", "Include extra actions.", e => UpdateOptions.IncludeExtraActions = e != null}, }; additionals.AddRange(options.Parse(args));