From 97710d6f47ca180540d8b5c203ae6f4ca089fcb8 Mon Sep 17 00:00:00 2001 From: bladeoflight16 <1159076+bladeoflight16@users.noreply.github.com> Date: Tue, 27 Jul 2021 17:17:56 -0400 Subject: Fixing mono incompatibility (case exception type statement without variable) --- src/SMAPI/Framework/Logging/LogManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SMAPI/Framework/Logging') diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index a4df3c18..2cd512e0 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -258,7 +258,7 @@ namespace StardewModdingAPI.Framework.Logging break; // path too long exception - case PathTooLongException: + case PathTooLongException _: { string[] affectedPaths = PathUtilities.GetTooLongPaths(Constants.ModsPath).ToArray(); string message = affectedPaths.Any() -- cgit From 880cd7b8bacfcee2cc6a8e15b6b8ea5e05e9467c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 28 Jul 2021 21:20:44 -0400 Subject: fix handling of Unicode characters in console --- src/SMAPI/Framework/Logging/LogManager.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/SMAPI/Framework/Logging') diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index 2cd512e0..e16b5c0d 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; +using System.Text; using System.Text.RegularExpressions; using System.Threading; using StardewModdingAPI.Framework.Commands; @@ -106,6 +107,10 @@ namespace StardewModdingAPI.Framework.Logging if (writeToConsole) output.OnMessageIntercepted += message => this.HandleConsoleMessage(this.MonitorForGame, message); Console.SetOut(output); + + // enable Unicode handling + Console.InputEncoding = Encoding.Unicode; + Console.OutputEncoding = Encoding.Unicode; } /// Get a monitor instance derived from SMAPI's current settings. -- cgit From 948c800a98f00b1bdcfd05ee6228e3423f9eb465 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 30 Jul 2021 00:54:15 -0400 Subject: migrate to the new Harmony patch pattern used in my mods That improves validation and error-handling. --- src/SMAPI/Framework/Logging/LogManager.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/SMAPI/Framework/Logging') diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index e16b5c0d..a3d4f23d 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -9,6 +9,7 @@ using System.Threading; using StardewModdingAPI.Framework.Commands; using StardewModdingAPI.Framework.Models; using StardewModdingAPI.Framework.ModLoading; +using StardewModdingAPI.Internal; using StardewModdingAPI.Internal.ConsoleWriting; using StardewModdingAPI.Toolkit.Framework.ModData; using StardewModdingAPI.Toolkit.Utilities; -- cgit