mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix console coloring
This commit is contained in:
@@ -31,16 +31,13 @@ namespace SabreTools.Core
|
|||||||
if (!Console.IsOutputRedirected)
|
if (!Console.IsOutputRedirected)
|
||||||
{
|
{
|
||||||
// Set the console to ready state
|
// Set the console to ready state
|
||||||
ConsoleColor formertext = ConsoleColor.White;
|
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||||
ConsoleColor formerback = ConsoleColor.Black;
|
|
||||||
if (!CoreEnvironment)
|
|
||||||
{
|
|
||||||
Console.SetBufferSize(Console.BufferWidth, 999);
|
Console.SetBufferSize(Console.BufferWidth, 999);
|
||||||
formertext = Console.ForegroundColor;
|
|
||||||
formerback = Console.BackgroundColor;
|
ConsoleColor formertext = Console.ForegroundColor;
|
||||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
ConsoleColor formerback = Console.BackgroundColor;
|
||||||
Console.BackgroundColor = ConsoleColor.Blue;
|
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||||
}
|
Console.BackgroundColor = ConsoleColor.Blue;
|
||||||
|
|
||||||
Console.Title = $"{program} {Version}";
|
Console.Title = $"{program} {Version}";
|
||||||
|
|
||||||
@@ -51,23 +48,8 @@ namespace SabreTools.Core
|
|||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
|
|
||||||
// Return the console to the original text and background colors
|
// Return the console to the original text and background colors
|
||||||
if (!CoreEnvironment)
|
Console.ForegroundColor = formertext;
|
||||||
{
|
|
||||||
Console.ForegroundColor = formertext;
|
|
||||||
Console.BackgroundColor = formerback;
|
Console.BackgroundColor = formerback;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns true if running in a .NET Core environment
|
|
||||||
/// </summary>
|
|
||||||
/// TODO: Investigate if this is needed when removing .NET Framework 4.8 support
|
|
||||||
private static bool CoreEnvironment
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user