From cfbe5179a8212acb6d2f84a3cea414f73744918a Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Sun, 17 Jul 2022 15:27:48 +0200 Subject: [PATCH] better check for cache directory existing on startup --- MareSynchronos/Configuration.cs | 7 +++++++ MareSynchronos/UI/IntroUI.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/MareSynchronos/Configuration.cs b/MareSynchronos/Configuration.cs index 78fdb3a..d72f749 100644 --- a/MareSynchronos/Configuration.cs +++ b/MareSynchronos/Configuration.cs @@ -87,6 +87,13 @@ namespace MareSynchronos public void Initialize(DalamudPluginInterface pluginInterface) { _pluginInterface = pluginInterface; + + if (!Directory.Exists(CacheFolder)) + { + InitialScanComplete = false; + } + + Save(); } public void Save() diff --git a/MareSynchronos/UI/IntroUI.cs b/MareSynchronos/UI/IntroUI.cs index 3903f89..8b20977 100644 --- a/MareSynchronos/UI/IntroUI.cs +++ b/MareSynchronos/UI/IntroUI.cs @@ -181,7 +181,7 @@ namespace MareSynchronos.UI UiShared.ColorTextWrapped("You do not have a valid Penumbra path set. Open Penumbra and set up a valid path for the mod directory.", ImGuiColors.DalamudRed); } - if (!_fileCacheManager.IsScanRunning && !string.IsNullOrEmpty(_pluginConfiguration.CacheFolder) && _uiShared.HasValidPenumbraModPath) + if (!_fileCacheManager.IsScanRunning && !string.IsNullOrEmpty(_pluginConfiguration.CacheFolder) && _uiShared.HasValidPenumbraModPath && Directory.Exists(_pluginConfiguration.CacheFolder)) { UiShared.TextWrapped("You can adjust how many parallel threads will be used for scanning. Mind that ultimately it will depend on the amount of mods, your disk speed and your CPU. " + "More is not necessarily better, the default of 10 should be fine for most cases.");