diff --git a/MinecraftClient/ChatBots/Alerts.cs b/MinecraftClient/ChatBots/Alerts.cs index b60a39ee..5cdff088 100644 --- a/MinecraftClient/ChatBots/Alerts.cs +++ b/MinecraftClient/ChatBots/Alerts.cs @@ -67,10 +67,13 @@ namespace MinecraftClient.ChatBots if (ConsoleIO.basicIO) //Using a GUI? Pass text as is. ConsoleIO.WriteLine(text.Replace(alert, "§c" + alert + "§r")); - else //Using Consome Prompt : Print text with alert highlighted + else //Using Console Prompt : Print text with alert highlighted { string[] splitted = text.Split(new string[] { alert }, StringSplitOptions.None); + ConsoleColor fore = Console.ForegroundColor; + ConsoleColor back = Console.BackgroundColor; + if (splitted.Length > 0) { Console.BackgroundColor = ConsoleColor.DarkGray; @@ -89,8 +92,8 @@ namespace MinecraftClient.ChatBots } } - Console.BackgroundColor = ConsoleColor.Black; - Console.ForegroundColor = ConsoleColor.Gray; + Console.BackgroundColor = back; + Console.ForegroundColor = fore; ConsoleIO.Write('\n'); } } diff --git a/MinecraftClient/ConsoleIO.cs b/MinecraftClient/ConsoleIO.cs index f73514a5..ac627c28 100644 --- a/MinecraftClient/ConsoleIO.cs +++ b/MinecraftClient/ConsoleIO.cs @@ -193,8 +193,6 @@ namespace MinecraftClient writing_lock = true; if (reading) { - ConsoleColor fore = Console.ForegroundColor; - ConsoleColor back = Console.BackgroundColor; string buf = buffer; string buf2 = buffer2; ClearLineAndBuffer(); @@ -208,8 +206,6 @@ namespace MinecraftClient } else Console.Write("\b \b"); Console.Write(text); - Console.ForegroundColor = ConsoleColor.Gray; - Console.BackgroundColor = ConsoleColor.Black; buffer = buf; buffer2 = buf2; Console.Write(">" + buffer); @@ -218,8 +214,6 @@ namespace MinecraftClient Console.Write(buffer2 + " \b"); for (int i = 0; i < buffer2.Length; i++) { GoBack(); } } - Console.ForegroundColor = fore; - Console.BackgroundColor = back; } else Console.Write(text); writing_lock = false;