From 7ffcb71f64596f384735e4bc26575426f0373da3 Mon Sep 17 00:00:00 2001 From: Nathan Gill Date: Mon, 12 Apr 2021 02:00:04 -0400 Subject: [PATCH] Added option to reset the repo if something goes wrong --- DeliCounter/Backend/ModRepository.cs | 7 +++++++ DeliCounter/Controls/ModRepositoryStatus.xaml | 5 ++++- DeliCounter/Controls/ModRepositoryStatus.xaml.cs | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/DeliCounter/Backend/ModRepository.cs b/DeliCounter/Backend/ModRepository.cs index bcbc6e3..f46f5a7 100644 --- a/DeliCounter/Backend/ModRepository.cs +++ b/DeliCounter/Backend/ModRepository.cs @@ -311,6 +311,13 @@ private void LoadModCache() } } + public void Reset() + { + if (Repo is not null) Repo.Dispose(); + if (Directory.Exists(RepoPath)) Directory.Delete(RepoPath, true); + Refresh(); + } + /// /// Writes the installed mods cache to the game folder /// diff --git a/DeliCounter/Controls/ModRepositoryStatus.xaml b/DeliCounter/Controls/ModRepositoryStatus.xaml index 6701a89..d91cf2f 100644 --- a/DeliCounter/Controls/ModRepositoryStatus.xaml +++ b/DeliCounter/Controls/ModRepositoryStatus.xaml @@ -18,6 +18,9 @@ Please wait... -