diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-02-16 01:03:50 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-02-16 01:03:50 -0500 |
commit | 960507879eacc0a760862c269b39f9d7448a7bd5 (patch) | |
tree | 34b0ae022a61f0d84fb2640cf78f49fff4d64c03 | |
parent | 176eddbf7b70934c2665aa3a0ac8b46bef04012a (diff) | |
download | SMAPI-960507879eacc0a760862c269b39f9d7448a7bd5.tar.gz SMAPI-960507879eacc0a760862c269b39f9d7448a7bd5.tar.bz2 SMAPI-960507879eacc0a760862c269b39f9d7448a7bd5.zip |
remove unneeded property for game exe path
-rw-r--r-- | src/StardewModdingAPI/Log.cs | 14 | ||||
-rw-r--r-- | src/StardewModdingAPI/Program.cs | 28 |
2 files changed, 19 insertions, 23 deletions
diff --git a/src/StardewModdingAPI/Log.cs b/src/StardewModdingAPI/Log.cs index da98baba..a8d78e55 100644 --- a/src/StardewModdingAPI/Log.cs +++ b/src/StardewModdingAPI/Log.cs @@ -15,15 +15,11 @@ namespace StardewModdingAPI /// <summary>Manages deprecation warnings.</summary> private static DeprecationManager DeprecationManager; - - /********* - ** Accessors - *********/ /// <summary>The underlying logger.</summary> - internal static Monitor Monitor; + private static Monitor Monitor; /// <summary>Tracks the installed mods.</summary> - internal static ModRegistry ModRegistry; + private static ModRegistry ModRegistry; /********* @@ -31,9 +27,13 @@ namespace StardewModdingAPI *********/ /// <summary>Injects types required for backwards compatibility.</summary> /// <param name="deprecationManager">Manages deprecation warnings.</param> - internal static void Shim(DeprecationManager deprecationManager) + /// <param name="monitor">The underlying logger.</param> + /// <param name="modRegistry">Tracks the installed mods.</param> + internal static void Shim(DeprecationManager deprecationManager, Monitor monitor, ModRegistry modRegistry) { Log.DeprecationManager = deprecationManager; + Log.Monitor = monitor; + Log.ModRegistry = modRegistry; } /**** diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index 0857d41b..41e12394 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -105,18 +105,7 @@ namespace StardewModdingAPI Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB"); // for consistent log formatting this.Monitor.Log($"SMAPI {Constants.ApiVersion} with Stardew Valley {Game1.version} on {Environment.OSVersion}", LogLevel.Info); - // inject compatibility shims -#pragma warning disable 618 - Command.Shim(this.CommandManager, this.DeprecationManager, this.ModRegistry); - Config.Shim(this.DeprecationManager); - InternalExtensions.Shim(this.ModRegistry); - Log.Shim(this.DeprecationManager); - Mod.Shim(this.DeprecationManager); - PlayerEvents.Shim(this.DeprecationManager); - TimeEvents.Shim(this.DeprecationManager); -#pragma warning restore 618 - - // read config + // read settings { string settingsPath = Constants.ApiConfigPath; if (File.Exists(settingsPath)) @@ -130,6 +119,17 @@ namespace StardewModdingAPI File.WriteAllText(settingsPath, JsonConvert.SerializeObject(this.Settings, Formatting.Indented)); } + // inject compatibility shims +#pragma warning disable 618 + Command.Shim(this.CommandManager, this.DeprecationManager, this.ModRegistry); + Config.Shim(this.DeprecationManager); + InternalExtensions.Shim(this.ModRegistry); + Log.Shim(this.DeprecationManager, this.GetSecondaryMonitor("legacy mod"), this.ModRegistry); + Mod.Shim(this.DeprecationManager); + PlayerEvents.Shim(this.DeprecationManager); + TimeEvents.Shim(this.DeprecationManager); +#pragma warning restore 618 + // redirect direct console output { Monitor monitor = this.GetSecondaryMonitor("Console.Out"); @@ -152,10 +152,6 @@ namespace StardewModdingAPI // print file paths this.Monitor.Log($"Mods go here: {this.ModPath}"); - // initialise legacy log - Log.Monitor = this.GetSecondaryMonitor("legacy mod"); - Log.ModRegistry = this.ModRegistry; - // hook into & launch the game try { |