mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Fix console background color
- Save & Restore background color when needed - Remove useless color modifications - Fix issue #71
This commit is contained in:
parent
aaced855d8
commit
82c95be611
2 changed files with 6 additions and 9 deletions
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue