From 86ca9023b4f4d24afebe128329ffbf1379fe96c1 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Thu, 24 Jan 2019 23:05:10 +0900 Subject: [PATCH] force loading local default settings on first run --- Core/Main/PTMagic.cs | 3 ++- Core/ProfitTrailer/SettingsHandler.cs | 1 - PTMagic/Program.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/Main/PTMagic.cs b/Core/Main/PTMagic.cs index bfd0e62..5e3ef98 100644 --- a/Core/Main/PTMagic.cs +++ b/Core/Main/PTMagic.cs @@ -559,6 +559,7 @@ namespace Core.Main SettingsFiles.CheckPresets(this.PTMagicConfiguration, this.Log, true); + EnforceSettingsReapply = true; this.StartPTMagicIntervalTimer(); return result; @@ -903,7 +904,7 @@ namespace Core.Main FileInfo generalSettingsFile = new FileInfo(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "settings.general.json"); FileInfo analyzerSettingsFile = new FileInfo(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "settings.analyzer.json"); - if (generalSettingsFile.LastWriteTime > this.LastSettingFileCheck || analyzerSettingsFile.LastWriteTime > this.LastSettingFileCheck) + if (generalSettingsFile.LastWriteTime > this.LastSettingFileCheck || analyzerSettingsFile.LastWriteTime > this.LastSettingFileCheck || EnforceSettingsReapply) { Log.DoLogInfo("Detected configuration changes. Reloading settings..."); diff --git a/Core/ProfitTrailer/SettingsHandler.cs b/Core/ProfitTrailer/SettingsHandler.cs index b0654fe..37481c2 100644 --- a/Core/ProfitTrailer/SettingsHandler.cs +++ b/Core/ProfitTrailer/SettingsHandler.cs @@ -90,7 +90,6 @@ namespace Core.ProfitTrailer fileLines.Insert(0, "# ####################################"); fileLines.Insert(0, "# PTMagic_LastChanged = " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString()); fileLines.Insert(0, "# PTMagic_ActiveSetting = " + SystemHelper.StripBadCode(ptmagicInstance.DefaultSettingName, Constants.WhiteListProperties)); - fileLines.Insert(0, "# ####### PTMagic Current Setting ########"); fileLines.Insert(0, "# ####################################"); ptmagicInstance.GetType().GetProperty(fileType + "Lines").SetValue(ptmagicInstance, fileLines); diff --git a/PTMagic/Program.cs b/PTMagic/Program.cs index 43c3d10..31a3b7c 100644 --- a/PTMagic/Program.cs +++ b/PTMagic/Program.cs @@ -7,7 +7,7 @@ using Core.Helper; using Core.Main.DataObjects.PTMagicData; using Microsoft.Extensions.DependencyInjection; -[assembly: AssemblyVersion("2.1.0")] +[assembly: AssemblyVersion("2.1.1")] [assembly: AssemblyProduct("PT Magic")] namespace PTMagic