From 0d63362ee0ed8a65775106227d1afc704a2812f3 Mon Sep 17 00:00:00 2001 From: Liam Cannon <54691085+liamcannon@users.noreply.github.com> Date: Wed, 25 Sep 2024 09:17:15 -0400 Subject: [PATCH 1/8] Create dependabot.yml --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8ca517d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "nuget" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" From 5c2c0efa629117a6b1ce21964fcdd3c2d2138ac7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:19:45 +0000 Subject: [PATCH 2/8] Bump MahApps.Metro.IconPacks.Material from 4.11.0 to 5.0.0 Bumps [MahApps.Metro.IconPacks.Material](https://github.com/MahApps/MahApps.Metro.IconPacks) from 4.11.0 to 5.0.0. - [Release notes](https://github.com/MahApps/MahApps.Metro.IconPacks/releases) - [Changelog](https://github.com/MahApps/MahApps.Metro.IconPacks/blob/develop/GitReleaseManager.yaml) - [Commits](https://github.com/MahApps/MahApps.Metro.IconPacks/compare/4.11.0...5.0.0) --- updated-dependencies: - dependency-name: MahApps.Metro.IconPacks.Material dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- FASTER/FASTER.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FASTER/FASTER.csproj b/FASTER/FASTER.csproj index 8e9ee5c..0dc1983 100644 --- a/FASTER/FASTER.csproj +++ b/FASTER/FASTER.csproj @@ -58,7 +58,7 @@ - + From 1ab89e474cafc9bc16ba60e3d99b8e41804de73b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 02:58:58 +0000 Subject: [PATCH 3/8] Bump MahApps.Metro.IconPacks.Modern from 4.11.0 to 5.0.0 Bumps [MahApps.Metro.IconPacks.Modern](https://github.com/MahApps/MahApps.Metro.IconPacks) from 4.11.0 to 5.0.0. - [Release notes](https://github.com/MahApps/MahApps.Metro.IconPacks/releases) - [Changelog](https://github.com/MahApps/MahApps.Metro.IconPacks/blob/develop/GitReleaseManager.yaml) - [Commits](https://github.com/MahApps/MahApps.Metro.IconPacks/compare/4.11.0...5.0.0) --- updated-dependencies: - dependency-name: MahApps.Metro.IconPacks.Modern dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- FASTER/FASTER.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FASTER/FASTER.csproj b/FASTER/FASTER.csproj index 0dc1983..07dda1b 100644 --- a/FASTER/FASTER.csproj +++ b/FASTER/FASTER.csproj @@ -59,7 +59,7 @@ - + From c8b4dc8dc5090fe1b02026241d231181cd7c8215 Mon Sep 17 00:00:00 2001 From: Liam Cannon <54691085+liamcannon@users.noreply.github.com> Date: Thu, 26 Sep 2024 23:25:49 -0400 Subject: [PATCH 4/8] mocked up the purge and reinstall functionality --- FASTER/Models/ArmaMod.cs | 2 -- FASTER/ViewModel/ModsViewModel.cs | 45 ++++++++++++++++++++++++++----- FASTER/Views/Mods.xaml | 3 +++ FASTER/Views/Mods.xaml.cs | 6 +++++ 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/FASTER/Models/ArmaMod.cs b/FASTER/Models/ArmaMod.cs index f458a90..23eb5b1 100644 --- a/FASTER/Models/ArmaMod.cs +++ b/FASTER/Models/ArmaMod.cs @@ -62,8 +62,6 @@ public void AddSteamMod(ArmaMod newMod) public void DeleteSteamMod(uint workshopId) { - - try { var currentProfiles = ReloadMods(); diff --git a/FASTER/ViewModel/ModsViewModel.cs b/FASTER/ViewModel/ModsViewModel.cs index 9e4aaf1..51a6554 100644 --- a/FASTER/ViewModel/ModsViewModel.cs +++ b/FASTER/ViewModel/ModsViewModel.cs @@ -26,7 +26,7 @@ public ModsViewModel() internal void DisplayMessage(string msg) { - MainWindow.Instance.IFlyout.IsOpen = true; + MainWindow.Instance.IFlyout.IsOpen = true; MainWindow.Instance.IFlyoutMessage.Content = msg; } @@ -62,7 +62,7 @@ public async Task AddSteamMod() var mod = new ArmaMod { WorkshopId = modIDOut, - Path = Path.Combine(Properties.Settings.Default.modStagingDirectory, modID), + Path = Path.Combine(Properties.Settings.Default.modStagingDirectory, modID), IsLocal = false }; @@ -107,7 +107,8 @@ public async Task AddLocalModAsync() continue; } - await Task.Factory.StartNew(() => { + await Task.Factory.StartNew(() => + { Directory.CreateSymbolicLink(newPath, oldPath); var progressDone = oldPaths.IndexOf(oldPath); progress.SetMessage($"Copying mod from {oldPath}\n{progressDone} / {progress.Maximum}"); @@ -164,6 +165,36 @@ internal async Task DeleteAllMods() } } + internal async Task PurgeAndReinstall() + { + var answer = await DialogCoordinator.ShowInputAsync(this, "Are you sure you want to purge and reinstall all mods?", "Write \"yes\" and press OK if you wish to continue."); + + if (string.IsNullOrEmpty(answer) || !answer.Equals("yes")) + return; + + Analytics.TrackEvent("Mods - Clicked PurgeAndReinstall", new Dictionary + { + {"Name", Properties.Settings.Default.steamUserName} + }); + + IList copyArmaMods = new List(ModsCollection.ArmaMods.Where(x => !x.IsLocal)); + + foreach (var mod in copyArmaMods) + { + DeleteMod(mod); + ModsCollection.AddSteamMod(mod); + } + + await UpdateAll(); + + // we want all the mods re added and updated before we redeploy them + foreach (var mod in copyArmaMods) + { + DeploymentViewModel model = new(); + model.DeployMod(new DeploymentMod(mod)); + } + } + public void OpenModPage(ArmaMod mod) { if (mod == null) @@ -178,7 +209,7 @@ public void OpenModPage(ArmaMod mod) try { url = url.Replace("&", "^&"); - Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") {CreateNoWindow = true}); + Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true }); } catch { DisplayMessage($"Could not open \"{url}\""); } @@ -205,7 +236,7 @@ internal async Task OpenLauncherFile() continue; } - if(!await Task.Run(() => extractedMod.IsOnWorkshop())) + if (!await Task.Run(() => extractedMod.IsOnWorkshop())) continue; ModsCollection.AddSteamMod(extractedMod); @@ -223,7 +254,7 @@ public void OpenModFolder(ArmaMod mod) ProcessStartInfo startInfo = new() { Arguments = mod.Path, - FileName = "explorer.exe" + FileName = "explorer.exe" }; Process.Start(startInfo); @@ -251,7 +282,7 @@ public async Task UpdateAll() MainWindow.Instance.NavigateToConsole(); var ans = await MainWindow.Instance.SteamUpdaterViewModel.RunModsUpdater(ModsCollection.ArmaMods); - if(ans == UpdateState.LoginFailed) + if (ans == UpdateState.LoginFailed) DisplayMessage("Steam Login Failed"); } } diff --git a/FASTER/Views/Mods.xaml b/FASTER/Views/Mods.xaml index ab18255..5207c97 100644 --- a/FASTER/Views/Mods.xaml +++ b/FASTER/Views/Mods.xaml @@ -51,6 +51,9 @@