diff --git a/.gitignore b/.gitignore index add57be..9c7176e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ bin/ obj/ /packages/ riderModule.iml -/_ReSharper.Caches/ \ No newline at end of file +/_ReSharper.Caches/ +releases/ diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 9e76128..5dd0ed6 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyFileVersion("0.1.0.0")] +[assembly: AssemblyVersion("0.1.1.0")] +[assembly: AssemblyFileVersion("0.1.1.0")] [assembly: ComponentFactory(typeof(VampireSurvivorsFactory))] diff --git a/UI/Components/VampireSurvivorsComponent.cs b/UI/Components/VampireSurvivorsComponent.cs index e5870be..5c9b995 100644 --- a/UI/Components/VampireSurvivorsComponent.cs +++ b/UI/Components/VampireSurvivorsComponent.cs @@ -28,12 +28,16 @@ public class VampireSurvivorsComponent : ControlComponent { Settings = new VampireSurvivorsSettings(); _control = (VampireSurvivorsControl)Control; ResetState(); - + CurrentState.OnStart += state_OnStart; CurrentState.OnReset += state_OnReset; } private void state_OnStart(object sender, EventArgs e) { + if (string.IsNullOrEmpty(Settings.VsInstallDir)) { + return; + } + _saveWatcher = new FileSystemWatcher(Path.Combine(Settings.VsInstallDir, SaveData.SaveDataDir)); _saveWatcher.Filter = SaveData.SaveDataFile; _saveWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size | NotifyFilters.CreationTime; @@ -52,7 +56,7 @@ out State state private void state_OnReset(object sender, TimerPhase _) => StopWatching(); private void StopWatching() { - _saveWatcher.Dispose(); + _saveWatcher?.Dispose(); _saveWatcher = null; ResetState(); } diff --git a/UI/Components/VampireSurvivorsFactory.cs b/UI/Components/VampireSurvivorsFactory.cs index 9736be8..bfa9d3a 100644 --- a/UI/Components/VampireSurvivorsFactory.cs +++ b/UI/Components/VampireSurvivorsFactory.cs @@ -1,4 +1,5 @@ using System; +using System.Reflection; using LiveSplit.Model; namespace LiveSplit.UI.Components { @@ -6,7 +7,7 @@ public class VampireSurvivorsFactory : IComponentFactory { public string ComponentName => "Vampire Survivors Tracker"; public string Description => "Displays achievements obtained so far in the current Vampire Survivors run."; - public Version Version => Version.Parse("0.1.0"); + public Version Version => Assembly.GetExecutingAssembly().GetName().Version; public ComponentCategory Category => ComponentCategory.Information; public string UpdateName => ComponentName; diff --git a/UI/Components/VampireSurvivorsSettings.cs b/UI/Components/VampireSurvivorsSettings.cs index a900528..ffd4f29 100644 --- a/UI/Components/VampireSurvivorsSettings.cs +++ b/UI/Components/VampireSurvivorsSettings.cs @@ -50,9 +50,12 @@ private void btnSelectVsDir_Click(object sender, EventArgs e) { MessageBoxButtons.OK, MessageBoxIcon.Error ); + txtVsDir.Text = ""; + VsInstallDir = null; return; } + txtVsDir.Text = vsDir; VsInstallDir = vsDir; }