diff --git a/CHANGELOG.md b/CHANGELOG.md index 36f7519fa..5e2de87a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ ### v0.5.2 Open-Beta: 1. Fixed Issue with --melonloader.basedir Launch Option not finding Bootstrap.dll. +2. Fixed Issue with Console not properly Coloring Melon Names. (Credits to [benaclejames](https://github.com/benaclejames) :D) --- diff --git a/MelonLoader/Utils/MelonLogger.cs b/MelonLoader/Utils/MelonLogger.cs index d75054c01..b61dcbc4e 100644 --- a/MelonLoader/Utils/MelonLogger.cs +++ b/MelonLoader/Utils/MelonLogger.cs @@ -40,7 +40,15 @@ public class MelonLogger private static void NativeMsg(ConsoleColor namesection_color, ConsoleColor txt_color, string namesection, string txt) { - namesection ??= MelonUtils.GetMelonFromStackTrace()?.Info?.Name?.Replace(" ", "_"); + if (string.IsNullOrEmpty(namesection)) + { + MelonBase melon = MelonUtils.GetMelonFromStackTrace(); + if (melon != null) + { + namesection = melon.Info?.Name?.Replace(" ", "_"); + namesection_color = melon.ConsoleColor; + } + } Internal_Msg(namesection_color, txt_color, namesection, txt ?? "null"); RunMsgCallbacks(namesection_color, txt_color, namesection, txt ?? "null");