diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-06 11:15:46 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-06 11:15:46 -0500 |
commit | 956e477edb515953e71d1cce1a728284f6ce3cc0 (patch) | |
tree | c24db349e8d9d9c42c0258b83a07aad217904984 /src/StardewModdingAPI/Program.cs | |
parent | e4d6cc138129153d654f43aabed16d2ba482beee (diff) | |
download | SMAPI-956e477edb515953e71d1cce1a728284f6ce3cc0.tar.gz SMAPI-956e477edb515953e71d1cce1a728284f6ce3cc0.tar.bz2 SMAPI-956e477edb515953e71d1cce1a728284f6ce3cc0.zip |
add developer mode which shows all deprecation warnings, update release process (#165)
Diffstat (limited to 'src/StardewModdingAPI/Program.cs')
-rw-r--r-- | src/StardewModdingAPI/Program.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index e9e357d5..047d74c7 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Windows.Forms; #endif using Microsoft.Xna.Framework.Graphics; +using Newtonsoft.Json; using StardewModdingAPI.Events; using StardewModdingAPI.Framework; using StardewModdingAPI.Inheritance; @@ -67,6 +68,18 @@ namespace StardewModdingAPI // set thread culture for consistent log formatting Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB"); + // load user settings + { + string settingsPath = $@"{Constants.ExecutionPath}\{typeof(Program).Assembly.GetName().Name}-settings.json"; + if (File.Exists(settingsPath)) + { + string json = File.ReadAllText(settingsPath); + UserSettings settings = JsonConvert.DeserializeObject<UserSettings>(json); + Program.DeprecationManager.SendNoticesToConsole = settings?.DeveloperMode == true; + } + + } + // hook into & launch the game try { @@ -271,7 +284,7 @@ namespace StardewModdingAPI } // log deprecated fields - if(manifest.UsedAuthourField) + if (manifest.UsedAuthourField) Program.DeprecationManager.Warn(manifest.Name, $"{nameof(Manifest)}.{nameof(Manifest.Authour)}", "1.0", DeprecationLevel.Notice); } catch (Exception ex) |